With some kernel debugging, I was able to figure out why my sandy bridge system would always immediately reboot when trying to install OSX 10.7. Adding to the confusion, some bootloaders (xpc, #####
) would tend to hang/or black screen before even starting a kernel. Now that chameleon rc5 supports 10.7, I was able to merge the valv branch sandy bridge changes into the mainline code, and finally get beyond the bootloader issues.
The problem turned out to be that the OSX kernel's tsc_init() routine is failing to work properly for my sandy bridge system. tsc_init() has logic to use MSR_FLEX_RATIO, and for my system, that logic fails and leads to cpu_mhz = tscGranularity = flex_ratio = 0.
A small (1 byte!) patch to skip the MSR_FLEX_RATIO usage fixes this and the system then works just fine.
Strange that I seem to be the only one that has reported having this issue; is it a BIOS bug that MSR_FLEX_RATIO returns bit 16 set, but bits 8 thru 15 clear? Ie:
% rdmsr -0 0x194
In intel's processor manual MSR section, I don't see MSR_FLEX_RATIO described, certainly not under the sandy bridge MSR subsection, yet the OSX kernel is using it for sandy bridge, westmere, nehalem...