Jump to content
  • 0
Sign in to follow this  
AsereBLN

AsereBLN Booter - Based on Chameleon RC4 / PCEFI10.5

Question

Happy new year to everyone!

I have a little gift for you :) I was quite inactive here in the last weeks... but not dormant at all. I'm done the first major changes to Chameleon. I'm really disappointed regarding the code quality of Chameleon. It's full of possible buffer overflows, quick & dirty hacks... you can notice that there is no one behind, who is supervising the development, who has and keeps the whole picture in mind. The code quality is really bad :( One example is the use of the boolean datatype. You can find boolean_t, bool, BOOL, int, char... used with 0, 1, TRUE, FALSE, true, false, 0, 1, YES or NO, and this even mixed! So I started to cleanup this mess, fixed some bugs and also added new cool features.

Bugfixes:

  1. First of all I fixed the stupid bug with the fixed Platform UUID.
  2. Fixed a bug regarding PCI-Root-UID different than 0
  3. Fixed a bug regarding the detection of the CPU
  4. Fixed dozens of possible buffer overflows
  5. and all the bugs I forgot to mention

New Features:

  1. You can build Chameleon with GUI-support without the need of an embedded theme (Never understood why this should be necessary). The Booter is a lot smaller now. Only 160 kBytes.
  2. Platform UUID is taken from the BIOS (UUID from SMBIOS Table 1). You can remove PlatformUUID.kext, SMUUID from smbios.plist and also System-ID from com.apple.Boot.plist.
  3. Dynamic memory parameter detecting and injecting like Frequency, Type (DDR2, DDR3), Manufactor, Partnumber, Serialnumber. You can remove all memory related stuff from smbios.plist.
  4. Dynamic PCI-Root-UID detection from PCEFI 10.5
  5. Duvell300's FACP Restart Fix added (from here)

Changes:

  1. Filenames configured in com.apple.Boot.plist (DSDT=..., SMBIOS=...) must be given with the full path. The Booter does not check automatically the Extra Folder. So if you used DSDT=mydsdt.aml and the mydsdt.aml file is in the Extra folder, then you must use now DSDT=/Extra/mydsdt.aml.
  2. ATI and nVidia Video-ROM-Files must be renamed to <vendorid>_<deviceid>.rom and must be put into the Extra folder. vendorid and deviceid as 4-digit hex values without a leading 0x. For instance, a nVidia 9400 GT (55nm) has the vendorid "0x10DE" and the deviceid "0x0641", so the filename must be "10de_0641.rom". To enable nVidia VGA BIOS File Loading use: UseNvidiaROM=Yes in com.apple.Boot.plist. To enable ATI VGA BIOS File Loading use: UseAtiROM=Yes in com.apple.Boot.plist.

If you use the Booter without the embedded theme, then you must supply a Theme in Extra/Themes/ to have GUI support. The default theme name is "Default". You can configure the theme to be used with Theme="Name" in com.apple.Boot.plist.

Platform UUID is setup by injecting /efi/platform/system-id property. The UUID value from SMBIOS table 1 is used as system-id. If your BIOS does not provide an UUID, then you can configure the UUID with SMUUID in smbios.plist. If you set system-id=No in com.apple.Boot.plist, then the system-id is not injected into the IORegistry. Use this if you want/need to use PlatformUUID.kext or something similar.

The memory parameter detecting should work with P35/X38/X48/P45 memory controllers and the builtin memory controllers of the Core i5/i7 CPU's. Reading of memory SPD (Serial Presence Detect EEPROM) data should work on P55, ICH10? and ICH9. You must remove all memory related keys from smbios.plist (SMmemmanufacter_X, SMmempart_X, SMmemserial_X, SMmemspeed & SMmemtype).

Dynamic PCI-Root-UID should work if your DSDT defines the UID like this: Name (UID, <value>). Default PCI-Root-UID is 0. You can configure the PCI-Root-UID to be used with PCIRootUID=<value> in com.apple.Boot.plist (-pci0, -pci1, PciRoot... does not work anymore).

You should also update boot0 (with fdisk) and boot1h with (dd), because the Chameleon team fixed some bugs there.

The archive contains:

  1. boot - the Booter without debugs, without an embedded theme
  2. boot_with_embedded_theme - the Booter without debugs and with an embedded theme
  3. boot_with_debugs - the Booter with some debug messages
  4. boot0 - the fist stage bootloader (goes into the MBR)
  5. boot1h - the second stage bootloader (goes to the beginning of the Chameleon Booter partition)

