Chameleon Sources

To make things a little easier on myself in preparation for the release of myHack 3.0+ I’ve pulled the latest chameleon from svn, applied some fixes specific to git, myHack and my ML patch, and pushed it to my git account. You will now be able to view/access the Chameleon source I use for myHack there. The link will be placed in the appropriate places on this site as well as in the footer for future reference.

https://github.com/Conti/Chameleon

Update to Chameleon Bug

Note: As of myHack 2.1 this bug has been resolved and is no longer an issue – although if you do not have your VESA graphics mode defined on problem systems the apple logo will not be centered, but rather, it will be in the top left of the screen and you will not be able to see the spinner wheel – the system will boot though.

After a few more hours of meklort toying around and me helping to test the builds this problem has been solved, well for the most part…

Chameleon build 1407+ boots as would be expected with -v boot flag, without flags
however there is a minor problem still. The apple logo will appear in top left corner of screen, the rest of the screen is blank (black) and no spinner is visible. If patient though it will boot still, rather than hanging. Having a VESA resolution defined in the Boot plist will avoid this undesirable behavior on effected systems, but at least it will still boot even without, so that’s good enough for free software as they say.

I will be releasing an update to the myHack app with a newer build of Chameleon as well as a few other small changes in the days to come.

Original Post:

So I woke up refreshed this morning and meklort was kind enough to tell me what to replace in boot.c to get builds 1214-1220 to boot. I narrowed down the cause to a single commit.

You can read more here: http://forge.voodooprojects.org/p/chameleon/issues/146/

So by modifying drivers.c and reverting this change I got build 1394 to work as expected but there is probably a better solution to this problem, I’m going to wait until I hear back from the Chameleon team before deciding if I release the next revision of myHack with my alteration of Chameleon 2.0 or with a solution that they come up with.

For now just define the VESA graphics mode in the Boot.plist as I described in my last post.

Chameleon Bug and myHack 2.0 RC4+

Note: As of myHack 2.1 this bug has been resolved and is no longer an issue – although if you do not have your VESA graphics mode defined on problem systems the apple logo will not be centered, but rather, it will be in the top left of the screen and you will not be able to see the spinner wheel – the system will boot though.

So I managed to reproduce and track down this bug that a few people reported to me in build 1332 of Chameleon that I used in myHack RC4+. The bug is as follows:

After boot menu, if booting without flags – instant reboot

After boot menu, if booting with -v boot flag it brings you to a black screen, with a white bar on top that flickers, but that is as far as it goes.

After boot menu, if booting with -f or -x boot flags it will boot.

While the exact cause of this isn’t yet clear to me I have narrowed it down considerably by downloading, compiling and testing many many revisions of the chameleon trunk starting with the one I knew worked that I used in myHack RC3-  (2.0 RC5 revision 1203) my results were as follows:

  • 1221 = broken (bug I mentioned above is reproduced, all future revisions including 2.0 final – r1394 – share this bug)
  • 1220 = can’t boot (other bug)
  • 1219 = can’t boot (other bug)
  • 1217 = can’t boot (other bug)
  • 1216 = build failed
  • 1214 = build failed
  • 1203 = works

 

So going through svn, so much has been changed between then and now it’s hard for me personally to figure out how to fix it, nothing obvious jumps out of me, but I only dabble a bit when it comes to Chameleon’s rather insane code structure.

I spent way more time on this than I should have (hours and hours), but I really wanted to drop the RC from myHack with a nice clean 2.0 Chameleon without the RC on it either, it doesn’t appear I will be able to do that until this bug is fixed – or at least I would prefer not to.

I did find a simple work around though – if you add a VESA graphics mode to your boot plist it will boot normally, in revision 1203 this isn’t needed, but everything after that (that works) apparently needs it on _some_ graphics cards – the card I was testing with is a 9800GTX+. It shouldn’t need it but I recalled from a similar issue I ran into a couple years ago that it might be the case, and indeed it was.

So if you are having this issue open up org.chameleon.Boot.plist and add:

    <key>Graphics Mode</key>
<string>1024x768x32</string>

for 4:3 displays – or for 16:9 something like:

    <key>Graphics Mode</key>
<string>1280x720x32</string>

etc…

NOTE: The VESA mode you define must be supported by your graphics card bios and your monitor, using ?video at the chameleon boot prompt will give you a list of the modes supported by your graphics card.

I’ve passed these findings along to cosmo1t and meklort and I’m sure they will look into the matter further, but the information I posted above will help in the meantime if you happen to run into this problem.

Chameleon v2.0-RC4 AsereBLN myHack v1.0.1-r116

This is a minor revision and important bugfix to my previous Chameleon release.

Read the full “Chameleon v2.0-RC4 AsereBLN myHack” bootloader release notes here.

Changelog:

v1.0.1 r116:

  • Bugfix: Fix for “Memory allocation error! Addr=0xdeadbeef, Size=0x0” – if no VESA resolution defined in com.apple.Boot.plist.
  • – Minor cosmetic changes.
  • – Improved “myHack” boot theme.

You may download Chameleon_v2.0-RC4_AsereBLN_myHack_v1.0.1-r116.tar.bz2 [binary only] here.
You may download Chameleon_v2.0-RC4_AsereBLN_myHack_v1.0.1-r116.src.tar.bz2 [source code] here.

Chameleon v2.0-RC4 AsereBLN myHack v1.0-r111

This version is now deprecated, consult the Downloads Page for a link to the latest version.

