Arkiv

Arkiv för april, 2011

Stable Hackintosh with H67 chipset

I have pulled my hair the last week trying to install MacOS X on my latest supposed-to-be-a-Hackintosh Mini-ITX Sandy Bridge build. I have been running OSX on home built computers for several years so I’m fairly experienced with it. It can be a pain to install and configure but when it finally works it works as good as a real Macintosh.

The chipsets supporting Sandy Bridge are currently H67 and P67. The P67 chipset allow massive overclocking and fine grained tweaking while the H67 only supports limited tweaking. One of the things that H67 (usually) doesn’t support is changing the default FSB multiplier. Sandy Bridge has a quite unique design with a Front Side Bus speed of only 100 MHz but lots multipliers. For a 3.4 GHz Sandy Bridge CPU the multiplier is a whopping 34!

As my main priority this time was to build a physically small and reasonably silent, but still as powerful as possible, computer, I really (really!) wanted a Mini-ITX motherboard but all Sandy Bridge Mini-ITX motherboards available use the H67 chipset.

In OSX, many things relies on the RTC (Real Time Clock), especially IO drivers. If the kernel doesn’t detect the exact values, things will be very unstable. It will probably work but with lots of small freezes, jerky mouse movement and things will be very crash prone.

The standard MacOS X kernel has many checks to make it not run on some hardware that Apple has decided that would compete with their own hardware too much, like AMD and Atom CPUs. They also limit Sandy Bridge CPUs faster than those in the new MacBook Pros.  Sometimes there are ways to fool OSX that those component of yours are actually something else (but since they are compatible they will work anyway) by supplying a modified DSDT which is a very complex file describing how the Operating System should interact with hardware. Usually the motherboard gives the OS its DSDT via ACPI but with a special bootloader you can supply your own modified one instead.

Maybe it’s possible to make OSX accept fast Sandy Bridge CPU:s via DSDT hacks. The fact that many persons with Asus P67 motherboards are able to run the standard kernel even with a high multipliers suggests that. However, DSDT/ACPI is a very complex standard and learning it is like learning assembly programming for a completely new architecture. The specification is over 700 pages… Not something I want to spend time on at the moment.

An easier way is to use a custom kernel. Nawcom has since long supplied patches for XNU that removes these kinds of checks and much more. His kernels are usually used to run OSX on AMD and Atom CPUs. Incidentally, they also run Sandy Bridge CPUs just fine, without any DSDT hacks.

Almost. To make Nawcom’s kernels support half multipliers he made a hack saying that if the bus ratio (aka multiplier) is 30 or more, divide it by 10, unless (for some reason, probably to avoid a division by zero later on) it’s dividable by 10. To support a multiplier of 3.5 you would thus supply busratio=35 on the kernel commandline but busratio=350 won’t work for a multiplier of 35 because it’s dividable by 10. The problem is that these new Sandy Bridge CPUs actually use multipliers this high! I guess Nawcom didn’t expect that would happen when he wrote this hack.

I have tried to catch Nawcom on IRC and various forums but he’s hard to catch so instead I decided to get my hands dirty and fix the problem myself. It’s a very simple fix. Change the threshold from 30 to 60 so busratio=34 actually means 34, nothing else. It means that the lowest half multiplier supported is 6.5 so if you want to get OSX running on a 10 year old AMD PC, use the Nawcom’s standard kernel instead.

Attached is my modification of Nawcom’s kernel for Sandy Bridge CPUs. It only supports 64-bit mode. To use it you have to supply both busratio=n and fsb=100000000 (100 million) on the kernel commandline, where n is your CPU’s speed divided by 10. For my i7-2600 (3,4 GHz) the commandline is ”arch=x86_64 busratio=34 fsb=100000000″. Don’t use ”-force64″.

To make it permanent, set it as Kernel Flags in /Extra/com.apple.boot.plist

Download the kernel here: mach_kernel.bz2

To make sure that an update doesn’t overwrite it, name it something other than ”mach_kernel”, save it in the root and set that name as Kernel in com.apple.boot.plist.

For those who are interested, my final build is a Zotec H67ITX-C-E motherboard, Core i7-2600 CPU, Lian Li Q08B chassis, Sapphire HD6850 graphics card, 8 GB 1333 MHz DDR3 RAM, 240 GB OCZ Vertex 3 SSD, Asus BW-12B1LT Bluray writer.

Kategorier:English, Teknik Etiketter:, , , , ,
Följ

Få meddelanden om nya inlägg via e-post.