I ask everyone to use at least one time the Booter with Debugs and to take photos at every "(Press a key to continue...)" stop (PCI-Bus, CPU, Memory-Controller, SPD) to help me to improve Chameleon further. If you have a running Windows on your Hackintosh, then a TXT-Report made with the CPU-Z programm would be very helpful too. If you encounter problems, then use the Booter with debugs. Do not forget to rename it to boot.

Patch against Chameleon-RC4 is included, but without the memory detection stuff. I'll release it after a grace period. You know... ASEM is also reading here ;)

Any feedback is welcome!

Update Version 1.1.1:

  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)

Update Version 1.1.2:

  1. Fixed a bug with Memory Manufactor Code Lookup (DDR3: ManufactorID, Parity-Bit)

Update Version 1.1.3:

  1. Added Patriot, Crucial, A-DATA Memory Manufactor
  2. Support for 945 northbridge and ICH8, ICH7 southbridges
  3. SMBus Device Enable for systems there the controller is disabled (Tip from iNDi)
  4. printout a message if theme fails to load due to a missing file
  5. removed a print in non verbose mode to keep the Booter quiet

Update Version 1.1.4:

  1. You can supply a system-id with system-id=<value> in com.apple.Boot.plist
  2. You can prevent the system-id injection with system-id=No in com.apple.Boot.plist
  3. system-type is now supported. Default is 1 (Desktop). Use system-type=2 in com.apple.Boot.plist if you have laptop. (Link)
  4. Removed the setVideoMode(TEXT) in resume.c to make Hibernation work.
  5. Support for 946GZ/PZ, Q963/Q965a and P965 northbridge memory controllers.

Update Version 1.1.6:

  1. Improved system-type injection. ACPI V2 FACP PM_Profile is patched to match system-type.
  2. Fixed a bug with system-id injection (com.apple.Boot.plist).
  3. Supported memory manufactors: Micron, Samsung, Transcend, Apacer, Kingston, PNY, MDT, Corsair, GeIL, takeMS, Buffalo, Mushkin, OCZ, A-DATA, G.SKILL, TeamElite, Patriot and Crucial.
  4. 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.
  5. Supported SMBus controllers: P55, ICH10, ICH9, ICH8 and ICH7.

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).

Update Version 1.1.7:

  1. Fixed the font swapping bug (small & console font).
  2. Fixed a problem with disabled MCH MMIO on some mainboards (needed to detect dram frequency).

Update Version 1.1.8:

  1. Fixed the font swapping bug (small & console font) for the Booter with an embedded theme.
  2. Fixed an issue with memory detection for some mainboard (2 slot only mainboards).
  3. Added support for PM45 northbridge memory controller.
  4. Added memory manufactor lookup for: Hynix, Nanya, KingMax, Qimonda and SuperTalent.
  5. Added nVidia GT240 device lookup.
  6. You can now hide HFS partitions too using “Hide Partition?? in com.apple.Boot.plist.
  7. Made the verbose output the using nVidia/ATI ROM’s more useful.
  8. Fixed a bug with sprintf (rek).
  9. Merged hibernation fix from Chameleon repo (46).
  10. Made verbosity at early bootstage useable.
  11. Bugfixes.

Update Version 1.1.9:

  1. Added nVidia ION device lookup.
  2. 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 using ASCII-HEX (0-9,a-f).

Sources under http://github.com/aserebln/Chameleon.

Asere

Share this post


Link to post
Share on other sites

Recommended Posts

  • 0

Hello Asere,

I just tried your booter and it works, but something doesn't make sense. Your initial post says:

"Filenames configured in com.apple.Boot.plist (DSDT=..., SMBIOS=...) must be given with the full path. The Booter does not check automatically the Extra Folder. So if you used DSDT=mydsdt.aml and the mydsdt.aml file is in the Extra folder, then you must use now DSDT=/Extra/mydsdt.aml."

However, the operating system is grabbing the memory information from smbios.plist even though I didn't specify it in the Boot.plist.

Here is what System Profiler is listing as my memory:

"Bank0/1/A0:

Size: 2 GB

Type: DDR3

Speed: 1333 MHz

Status: OK

Manufacturer: Corsair steve

Part Number: TR3X661600C9

Serial Number: 000123-01234567-0"

I added the "steve" in the smbios.plist and it shows up in the OS.

Here is the com.apple.boot.plist:

Extra$ cat com.apple.boot.plist

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

<key>GUI</key>

<string>yes</string>

<key>Kernel</key>

<string>mach_kernel</string>

<key>Kernel Flags</key>

<string></string>

<key>UseAtiROM</key>

<string>Yes</string>

<key>PCIRootUID</key>

<string>1</string>

<key>DropSSDT</key>

<string>yes</string>

<key>DSDT</key>

<string>/Extra/DSDT.aml</string>

<key>GraphicsEnabler</key>

<string>Yes</string>

