I have a Early-2011 15" MacBook Pro with no Superdrive (the previos owner replaced it with a caddy) and i have been trying to install Windows 7 via USB with no success (no bootable media error).
Any suggestions?
So I got it to work, see http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html for details. Hopefully it will be in the git version of grub in a few days, until then you'll have to apply the patch from that email.
This adds a new command to grub, apple_set_os, which fakes being OS X, and configures all hardware as if it were booting OS X, including the Intel GPU.
To boot with the Intel GPU enabled, build grub with the patch from the mail above, choose grub from refind, and execute the apple_set_os command. You can do this either by including it in your grub.cfg, or simply in the command line (you can access it with "c", and exit it with Esc). You can even exit grub after executing apple_set_os, so you can also use it to boot Windows with the IGPU enabled.
It works perfectly fine in Linux. But in Windows most of the screen turns black soon after the boot, with only the mouse cursor and a blinking Wifi icon visible, no matter wether I boot with the Nvidia GPU or the Intel GPU (via the GfxCardStatus trick).
So you didn't get it working with Windows? I'll look at your patch but I wish you could boot using the kernel boot stub instead of having to use grub.
Well, in Windows the IGPU is enabled and for a very short while displays the login screen, but then the screen goes mostly black. I guess this is some sideeffect from enabling the IGPU, since the same thing happens both with the Nvidia or Intel GPU active. The Bootcamp EFI driver changes more than just the GPU, it also messes with SpeedStep and more, and I suppose one of the other changes confuses Windows.
Also it'd be easy to port the grub command to a standalone Efi application, I just used grub because it had the nicest Efi implementation. Gnu-efi applications always hang for me, and Edk2 is a bit bloated.
I didn't have this problem using my method. I did use SP1. Are you installing RTM?
So I got it to work, see http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html for details. Hopefully it will be in the git version of grub in a few days, until then you'll have to apply the patch from that email.
This adds a new command to grub, apple_set_os, which fakes being OS X, and configures all hardware as if it were booting OS X, including the Intel GPU.
To boot with the Intel GPU enabled, build grub with the patch from the mail above, choose grub from refind, and execute the apple_set_os command. You can do this either by including it in your grub.cfg, or simply in the command line (you can access it with "c", and exit it with Esc). You can even exit grub after executing apple_set_os, so you can also use it to boot Windows with the IGPU enabled.
It works perfectly fine in Linux. But in Windows most of the screen turns black soon after the boot, with only the mouse cursor and a blinking Wifi icon visible, no matter wether I boot with the Nvidia GPU or the Intel GPU (via the GfxCardStatus trick).
echo IGD > /sys/kernel/debug/vgaswitcheroo/switch
vga_switcheroo: client 0 refused switch
I patched the GRUB with apple_set_os extension you wrote and now I can also see both Intel Iris Pro and NVIDIA GT750M GPUs in Windows Device Manager.
Unfortunately, black screen problem is also there.
However, despite the apparent lack of black-screen issues in Linux, I do not think that it is possible to power-off the NVIDIA GPU using the old gmux register values. If I attempt to do it through vgaswitcheroo interface, I get the following error:
Also, any attempts to power-down dGPU manually in UEFI shell do not seem to work, Windows keeps seeing the dGPU so I suppose Apple changed the gmux this time and the register values / ranges can be different.
// new version of outb(2, 0x728) - switch ddc
outb(2, 0x7c2) // write the value to the value register
sleep 100ms // instead of gmux_index_wait_ready, just to be on the safe side
outb(0x28, 0x7d4) // write the port to GMUX_PORT_WRITE
sleep 100ms // instead of gmux_index_wait_complete
// new version of outb(3, 0x710) - switch internal display
outb(3, 0x7c2) // write the value to the value register
sleep 100ms // instead of gmux_index_wait_ready, just to be on the safe side
outb(0x10, 0x7d4) // write the port to GMUX_PORT_WRITE
sleep 100ms // instead of gmux_index_wait_complete
// new version of outb(3, 0x740) - switch external display
outb(3, 0x7c2) // write the value to the value register
sleep 100ms // instead of gmux_index_wait_ready, just to be on the safe side
outb(0x40, 0x7d4) // write the port to GMUX_PORT_WRITE
sleep 100ms // instead of gmux_index_wait_complete
Have funI suppose disassembling AppleMuxControl module should reveal what changes they did this time...
as this was the reason for blank screens in MBAs while EFI booting. Bootcamp intel driver should work rather than the windows.A fix for this is to remove the igdkm64.sys from C:\Windows\System32\Drivers. To do this, hold CMD+ALT/Option+V+Shift after you press the power button. If it worked, you should see your Windows boot screen with the text Please Wait below it. If it didnt do this, do a hard shutdown (hold your power button for 10~ seconds), and try again. It might take you a few tries to get to the right menu.
Like in parts 1 and 3a, youll need to find your way to the Command Prompt. Once youre there, enter the following commands:
C:
cd C:\Windows\System32\Drivers
move C:\Windows\System32\Drivers\igdkm64.sys C:\
exit
Now, when you reboot, it should boot right into Windows 7/8/8.1
WinGmuxCtrl.exe switch igd
gmux version: 4.0 (release: 8), indexed: 0
Switching GPU to IGD...
Writing to port: 0x7c2, value: 0x1
Reading port: 0xd4, value: 0xff
Writing to port: 0x7d4, value: 0x28
Reading port: 0xd4, value: 0xff
Writing to port: 0x7c2, value: 0x2
Reading port: 0xd4, value: 0xff
Writing to port: 0x7d4, value: 0x10
Reading port: 0xd4, value: 0xff
Writing to port: 0x7c2, value: 0x2
Reading port: 0xd4, value: 0xff
Writing to port: 0x7d4, value: 0x40
Reading port: 0xd4, value: 0xff
Powering down dGPU...
Writing to port: 0x7c2, value: 0x1
Reading port: 0xd4, value: 0xff
Writing to port: 0x7d4, value: 0x50
Reading port: 0xd4, value: 0xff
Writing to port: 0x7c2, value: 0x0
Reading port: 0xd4, value: 0xff
Writing to port: 0x7d4, value: 0x50
Reading port: 0xd4, value: 0xff
WinGmuxCtrl: Discrete card is powered OFF
apple_set_os
outb 0x7C2 1
outb 0x7D4 0x28
outb 0x7C2 2
outb 0x7D4 0x10
outb 0x7C2 2
outb 0x7D4 0x40
outb 0x7C2 1
outb 0x7D4 0x50
outb 0x7C2 0
outb 0x7D4 0x50
and the black screen problem was gone.menuentry 'Windows 8.1' --class windows --class os $menuentry_id_option 'osprober-chain-67E3-17ED' {
insmod part_gpt
insmod fat
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 67E3-17ED
else
search --no-floppy --fs-uuid --set=root 67E3-17ED
fi
apple_set_os
outb 0x7C2 1
outb 0x7D4 0x28
sleep 1
outb 0x7C2 2
outb 0x7D4 0x10
sleep 1
outb 0x7C2 2
outb 0x7D4 0x40
sleep 1
outb 0x7C2 1
outb 0x7D4 0x50
sleep 1
outb 0x7C2 0
outb 0x7D4 0x50
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
@Andreas,
Quick question:
- Did you perform any EFI update to your Mac?
- Do you boot to GRUB directly or through refind?
The reason I am asking is - I cannot power down dGPU while in the bootloader at all. If I attempt to do this, laptop will freeze.
However, I can do this in Windows later. But this creates an undesirable side-effect of NVIDIA driver being loaded, and then it prevents resuming from sleep... of course I can fix that by some other means (either powering off the dGPU early in the Windows boot process by writing a .sys driver that would load as boot-bus-extended, meaning immediately after ntoskrnl, or by manual eviction of the driver while loading)
apple_set_os
outb 0x7C2 1
outb 0x7D4 0x28
sleep 1
outb 0x7C2 2
outb 0x7D4 0x10
sleep 1
outb 0x7C2 2
outb 0x7D4 0x40
sleep 1