Win7 x64 booting natively via EFI (no BIOS emulation)

Discussion in 'Windows, Linux & Others on the Mac' started by VirtualRain, May 4, 2009.

  1. davidcie macrumors member


    Dec 25, 2008
    @Pockets69, this is a bit of a strange one TBH, everyone here who was able to find the right registers and slipstream drivers was able to get a working W7, W8+ machine. Perhaps in your case the culprit is the drivers that have some strange problem on this particular setup? Speaking from experience, even thou I have an ATI card in my desktop (iMac 27" Mid-2010) for a couple of years ATI drivers exhibited a strange no backlight problem which was corrected only recently. Perhaps — if you have a working "install Windows in 5 minutes" pendrive you could try slipstreaming different drivers to see if that changes anything.

    Back to MBR?
    As for my endavours, I attempted a different strategy. I hoped that even though Apple removed MBR bootloaders from their boot manager, the actual legacy loader was still in place only waiting to be discovered (which is definitely possible with rEFInd if it's given the right memory address). That way I could at least boot in legacy mode, which would be fine by me. So I:
    1. Dumped my iMac firmware.
    2. Compiled a debug build of rEFInd which would tell me which EFI loader it uses for legacy MBR bootloaders.
    3. Extracted all files from my iMac firmware.
    4. Found the legacy loader EFI application.
    Did all the above to know what to look for in the Air firmware. Unfortunately, none of Air's EFI applications look anywhere near the legacy loader from the iMac. Thanks to text strings inside, I was able to guesstimate their functions; while there is a boot manager, firmware flasher, network recovery and its companion apps (downloader), no traces of a legacy MBR loader :(

    Back to EFI...
    So it seems for MacBookAir7,2 (Early 2015) it really is either find a way to run Windows in EFI mode or nothing. Will try to remove vga.sys next to see what happens... if that fails perhaps I could nop it all to stop Windows 7 messing my memory..?
  2. Pockets69, Feb 4, 2016
    Last edited: Feb 5, 2016

    Pockets69 macrumors newbie

    Jan 7, 2016
    Hey @davidcie

    As far as i could read not everyone got it to boot even though the right registers were found, and i don't know if you noticed by reading the thread, but there were very little people with the nvidia geforce 320m on the thread, but if i am not mistaken two tried without any success, but i don't think they were even able to find the registers, they vanished from this thread without a trace...
    I am starting to suspect there is a problem with the drivers, the drivers i injected with dism and have been trying to install on other versions of windows are the bootcamp drivers, although on windows 8 and 10 i tried the latest nvidia drivers, still not working.

    I have two plans at least to attack this situation, I don't know if any of them is useful to you though.

    1 - using the most recent nvidia drivers (since i was using bootcamp drivers with windows 7) and slipstream them into my iso with dism, try the same unattended install and see if boots with the registers set.

    2 - There is a very useful thread on on how to boot windows from gpt using a hack on bootmgr, basically you install windows 7 through an efi install to the disk, but you use an external mbr formatted pen drive to boot the gpt install.
    I know this may destroy the UEFI goal we have here, but its an alternate solution (most likely for our blackscreen).
    (here is the tutorial not on, but by the original autor:

    now i don't know since your last findings if 2 is even possible for you, but if somehow refind is able to boot mbr from an USB DISK not the hdd, then the 2nd option could potentially work.

    I will also try to do an install without vga.sys and see what i can find.

    This will all take a few days since the hdd ribbon on my macbook is broken, i already ordered a new one, the last tests I did (mainly the 2nd one i described above) was accomplished on a normal computer, i hope to be able to use refind to boot the pen drive, but ill have to wait until the hdd ribbon gets home in a few days, my progress is halted for now.

    Also what do you mean, "nop it all to stop windows 7 messing my memory?"
  3. davidcie macrumors member


    Dec 25, 2008
    Wasn't really paying much attention to the 320M since I have an Intel-only setup here :( Once you get your ribbon I think you have two main options:

    No hang with VGA drivers
    Slipstreaming drivers seems to be the most reasonable thing to do if your setup does not hang on boot like mine and even with nothing on the screen you are able to RDP into it! That way you're lucky enough to be able to easily experiment with various drivers w/o having to reinstall Windows every time.

    Hang with VGA drivers
    If, however, you're as unlucky as I am in that the machine hangs with stock VGA drivers... well, life is a lot more complicated :) As far as I can tell setup stage 1 always uses VGA even with the correct drivers slipstreamed, and stage 2 also begins with VGA until it gets to the hardware detection stage. As I'm writing these words I have an image VGA drivers removed (RT7 Lite) installing but not giving it much chance of booting. These are the solutions I can see:
    1. Install Windows on a virtual machine, force change video card drivers to the correct card. Then force close the VM and image this on the laptop.
    2. Rename the proper .sys driver to vga.sys and vgapnp.sys to trick Windows into using the right driver even when it wants to use vga.sys.
    3. nop them all! By that I mean neutering / defusing vga.sys & possibly videoprt.sys by replacing all assembly instructions inside with nop (no operation). This way perhaps Windows will play along thinking it is doing all the right things graphically while in reality nothing will be happening and no harm done to memory. At some point Windows will automatically install the slipstreamed correct video drivers.
    Have already spent about a week on this so not about to give up until I explore all three options :)
  4. Pockets69 macrumors newbie

    Jan 7, 2016
    Ok further developments on my side as well, since my macbook is toasted for the time being, i am playing with my laptop, which has uefi firmware...
    When I said I was able to boot gpt windows 7 through an mbr pen drive, I am now able to do so without needing a pen drive, I do it by using a .vhd that hold the boot files, and then using grub to start that VHD, i have all the perks of efi booting:
    - 2 TB+ harddrive support
    - ahci support
    - i don't have the fast booting part since this is not really an efi boot, but right now it is the best i can come up with.
    But there are other perks included for us macbook users.
    - Windows 7 will most likely work like this!
    - Windows 7 will have graphics acceleration like this!
    - and finally there will be no need to create an hybrid partition on mac to hold windows anymore.

    This is as far as my testing went without having a macbook.

    As for the bootup process, well yeah my macbook doesn't hang with vga driver, so the suggestion of booting without slipstreamed drivers, let it complete the setup and then rdp into it to test drivers may be an idea, the problem is i have seen people trying the same route with rdp and as soon as they installed the drivers the machine would lock, and rdp wouldn't be able to connect anymore, i will still try that though, maybe i get lucky.

    as far as your situation goes.
    Yeah, the setup uses vga for stage 1, and vga for stage 2 until it tries to install the video drivers near the end of stage 2.
    You are saying you are not having much luck, but I remember cdob saying the following on the thread you created:

    I think you need to have this into account before removing vga.sys or vgapnp.sys.

    your 2nd option may work though, renaming drivers may work, lets hope they do not check checksums or something before or during the installs, if not, that may be a solution for you hopefully.

    3rd option may work as well, but i have no idea on how to do that, you seem to be more knowledgeable than me so you maybe able to pull it out, asm is really not my strong suit...

    Best of luck mate
  5. davidcie macrumors member


    Dec 25, 2008
    Well, to update you on my progress: replacing vga.sys and vgapnp.sys with renamed Intel drivers didn't work.

    So I set on compiling a very simple dummy vga.sys driver + miniport (a bit like xf86-dummy). However, in the process on doing that I stumbled upon another annoying piece, bootvid.dll. This is a simple vga.sys-like driver that supports printing basic characters and graphics on screen during the boot process (including the moving Windows dots).

    As it also seems to use legacy VGA routines, it seems I might need to replace that first before working on vga.sys... Boy is this becoming nasty, quick!
  6. Pockets69 macrumors newbie

    Jan 7, 2016
    Crap, it's like when you try to defeat something, some other thing pops right up to complicate your life... I am going to receive the HDD flex cable tomorrow and hope i can proceed to test a few things as well, will update this post, or the thread tomorrow with my findings.

    Best luck to you, I am actually under the impression we should setup an IRC channel for better discussion, if you agree i can setup one, take care.
  7. davidcie macrumors member


    Dec 25, 2008
    Thanks! I think it might be better to stick to the forum thou, just in case someone decides to follow in your/my footsteps a few months from now. IRC is great for communication but not so great for archival purposes :)

    Hope all goes well with the cable and at least hardware is not going to stand in your way from tomorrow on.
  8. Pockets69, Feb 11, 2016
    Last edited: Feb 11, 2016

    Pockets69 macrumors newbie

    Jan 7, 2016
    Ok a full day of testing happened.

    The results are however not good.

    Since we last talked i mentioned the attempt i was working on (on my normal laptop) of booting windows on gpt using the bootmgr that is suposed to boot only on mbr, well that worked, i was able to install windows on gpt disk through efi, but i booted it through a pen drive formatted as fat 32 mbr, and i successfully booted windows 7 with gpt support IT was even seen as EFI boot... I set to reproduce the same on the macbook but unfortunately i wasn't successful.

    I firstly installed windows on my normal laptop, let it boot to desktop once and moved the hard drive to the macbook, tried the method of booting through the pen drive, i had an image with windows 7 logo (YAY) then bluescreen (****), i started wondering maybe it was because i let it boot on the normal pc and it is configured for that, so i re-installed windows again on the normal pc but after the first reboot moved the disk to macbook, and booted with the same method, same windows 7 logo image, then setup is updating registry, and the install proceeds, i thought! ****ING NAILED IT! however before going to the second reboot, it gave an error with bcd storage (****), then it rebooted and came to the same screen, so i decided **** it, will try to do everything on the macbook, installed windows 7 first part through the windowsPE boot environment, then it rebooted second part was blind, and it rebooted as well, time for the big test, used the pen drive again to boot from the hard drive, windows 7 logo, and BLUE SCREEN (SHIIIIIIIIIIIIIIIIIIIIT)...

    Honestly, I don't know what else to do, I can try to do the same on windows 8.1 to see if the same behavior occurs but right now i am out of ideas.

    This is the tutorial i used ( it works fine on normal pcs to boot through the pen drive, unfortunately it didn't solve our problem on the macbook.

    and the worst part i couldn't see the blue screen error, the bastard blue screens and reboots immediately!!


    Well did a quick test with windows 8.1 (it being installed completely on the Mac) it doesn't work either, saying it can't find winload.exe (which proves that it is actually trying to boot through legacy) yet if i try the same on the regular laptop it works fine.

    the error is 0xc0000000e well it says it can't find winload.exe, but winload.exe is present on /windows/system32/winload.exe so i have no idea what the hell am i supposed to do now :(
  9. davidcie macrumors member


    Dec 25, 2008
    @Pockets69 the fact that you are having trouble with Win8.1 seems very strange to me. It installs just fine on my weird Air and runs no problem. Why did you install it in MBR mode rather than EFI?

    Regarding moving Windows from one computer to another: make sure it is prepared to see a different SATA controller once it boots. To that end, google and run MergeIDE just before you turn it off for the last time on the "donor" PC.

    If you see BCD errors it might be worthwile rebuilding the BCD to see if that makes a difference. (BCD might enumerate controller ports and devices slightly differently on the Mac and this will throw it off.) Boot off your Win8.1 pendrive, Shift+F10 to get to console and run bootrec /rebuildbcd.

    On my end there is some virtual progress, mostly thanks to ReactOS and its sources being very similar to actual Windows. I've set up a virtual machine for easier debugging the boot process with WinDbg and came across three problem points: in boot order this would be winload.efi, bootvid.dll and vga.sys. Bootvid I think I've dealt with with a BCD switch to prevent one function from being called and some asm patching to prevent another from doing any harm (hopefully). Am now preparing some dummy vga drivers that do not try to mess with int10h (or anything else!), and once that works we'll be left with investigating what needs to be done to winload. Hope to have some info by the end of the weekend.
  10. Pockets69, Feb 12, 2016
    Last edited: Feb 15, 2016

    Pockets69 macrumors newbie

    Jan 7, 2016
    No no installed in EFI mode, but booted in legacy mode just like windows 7, this works for regular computers and the machine actually thinks it booted in EFI but doesn't have the graphical problems, like in windows 7 using this method i was able to see the whole 2nd part of the install (which would be blind otherwise) and was able to see the windows logo after it for the first boot then BSOD.

    What makes this work is the fact that the bootloader instead of being installed in the PBR or that instead of using the EFI bootloader to boot windows, you use a pen drive with the bootloader on it formatted as mbr, it boots pbr -> mbr -> bootmgr on the pen drive, and then loads the winload.exe on windows 7 partition, then it boots, on a normal computer that is, it sees everything as EFI boot (gpt partition no hybrid ********, 2tb hdd all the goodies) but you actually have an image and no black screen on boot because it is booted as legacy, this would solve my problem, I don't know if it would work with you but maybe it would since refind has the ability to legacy boot.

    Now this all works somehow on windows 7 and windows 8 (and i am sure windows 10) when it comes to a normal pc, on the macbook it does't, windows 7 it starts booting you can see windows 7 logo and then bsod, on windows 8 you get a missing winload.exe

    it is a non issue right now, i was able to do the install completely on the macbook, i still got bsod.

    I can try that thanks for the tip, but i think the bcd error was because, i started the install by booting the efi bootloader on a regular laptop, switched the hdd to the macbook, but started the install through my pen drive bootmgr (that i described above), it kinda confused the computer, first boot was on the efi bootloader second one was from bootmgr on an external pen drive, it didn't know where to store the bcd i guess, either way i am going to give your tip a try maybe it works, but in the end i am guessing i am going to be presented with the bsod when it is time to boot.

    As for your progress, DAMN SON! there is some serious reversing going on your side, i wouldn't be able to pull that off, if anything is to come out of this thread is probably from your side, I am going to test your rebuildbcd tip and see if that works, I will none the less record a video of what i can do with the method i have been trying, so you get a better idea of what i am trying to accomplish.

    best regards :)

    EDIT 1
    In the beginning of the thread you mention that you have no problem with windows 8.1 yeah that's normal, its a recent macbook air, my macbook is from 2010, it has an nforce chipset and nvidia 320m this is problematic i believe, whenever i try to install the nvidia gpu drivers i get a blackscreen on windows 8.1 if i efi boot, just like if i was booting windows 7, if i had a more recent macbook this wouldn't be a problem, I am thinking of getting a 2013 retina later this year, and i am sure my windows woes will be gone at least windows 8.1 and 10, as for windows 7 it is still a problem, unless we do something about it.

    EDIT 2
    Did an install again of windows 7, getting the error on the 2nd part of the install as i told you above, to be more specific i opened a terminal with shift f10 and cd to c:/windows/panther/setupact.log and surely at the end of the setup, there was an error: failed to modify boot entries gle = 2

    so right now I know the error i have, I tried to use the bootrec /rebuildbcd but it says it can't find bootrec.exe on windows pe and on windows 7 dvd.

    as for searching for the error on google, it has been hard to come across the same exact error, this is not good :s

    EDIT 3


    Sorry the pics are upside down, i have camera problems...
    no bootcamp drivers installed, its first boot.
    I am afraid of turning the pc down.

    You can see the disk is seen as GPT :) with all the partitions behind the window :D

    EDIT 4

    Installed all the bootcamp drivers and it works no black screen after reboot, it boots correctly and detects my nvidia gpu :) this is great.

    EDIT 5

    Success with windows 8.1 as well, i now have gpu acceleration as well, i imagine that the same works on windows 10 :)

    EDIT 6
    Sleep and Hibernation is workng fine using this method :) i am trying now to devise a way to modify it so we won't need a pen drive to launch bootmgr.
    More to come soon!

    BTW how are things going on your side of the barricade?

    EDIT 7:
    I was trying to find a more elegant solution that didn't involve having bootmgr on a pen drive,it turns out that there is one, but doesn't work on the macbook due to its efi limitations.
    Since we are not able to launch legacy bootloaders on the hdd there is no way we can do the method without a pen drive.
    So for the time being we are stuck with a pen drive, and that won't change unless your method works, if it does, then we are safe most likely, if not my method has to suffice.

    Attached Files:

  11. monkeybagel macrumors 65816

    Jul 24, 2011
    United States
    Have you happened to have tried this on a Mac Pro 5,1? I tried many times several years ago, and was unable to get anywhere, but I don't have a lot of experience in the coding department. I have read where others have made it work on a Mac Pro, however I tried installing the EFI bootload and chainloading Windows 7, but never could get it to boot Setup using EFI as it never had video.

    I think it was a result of never determining the correct register for my GPU, which at the time as an ATI 5870. I now have an NVidia 980Ti.
  12. davidcie macrumors member


    Dec 25, 2008
    Nope, sorry. I do not think my approach would be of much help there, but then I have not had a Mac Pro :)
  13. monkeybagel macrumors 65816

    Jul 24, 2011
    United States
    The interesting thing is that the Mac Pro will boot and run anything Windows 8 and newer using EFI with no issues. When using CSM and booting Windows 7, all of the SATA ports are not optimized with AHCI - some are presented as IDE. I think where I am stuck is not knowing the registers of the nvidia GTX980Ti that's in it, and am not sure how to go about discovering them.
  14. flyinmac macrumors 68040


    Sep 2, 2006
    United States
    Yes, it is nice that the old original 2006 Mac Pro will run Windows 10 without issue.

    But I too would like to find a solution to the SATA ahci driver problem. Everything works. Just would be nice to have the faster performance.
  15. mrtenyson macrumors newbie


    Apr 27, 2016
    --- Post Merged, Apr 27, 2016 ---
    hi I accidentally clean the whole disk while boot efi like you said. My MBP now run fully win10 and no osx. however, it doesn recognize my audio input. what should i do ?! help me plssss thank you
  16. flyinmac macrumors 68040


    Sep 2, 2006
    United States
    The audio drivers can be found on the website for the manufacturer of the sound chips in the Mac.

    I don't remember who produced the chips in your Mac. But you can look it up.

    Download the Windows drivers from that manufacturers website.

    That's what I've always done.
  17. ActionableMango macrumors G3


    Sep 21, 2010
  18. user97908, May 2, 2016
    Last edited: May 2, 2016

    user97908 macrumors newbie


    May 1, 2016

    I'm looking to install Windows 7 with EFI, on a Macbook Pro early 2015 (everymac).
    I want to start clear. I red a lot of this post and some others, but i'm not clear about formatting.

    To create an usb bootable windows 7 installer pendrive, I need :
    ->To format it in MBR ? Which kind ? / With an Apple Partition scheme first ? I am a bit lost there

    For the files in the USB installer, I need to modify :

    ->(obviously) the boot folder --> Which one exactly ?
    ----then--->Where and what modify ? -----> Is the drivers their have to be added manually, too ? (i mean, just to permit the mac to boot on it basically)

    Thanks for your helps. If i manage to do something anyway, i'll create a special post (kind of ready to be edited later) for this special mac with my special personal partition scheme.
  19. dssence macrumors newbie

    Nov 2, 2008
    My friends I ended up here after reading some threads about enabling EFI boot for windows say 8, 10 and whatever comes along..
    So story short I have a macbook model 6,2 Arrandale 1st gen with intel HD graphics, and nvidia GT 330M.
    This has been so annoying for me , first of all I installed with Legacy mode and everything went fine only 1 gpu is being detected I can install nvidia drivers fine without moding dev strings. I even managed to overclokc using nvidia inspector.

    Then I said why not install in EFI mode. I went ahead and installed latest windows 10 build. What happened was as follows. I changed partition to GPT using gdisk created partitions from osx. Some times I came to the error . Windows can't modify boot configuration error , over and over. Until hours of reading and trying. I came to realise stupid Apple has a so much closed internal implementation of EFI on these machines different to what EFI specification is told.
    So to make it short, so that windows installer can update boot configuration,which in fact is nothing more than , creating the BCD enviroment boot files on EFI partition. I had to make 2 NVRAM resets until backlight it's set to maximum. And again boot over and windows installation reboots fine. Somehow resetting NVRAM , resets some flags on the efi partition.
    Hours and endless hours , trying to install. The only working solution to install EFI mode . Is

    1 - NVRAM reset twice.
    2- diskpart creating EFI partition, MSR partition , and windows partition , assigning letters to each of the partitions, then run windows setup ,and allow to finish.

    Problem is once I log to the finished installation. I get both Video cards with exclamation marks . I can't even install drivers on Nvidia even using modified drivers , and disabling driver signing. Still gives error 43.

    I even tried using refind UEFI shell with these commands.

    mm 01000004 7 -pci
    mm 0001003e 8 -pci
    mm 750 2 -io

    I understand using pci region registers, but If you can lead me a hand about -IO space registers. I'd be willing to make more tests. How can I decipher which IO registers are being used for either card intel HD or nvidia. Intel HD won't be using any PCI Bridge as it's integrated on the CPU die.

    Anyways.. I'll wait for your answer .. thanks!
  20. bvrulez macrumors newbie

    Mar 3, 2015
    Hi, I have rEFInd installed on my Macbook Pro 17 inch Early 2011 with Windows 7 as a second boot option. Upon trying to install a third partition with Linux somehow the Windows became corrupted and wont boot any more. I still can boot into rEFInd and chose between the two options and OS X will work fine, though. I am here because this thread was linked on the website of the creator of rEFInd. Sorry, if I am wrong but there don't seem to be too much forums to discuss this in depth. Thanks, Ben
  21. davidcie macrumors member


    Dec 25, 2008
    It's hard to help you without a good understanding of what actually happened. Do you have a hybrid MBR or a pure GPT? How did you make space for the third OS? If you boot into OS X can you at least mount the Windows partition (ie. is this just a matter of fixing the boot manager or the partition is dead)? Please go into somewhat greater detail because so far we know the equivalent of "my car broke when I was driving, how can I fix it?" :) (No offence meant, we've all been there.)
  22. bvrulez, Feb 2, 2017
    Last edited: Feb 2, 2017

    bvrulez macrumors newbie

    Mar 3, 2015
    Thank you very much for your reply! I asked a question on stack exchange with all the details. If you need more I will be happy to deliver them. I did not yet try to mount the partition, yet. Another guy suspects the MBP should actually be a pMBP and that this is the problem. .


    UPDATED: People think it might be the MBR that is wrong. So I posted another question which is more focused:
  23. davidcie macrumors member


    Dec 25, 2008
    I can see you're getting help over on SE so let's wait and see what happens there. But looking at your problem description and knowing that you used Disk Utility to resize partitions I expect you're right that you need to regenerate MBR partition table. You should be able to do that using gptsync.
  24. bvrulez, Feb 3, 2017
    Last edited: Feb 3, 2017

    bvrulez macrumors newbie

    Mar 3, 2015
    Unfortunately, I think the answers to my questions dried up. I am just recently reading about MBRs and am not comfortable with it, yet. If you or anyone else would provide feedback on how to fix it with gptsync (or other tools) I would be happy to upvote. Thanks again!

    Also, I can NOT mount the Windows partition in OS X:

    $ sudo mount -t msdos /dev/disk0s4 /fat_mount
    mount_msdos: Unsupported sector size (0)
  25. remko macrumors newbie


    Feb 10, 2017
    I know I am replying to a very old thread but this is a very interesting topic! Besides the dual GPU or switching between the 2, Apple also cripples Thunderbolt when running under another OS (Windows via BootCamp in my case). It's easy to install the Intel Thunderbolt drivers and a patch for Intel's Thunderbolt GUI was also easy (to disconnect devices and/or get device list). However only with rEFInd and spoof_osx_version the Thunderbolt stuff works properly. But of course this gives the black screen issue which is partially resolvable by removing the Intel drivers (but external display no longer possible).

    Would it be possible to force always discrete GPU and only this one which seems like the opposite of what you guys were doing? Possibly with the gmux driver posted here?

Share This Page