Windows 8 EFI on Macbook Pro 5,1 (Late 2008)
While waiting for good Haswell ultrabooks, I decided to play with my Macbook Pro 5,1 (Late 2008) and I want to share my (partially) successful experience with Windows 8 EFI:
- From another mac I backup the OS X Partition and wiped the disk and created pure GPT table and restored the partition but also created two more for the windows installation
- Slipstreamed the expanded nVidia drivers into an .iso and created autounattend.xml in the root and copied the .iso content on FAT32-formatted bootable usb
- Downloaded Tianocore EFI Shell and created startup.nsh (see
https://forums.macrumors.com/showthread.php?p=14075475#post14075475)
- I renamed the Microsoft’s BOOTX64.EFI to MS-BOOTX64.EFI and pointed the efi script to start it
- Windows 8 installs smoothly and also Bootcamp 5 installs using msiexec /i and all the drivers are loaded except one “Coprocessor”. All Bootcamp controls are working except brightness.
- At this point I experienced very much random freezes per day. Internet is full with proposed fixes, but what helped me: I downloaded the latest nForce 980a SLI driver from nvidia site and installed in Win7 compatibility mode. The installer also updates the AHCI controller. I then manually updated the driver of the coprocessor from the folder created by the installer and since then Win8 is running very stable (no single crash) and very fast!
Thank you all for the hints in this thread!
So here the three issues:
- Hibernation: The pc wakes from hibernation with turned off black screen. I must close the laptop to trigger sleep and then wake to have a video output. But if I try to hibernate again, windows 8 simply restarts and says an error has occurred. I am only allowed to hibernate once between the restarts!
I tried to change the startup.nsh before hibernation and sometimes the computer wakes up even with video output. But this behavior is not reproducible. I experienced similar hibernation problems with win7 efi.
- After a sleep the expected battery time is little reduced. (Maybe the 9600gt is waked too).
- Brightness control: is not working. I tried various proposed fixes but none does. V-l-a-d-i-m-i-r, would you share your brightness control with us? I can live without hibernate but without brightness control, the macbook is pain in the... eyes!
EDIT:
Actually someone did a pretty good job on creating an Apple SMC Control at
http://lwn.net/Articles/226624/ and this driver is used by a MacFan for Windows
http://sourceforge.net/projects/macfan/ It gives access to fans, light sensor, keyboard and display brightness controls and says it doesn't need installed bootcamp drivers, so, theoretically, with a little programming one can even create an adaptable brightness on an efi windows.
EDIT2:
Newer Version here:
http://stuff.mit.edu/afs/sipb.mit.edu/contrib/linux/drivers/hwmon/applesmc.c
EDIT3:
sleep battery issue fixed: reduced baterry expected time after wake can be fixed by sending 2 to port 0x750 (subscribe to WM_POWERBROADCAST or send it every 50s)
hibernate issue: I suspect the tianocore shell for initializing some pci values. OS X won't start after I exit the shell. If a self created efi sets the needed pci bits and starts the win bootloader, it may start working.
brightness issue: I tried different things such as sending bytes to ports 0x10724/0x774 or 0x52e/0x52f, which actually works under bootcamped win7, but without success. I can communicate with the SMC: read light sensors and change the keyboard led state. But I tried different SMC keys for the brightness and none is working.
EDIT4:
brightness issue fixed: no smc programming needed: the brightness value for stone age nvidia adapters must be send to the gmux port differently:
short GMUX_PORT_BRIGHTNESS = 0x774;
OutPort(GMUX_PORT_BRIGHTNESS, brightness);
OutPort(GMUX_PORT_BRIGHTNESS + 1, brightness >> 8);
OutPort(GMUX_PORT_BRIGHTNESS + 2, brightness >> 16);
OutPort(GMUX_PORT_BRIGHTNESS + 3, 0);
Newer nvidia drivers use only the newer option.
Next is to map the brightness keys to trigger the changes and I am done.
Code still needs cleanup. But if someone is interested pm me with mail adress and I will send the code.
EDIT5:
hibernate issue: The problem is sending the 2 to port 0x750: the gmux powers down the 9600m gt and it is not visible to windows anymore. After a restore from hibernation the device is powered up again and windows thinks a new device is installed and throws error. If I make the both graphic cards bus masters, they are visible in the device manager and I can even set the Physics to the 9600m gt, but I can't get video output from it. In this case hibernation always works (as long as 0x750 stays untouched) but the notebook starts with black screen and I only hear the starting sound. It is impossible(?) to prevent PCI devices from discovering by the OS. I think a virtual windows or efi driver must be created to power down the 9600m and its bus on each start / wake. Than maybe everything would be ok. Switching the adapters could even be possible if one understands which ports are triggered under osx.