<key>Timeout</key>

<string>20</string>

<key>device-properties</key>

<string>4b00000001000000010000003f0000000100000002010c00d041030a0100000001010600041c0101060000007fff0400160000006200750069006c0074002d0069006e0000000500000001</string>

</dict>

</plist>

Now, I am booting with debugs and I see that it correctly identifies the memory, but I am wondering why the smbios.plist is being used. I'll move it to .bak and see what happens.

Thanks,

Steve

Share this post


Link to post
Share on other sites
  • 0

I removed the smbios.plist and rebooted. Here is what System Profiler has for my memory now.

Bank0/1/A0:

Size: 2 GB

Type: DDR3

Speed: 1332 MHz

Status: OK

Manufacturer: Corsair

Part Number: CM3X2G1333C7

Serial Number: 0x00000000

So the OS does use that values obtained from the booter if there isn't an smbios.plist in /Extra

I did notice that when I removed the smbios.plist, my core i7 machine gets listed as a macpro3,1 instead of 4,1.

Model Name: Mac Pro

Model Identifier: MacPro3,1

Processor Name: Quad-Core Intel Xeon

Processor Speed: 2.67 GHz

Number Of Processors: 1

Total Number Of Cores: 4

L2 Cache (per core): 256 KB

L3 Cache: 8 MB

Memory: 6 GB

Bus Speed: 533 MHz

Boot ROM Version: MP31.006C.B05

SMC Version (system): 1.30f3

Serial Number (system): SOMESRLNMBR

Hardware UUID: F86A26C7-63E1-5A4B-B645-ECFAF252B776

Thanks,

Steve

Share this post


Link to post
Share on other sites
  • 0

The initial post also says :

The memory parameter detecting should work with P35/X38/X48/P45 memory controllers and the builtin memory controllers of the Core i5/i7 CPU's. Reading of memory SPD (Serial Presence Detect EEPROM) data should work on P55, ICH10? and ICH9. You must remove all memory related keys from smbios.plist (SMmemmanufacter_X, SMmempart_X, SMmemserial_X, SMmemspeed & SMmemtype).

You have to remove all info about memory from your smbios.plist to allow the booter to automaticaly read and inject that info. You can leave your smbios.plist in place, but delete the lines about the memory from it.

Also

Filenames configured in com.apple.Boot.plist (DSDT=..., SMBIOS=...) must be given with the full path

That means that if you specify a smbios.plist file in your com.apple.Boot.plist, you have to specify it by full path. If you don't specify nothing about a certain file, the one in the default location ( /Extra ) will be automaticaly loaded (your DSDT.aml or your smbios.plist from /Extra directory will be automaticaly loaded always if you don't specify anything in com.apple.Boot.plist ).

This is the normal and intendeed way of operation of the booter.

Hope it clarifies.

Share this post


Link to post
Share on other sites
  • 0

Thanks for the clarification. I do have another question now. With everything that is being detected by the booter, is there a reason for the smbios.plist? It recognized my memory, sort of recognized the cpu (it calls it a xeon instead of a core i7 which is close enough), it recognized the cpu speed and memory speed. Doesn't the booter recognize everything that the smbios.plist is used for?

Thanks,

Steve

Share this post


Link to post
Share on other sites
  • 0

Hi AsereBLN,

Thank you for your work.

1. On an Intel DX58SO board with Corsair memory, memory detection works (Manufacturer and Part Number are displayed correctly), however serial number displayed is 0x00000000 on all chips. Is this a limitation of this setup or a problem with the booter?

2. Regarding the notes on your blog for installing the booter, if you'd like, you could consider the following changes:

a. I think that instead of forcefully unmounting the device and then remounting it, it is cleaner to use the following single command to get rid of all the unwanted mount flags:

# sudo mount -u -o owners /Volumes/Chameleon

b. On Intel motherboards (and perhaps some others), after finishing the regular install procedure, you must set an active partition on the boot disk, as otherwise it won't boot:

# fdisk -e /dev/rdisk2

Execute the following commands under the fdisk prompt:

# f 1

# w

# q

Regards,

Pene

Share this post


Link to post
Share on other sites
  • 0
Thanks for the clarification. I do have another question now. With everything that is being detected by the booter, is there a reason for the smbios.plist? It recognized my memory, sort of recognized the cpu (it calls it a xeon instead of a core i7 which is close enough), it recognized the cpu speed and memory speed. Doesn't the booter recognize everything that the smbios.plist is used for?

Thanks,

Steve

You still need smbios.plist for a custom model name, identifier, boot rom and seriall number. If you are pleased with a default ones (the one you saw when booting without smbios.plist - macpro3,1 SOMESRLNMBR, etc) than you don't need smbios.plist.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.