I have taken a snapshot from aserebln’s github (with all the changes he made up till 2010/02/12) and modified it with some additional alterations both cosmetic and functional, the most important of which was removing the pciroot detection he included from PCEFI 10.5 – it causes an unrecoverable memory fault on systems with integrated graphics cards (making it impossible to boot the system) and uses a different definition for PciRoot in com.apple.Boot.plist than myHack installer has been configured to define. It has been compiled without an integrated theme reducing it’s size and improving boot performance. This bootloader includes all of the features of Chameleon RC4 & PC EFI 10.5 + many bugfixes, syntax corrections, optimizations, and new features including but not limited to the following:

Note: Items which have been crossed out are a part of the memory detection code aserebln has been working on, however aserebln has not yet publicly released the source code for this memory detection. They will be included in any future release of this branch as soon as he releases the source code. Don’t worry though, this is purely cosmetic stuff – and if you really want your memory to be detected properly by OS X you can simply put the correct values into an smbios.plist in /Extra

AsereBLN changes:

  1. FACP RestartFix is enabled by default if you have an Intel CPU
  2. Memory Manufactor Code Lookup for some common Vendors (OCZ, G.Skill, GeIL, Crossair, Kingston)
  3. Fixed a bug with Memory Manufactor Code Lookup (DDR3: ManufactorID, Parity-Bit)
  4. Added Patriot, Crucial, A-DATA Memory Manufactor
  5. Support for 945 northbridge and ICH8, ICH7 southbridges
  6. SMBus Device Enable for systems there the controller is disabled (Tip from iNDi)
  7. printout a message if theme fails to load due to a missing file
  8. removed a print in non verbose mode to keep the Booter quiet
  9. You can supply a system-id with system-id= in com.apple.Boot.plist
  10. You can prevent the system-id injection with system-id=No in com.apple.Boot.plist
  11. system-type is now supported. Default is 1 (Desktop). Use system-type=2 in com.apple.Boot.plist if you have laptop.
  12. Removed the setVideoMode(TEXT) in resume.c to make Hibernation work.
  13. Support for 946GZ/PZ, Q963/Q965a and P965 northbridge memory controllers.
  14. Fixed a bug with system-type injection
  15. The system-type which gets injected is printed in verbose mode
  16. Added more memory manufactors.
  17. Support for 965GM and 965GME northbridge memory controllers (still untesteted).
  18. Improved system-type injection. ACPI V2 FACP PM_Profile is patched to match system-type.
  19. Fixed a bug with system-id injection (com.apple.Boot.plist).
  20. Supported memory manufactors: Micron, Samsung, Transcend, Apacer, Kingston, PNY, MDT, Corsair, GeIL, takeMS, Buffalo, Mushkin, OCZ, A-DATA, G.SKILL, TeamElite, Patriot and Crucial.
  21. Supported memory controllers: Core i5/i7 IMC, 945G/P, 955X, 945GM/PM, 945GME, 946GZ/PZ, Q963/Q965, P965, P35, X38/X48, 965GM, 965GME and P45.
  22. Supported SMBus controllers: P55, ICH10, ICH9, ICH8 and ICH7.
  23. To set system-type put a system-type= into com.apple.Boot.plist (1=Desktop, 2=Laptop enables Battery, 3=Workstation). Default system-type is 1 (Desktop).
  24. Fixed the font swapping bug (small & console font).
  25. Fixed a problem with disabled MCH MMIO on some mainboards (needed to detect dram frequency).
  26. Fixed the font swapping bug (small & console font) for the Booter with an embedded theme.
  27. Fixed an issue with memory detection for some mainboard (2 slot only mainboards).
  28. Added support for PM45 northbridge memory controller.
  29. Added memory manufactor lookup for: Hynix, Nanya, KingMax, Qimonda and SuperTalent.
  30. Added nVidia GT240 device lookup.
  31. You can now hide HFS partitions too using “Hide Partition” in com.apple.Boot.plist.
  32. Made the verbose output when using nVidia/ATI ROM’s more useful.
  33. Fixed a bug with sprintf (rek).
  34. Merged hibernation fix from Chameleon repo (46).
  35. Made verbosity at early bootstage useable.
  36. Added nVidia ION device lookup.
  37. Added a feature to set/override the nVidia NVCAP value using NVCAP_ key in com.apple.Boot.plist.

If you want to override the NVCAP value, you must determine the PCI DeviceID of your graphic card. For instance: my new GTX260 has the DeviceID 0×05e2. Knowing the DeviceID add this to your com.apple.Boot.plist:

<key>NVCAP_05e2</key>
<string>0000000000000000000000000000000000000000</string>

The NVCAP value is exactly 20 bytes long. You have to specify it in binary form using ASCII-HEX (0-9,a-f). For instance like this:

0400000000000300040000000000000700000000

It’s the NVCAP value of my nVidia 9400GT taken directly from NVCap Maker. Do not use a Base64 encoded NVCAP value like this one: BAAAAAAAAwAEAAAAAAAABwAAAAA=. To decode Base64 use the following command:

echo “BAAAAAAAAwAMAAAAAAAABwAAAAA=” | openssl enc -d -base64 | xxd -p

myHack changes:

  1. Removed pciroot uid detection code and reverted all references to it back to standard chameleon rc4 method
  2. Cleaned up cosmetic features such as version info output generation
  3. Added additional information to non-gui boot prompt

In conclusion, this is the best thing out there for retail installs on the systems which the myHack Installer has been designed and optimized for!

A big thanks to AsereBLN, netkas, rekursor, and everyone else who has worked on this!

You may download Chameleon_v2.0-RC4_AsereBLN_myHack_v1.0-r111.zip [binary only] here.

You may download Chameleon_v2.0-RC4_AsereBLN_myHack_v1.0-r111.src.zip [source code only] here.