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
@downlord & @Danica Talos.

I have 2 Systems: a MSI-P55M-GD45 + i7 860 and my old GA-EP45-DS3 + Q9550. The i7 runs 10.6.2 and the other system 10.6.x + 10.5.8. All three installations (i7 & 10.6.2 @ 32&64Bit, Q9550 & 10.5.8 & 10.6.2) are booting and running fine without any issues.

Right now I've testet the Q9550 + 10.5.8 a lot. I did some restarts, shutdowns, sleep/wakeups. It always boots up fine. I've made a filesystem check under OS X. Filesystem is OK, so I have no corrupted files. At least for me it does work as expected. My 10.5.8 installation is nothing special. I started with this HD on a Mac mini with 10.5.0, switched to Efix and then to Chameleon. Always made all OS updates as they came available.

Keep in mind that BIOS settings, the Booter, the com.apple.Boot.plist, the smbios.plist, the extra kernel extensions and last but not least the DSDT itself... all these stuff plays together to give you stable and running system. Without knowing about all these components, it's hard to say something reliable.

You can see my BIOS settings in my blog. It use my Booter v1.1.8. The only extra kernel extensions I'm using are: fakesmc.kext/IONetworking.kext and fakesmc.kect/LegacyHDA.kext. Find the content of my Booter USB-stick below.

Asere - 1.1.8 works great for me.

Would you share the contents of your booter USB-stick for your MSI?

Share this post


Link to post
Share on other sites
  • 0
Hi,

this is strange! I can boot 10.6.2 in 32Bit and 64Bit without problems. What does KP? Can you try to boot in verbose mode (and use Wait=Yes) to see what Chameleon says.

I was actually getting this same exact error! The reason was that I had another Chameleon USB stick plugged in and it was affecting the order of the drives. It thought it was trying to boot my OSX drive but in reality it wasn't, so it couldn't find the kernel (because it was booting from another drive). As soon as I took out the second Chameleon stick, it started working fine. I know it was booting from the right stick because I purposely put different themes on them.

Share this post


Link to post
Share on other sites
  • 0
Hi Asere,

Thanks for adding PM45 chipset support in 1.1.8. Now both memory modules are recognised correctly but i get 798 MHz memory speed in SysProf and ATM. It's not a big problem, have overrided it in smbios.plist with SMmemspeed=800.

The speed is correct. It always varies a little bit due to the TSC-frequency-measuring algorithm. There is no way to read the FSB speed directly, so the Booter measures the TSC-freq using a RTC Timer. But the RTC Timer is not that exact! Knowing the TSC-freq you can calculate all the other freqs in the system, like CPU, FSB, Memory...

UUID in SysProf is different to that from CPU-Z dump:

CPU-Z: 60E35E41-D21DB211-8000E1B4-19D75C8B

SysProf: FB73BBB8-180D-5633-BBCA-944795AA2A83

Is it correct?

I guess that this is normal. No idea how Windows determines the Platform UUID. OS X uses a SHA hashed system-id.

I can't get info about battery/adapter while system-type=2 in boot.plist.

I've no idea how to fix it in dsdt. Now i use VoodooBattery (Superhai).

No idea, why. I've tried the system-type=2 and I got the battery stuff in Preferences/Energy Saver.

After wake my laptop up sound cracked at first use, next backed to normal. I don't know what caused it. IMO smbus caused it because adding IOSE under SBUS dvice helped (see my dsdt). May be i'm wrong?

I dont't know why LCD brights up after wake. Backligth doesn't work.

To wake my lap i had to press power button 5-6 times until i've added _PRW method to H_EC device (see my dsdt) but get in console: Wake reason H_EC LID0 EHC1 EHC2. Tried many fixes to get wake by mouse/keyboard (USB 2.0) working but no succes.

Sorry for many questions, may be someone knows a fix for that issues.

Thanks for any help.

I guess this issues could be resolved with some DSDT finetuning.

Share this post


Link to post
Share on other sites
  • 0
Excellent work AsereBLN!

I see you have an i7 machine, will there be a solution to auto detect Processor Interconnect Speed?

Currently it needs something like the following in smbios.plist;

<key>SMbusspeed</key>

<string>7200</string>

When using ECC memory, would it be possible to auto detect ECC Enabled, and memory type as DDR3 ECC?

I use the following workaround for this cosmetic misreporting in /System/Library/SystemProfiler/SPMemoryReporter.spreporter/Contents/Resources/English.lproj/Localizable.strings;

"dimm_type" = "Type";"DDR3"="DDR3 ECC";

"ecc_disabled" = "Disabled";"Disabled"="Enabled";

Processor Interconnect Speed refers to the QPI Link. Only the Nehalem i7 have an QPI. The Lynnfield i7 and i5 don't have a QPI Link. The northbridge/memory controller/pci-e... are on-chip and the P55 PCH is connect through a "normal" DMI Link (northbridge<->southbridge).

Lets see if I can figure out the relevant info to setup SMbusspeed automatically.

Of course it's possible to detect ECC RAM. Do you know how to tell OS X about the ECC RAM? SMBIOS...???

Share this post


Link to post
Share on other sites
  • 0
Hi AsereBLN,

Thanks for the v1.1.7 bootloader.

Memory, etc is detected properly.

Have only fakesmc.kext left in Extra/Extensions on the EFI partition. :)

Restart is working, but shutdown hangs my box though. I realise that this is not because of the bootloader.

Finally got my HD 3870 working with Snow Leopard. But because I found out the hard way that the ATI drivers are like a fly in the ointment, I'll probably still go for the Zotac GTX 260 you mentioned. Or maybe a GTS 250 because I'm not a gamer, just need a super snappy desktop.

Will try v1.1.8 soon.

Anyway, thanks again for the improved boot loader.

Robert

You are right, shutdown is not a Booter issue. You can fix it in the DSDT by adding the green code:

    Scope (\)
{
Name (PICF, Zero)
Method (_PIC, 1, NotSerialized)
{
Store (Arg0, PICF)
}
}

[COLOR="Green"] OperationRegion (PMRS, SystemIO, 0x0430, One)
Field (PMRS, ByteAcc, NoLock, Preserve)
{
, 4,
SLPE, 1
}
[/COLOR]
Method (_PTS, 1, NotSerialized)
{
Or (Arg0, 0xF0, Local0)
Store (Local0, DBG1)
OSTP ()
If (LEqual (Arg0, One)) {}
If (LEqual (Arg0, 0x03)) {}
If (LEqual (Arg0, 0x05))
{
Store (ESMI, Local0)
And (Local0, 0xFB, Local0)
Store (Local0, ESMI)
Store (0x99, SMIP)
[COLOR="Green"]Store (Zero, SLPE)
Sleep (0x10)[/COLOR]
}

If (LEqual (Arg0, 0x04))
{
If (LNot (PICF))
{
Sleep (0x64)
}
}
}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

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.