Win7 x64 booting natively via EFI (no BIOS emulation)

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

  1. Dragorth macrumors newbie

    Oct 3, 2011
    Thanks for the help

    Using the BCD linked in the previous post has helped alot! I am now able to boot into windows, go into safe mode, and turn off the intel card in the driver management. I used TextWrangler to edit my Specialize.xml, and it wrangled my file:(. My bad.

    I then replaced the specialize.xml with yours, and come across an error. I have not played with BCD's a whole lot, and could not, in my limited free time, get the stock one to work, so great thanks are given all around for the help:D.

    I have classes tomorow, so I won't be working on this anymore tonight ( I tell myself:rolleyes:), but wil post an update about my progress.

    P.S. Is there a thread I missed dealing with these Windows 8 specific issue?
  2. Dragorth macrumors newbie

    Oct 3, 2011
    I continued to work on this and managed to get Windows 8 to install. I had lots of fun in the registry settings, and ended up setting all of the settings to 0, not one, and ran the sysprep /oobe command, then oobe\msoobe. I am writing this in windows currently. I have no problem with the ATI driver, unless the intel driver installation decides to enable the hd 3000 graphics. The audio, however does not work. This is not a major headache, but a minor nusiance. I like to listen to podcast while I am working.

    And the ATI graphics have an exclamation mark in device manager. I looked at the error, and it says that this device does not have enough resources?

    Not sure why that would be. I am fairly sure that we can get whichever driver we want installed if we press f8 at boot up, then choose to disable driver signing, I can install the apple supplied ati driver without doing even that.

    Were you able to get audio to work? If so, can you give me the audio device hardware Id, and the driver you used?
  3. mark1234, Oct 10, 2011
    Last edited: Oct 10, 2011

    mark1234 macrumors member

    Sep 2, 2011
    Amsterdam, the Netherlands
    @dragorth: I don't know which hardware you have, but the audio driver for my mac mini is the Cirrus driver which you can find on your bootcamp 4.01 disc.
  4. jlpek17 macrumors regular

    Oct 10, 2011
    Recap of windows 8 problem


    So I install windows 8 in EFI on my iMac 27 late 2K9 and there somme problem that occurs :

    1* I have the ATI problem with the allocation of memory (code12). I looking for a conflict device but haven't found yet.

    2* Bootcamp doesn't work in windows and it is a problem when you use magic mouse or trackpad because of the customization of the "tap for click" option :) you often drag and drop non intentionaly). I think this is the Start tab wich don't work if we could stat the Bootcamp Pane with another pane It woul work I bet.

    3* In OS X you could not use the Start/Pref-pane for start Windows because it launch in Bios Mode and it doesn't work but it still work when you press Alt. on start.

    For 2 and 3 it's because of the use of AHCI mode so I try to switch to IDE mode with this :
    ... it didn't work but i think the method it's not correct.

    I think the mix of EFI Start in IDE would be useful.

    Thanks for attention.
  5. cbruckne macrumors newbie

    Sep 28, 2011
    The ATI driver isn't used, the device is not started, so the driver doesn't work. You have graphics, but only with the basic windows driver. You can see that, if you right-click on your desktop, "set resolution" an the press the "advanced" button. So no graphics acceleration.

    The audio driver doesn't work for me either, but the bootcamp setup executes fine (newest drivers downloaded with in mac os with w7 compatibility mode) and installs all drivers it has (ati, network, audio, trackpad, bootcamp app...)
  6. jlpek17, Oct 10, 2011
    Last edited: Oct 10, 2011

    jlpek17 macrumors regular

    Oct 10, 2011
    On my iMac27 late 2K9 sounds works properly (Cirus drivers)but I never use bootcamp installer which install all mac drivers.

    I uncompress all drivers in one folder and use dpinst.exe with the scanhardware option (/sh) and it will install/update the drivers which are match my system.
    For the bootcamp app I use the "bootcamp64.msi" directly.

    For the Ati drivers I don't understand because this is Windows Update which proposed this drivers. I'm testing the desactivation of device one by one to found (maybe) the device in conflict with the Ati Graphic card

    I just found that the graphic animation from bootcamp for sounds and brithness works only when you activate the "Old Start Toggle (/Disable Metro").

    I have tested the modified AppleControlPanel.exe from here :
    ... it didn'nt work.
  7. Dragorth macrumors newbie

    Oct 3, 2011

    Yeah, I figured out that the graphics weren't really working the way I thought. I looked through the different devices to try and find the problem. I re-installed in boot camp to find which driver works for sound, and it is the Cirrus Logic CS4206 (AB 29). The device doesn't seem to show up under UEFI, so I wondered if the ATI driver might be trying to use the resources the UEFI allocates to the Sound device to get the chime during bootup? Just a guess, no concrete info, other than my intuition.

    I have not re-installed to manually find the device ID string for the sound card, and I may not have time until this weekend.

    If anyone has the same model, they can look for these device strings.




    I have the Macbook Pro, 6.2 Model No. A1286, Part No. MC723LL/A,
    MBP 15.4/2.2/2X2GB/750/SD/GLSY

    I jave upgraded the ram to 8GB.

    Hopefully this might help someone.
  8. FrancoisC macrumors 6502


    Jan 27, 2009
    Montreal, Qc
    I'm having the same problem on my 2011 mini (The one with the radeon)

    I'm getting graphics, but no acceleration at all, and device manager give me error #12 on the radeon, can't allocate ressource, and also no audio.
  9. Armisael macrumors newbie

    Oct 25, 2011
    Hi folks !

    I've read the hole topic and I'm interested in having a efi booting Win7 on my macbook air 4.2 but I don't seem to be able to find a link to a tutorial or a tutorial itself on the thread.

    Is there some kind soul to give me a hint on where to look ? I'm also interested to know if d3v1l is still on working on his "win7 efi bootloader" and could give a hand if needed.

    I'm a c/c# dev but I have no exprience in pre-boot dev environment but give the right info I can learn quickly :)

  10. d3vi1 macrumors member

    May 18, 2011
    Frankfurt am Main, Germany
    Still working on it, but it became 10 times more complex since the last time I posted and I am working in spare time.
    My biggest problem right now is how do I also have code that survives in Runtime. A UEFI application is loaded as BS Data + BS Code but I need some of the code to be loaded as RS Code + RS Data and I can't figure out how to do that without also building a separate RUNTIME_DXE that gets loaded by the app.
    Apple's implementation of EFI is missing gRS->QueryVariable, which I am trying to implement and would solve all the other installation issues (except for the accelerated video).
    I was hoping to finish the app by september 15th initially. I was supposed to have 600 lines, but right now it has 2000 lines of code and it's only 50 done.
  11. i Smack macrumors member

    Nov 1, 2010
    What are the benefits of installing via EFI? Or is it the default method in newer iMacs?

    I have a late 2010 iMac and since reformatting and upgrading to Lion, I can't install Windows 7 via Bootcamp. Installs, restarts, and presents a black screen with a flashing cursor.

    I've an SSD and HDD so haven;'t the OS's on separate disks won't bother me if it bloody works!! lol
  12. mark1234, Oct 25, 2011
    Last edited: Oct 25, 2011

    mark1234 macrumors member

    Sep 2, 2011
    Amsterdam, the Netherlands
    The black screen in iMac is a known problem. At least make sure that you do not have more than 4 partitions (including recovery partitions). There are solutions and workarounds, just google.

    Apple hardware does not have a BIOS inside. Instead, MAC OS X uses EFI to boot. In order to install Windows on a MAC, you need to have a BIOS. The MAC therefore has a BIOS emulation mode which is not the same as a real BIOS. With this BIOS emulation mode you are able to run Windows. However, the BIOS emulation implemented in the MACs does not have AHCI driver support. You need this if you want to take advantage of SSDs. However, there is a workaround for this (use google).

    This thread is trying not to use the BIOS emulation mode. Instead, d3v1l is trying to let Windows boot in EFI. Advantages are: very fast bootup time, no 4 partitions limit, no 2TB harddisklimit and SSD support. Furthermore, by booting via EFI we have a normal GPT partition. By booting via emulated BIOS we have a hybrid GPT/FAT paritition which is rather old-fashioned and complicated.
    Booting via EFI is the future way to go.
  13. i Smack macrumors member

    Nov 1, 2010
    I have googled the complete life out of it and can't find anything that works. I work as a techie for a living so I've a fair idea of what I'm doing but every suggestion I've tried hasn't worked.. Two weeks with no windows now!

    As for EFI boots, this has me interested. I since read this whole thread and will be trying as soon as I get home!
  14. jlpek17 macrumors regular

    Oct 10, 2011
    Have you try to boot with the windows install cd in your mac or select the windows partition with the Alt/Option at bootup.
  15. i Smack macrumors member

    Nov 1, 2010
    yup, same difference. The problem seems to lie with windows, as soon as it wants to boot I get the black screen with cursor..
  16. janalgo88 macrumors newbie

    Jan 10, 2010
    d3vi1, any luck in finally creating whole package for EFI installation?
  17. d3vi1, Nov 15, 2011
    Last edited: Nov 15, 2011

    d3vi1 macrumors member

    May 18, 2011
    Frankfurt am Main, Germany
    Much closer to it. I am testing the RS->QueryVariableInfo thing tonight. If it works correctly, Windows should install without giving any BCD errors.

    The VGA Registers setting also works. Required in Vista, 7 and 8 for the NVidia/ATi/Intel drivers. But it's not required in Windows 8 if you use the Basic Framebuffer.

    The VGA Emulation should work, but for some yet to be determined reason it doesn't. It's required only in Windows Vista SP1 and Windows 7 for the installer and safe mode. If you have video drivers, it's not required. In Windows 8 it's not required at all.

    Cross your fingers.
  18. crajohns6965 macrumors newbie

    Nov 20, 2011

    I thought we needed VGA emulation in Windows 8 for video drivers? I installed Windows 8 on a Macbook Pro 5,3, and while it came up ok with the framebuffer (the basic GOP driver) it wouldn't install the nvidia drivers. I thought I had read that this was because EFI mode only had GOP and not VGA.

    Looking forward to the package! Even if I could get it working with VGA registers with the refit shell, definitely would be a pain to put them in manually on every bootup
  19. d3vi1 macrumors member

    May 18, 2011
    Frankfurt am Main, Germany
    VGA Emulation is not required unless you use the VGA driver (like in Safe mode in Windows Vista and 7). You do however need to have the VGAE PCI register for the NVidia Windows drivers. In theory, it shouldn't be needed, but the drivers apparently need it. Without the VGAE register, the NVidia driver works perfectly but does not do I2C scanning for devices. It doesn't see any monitors attached and the display resolution is 0x0.
  20. crajohns6965 macrumors newbie

    Nov 20, 2011
    That makes sense. What mm commands did you use in the shell to enable the registers on the Macbook Pro 5,3? I have a Windows 8 install I'd like to try out the native Nvidia drivers on. Thanks!
  21. d3vi1 macrumors member

    May 18, 2011
    Frankfurt am Main, Germany
    Put the EFI Shell as EFI_System_Partition/EFI/BOOT/Bootx64.efi and the following script as EFI_System_Partition/EFI/BOOT/Startup.nsh

    REM Enabling VGA on the PCI Bridge that the NVidia card is connected to
    REM Setting Bridge Control Register (0x3e) to 8
    mm 0010003E 8 -PCI
    REM Enabling NVidia Card "I/O Space Access" and setting it as Bus Master
    REM Setting Command Register (0x04) to 7
    mm 03000004 7 -PCI
    REM Disabling the integrated NVidia Card.
    REM Having only one VGA card is less confusing for Windows. It's on the gMux.
    mm 750 2 -IO
    REM Switch to the EFI System Partition
    REM Run Microsoft's Bootloader
  22. away8907, Nov 23, 2011
    Last edited: Nov 24, 2011

    away8907 macrumors newbie

    Nov 23, 2011
    The developments in this thread just blew me away. I spent the last hour reading every single word.

    I'm that guy that gets bored and starts tweaking, and I went through this whole ordeal a few months ago, all the way up to messing with the Windows 8 preview. I've been OBSESSED with 'uncrippling' my late 08 unibody... First the nVidia overclocking support, now this!?!?!?!

    I had all but given up on overcoming the EFI problems. This morning I was doing some more bored tweaking, my quest to enable AHCI and NCQ brought me right back to this familiar topic, and then I saw the new developments! I even created a new account, couldn't remember login info from back then.

    I've got a 5,1 15", I'd love a copy of your work in progress, hopefully I can still contribute a bit this late in the game. It's a better application of my time than playing with EFI, bootloaders, and ramdisk's ;)

    Also, thanks to all of you for the hard work so far, stumbling upon this thread was like having a lost dog come home after a week...
  23. d3vi1 macrumors member

    May 18, 2011
    Frankfurt am Main, Germany
    Contact me via PM for a copy of the application...
    Right now I'm spending my time solving two problems:
    * getting the x86_emu from SciTech working for post-ing the VGA ROM without using the CSM.
    * Figuring out what happens when the OS switches to virtual mode. I wrote a RuntimeDXE to add the QueryVariableInfo function. It works before the OS boots, but once the OS boots it stops working. I've tried using RS->ConvertPointer, but I'm not sure which pointers I'm supposed to convert and which I'm not. Something funky happens when SetVirtualMode is requested and not all the pointers need converting.
  24. away8907 macrumors newbie

    Nov 23, 2011
    Roger that, I've gotta get to 5 posts, so I'll use this one to tell you that I've started playing with the pointer conversion problem, I'll let you know if I come up with anything. (I wont, haha!)
  25. d3vi1 macrumors member

    May 18, 2011
    Frankfurt am Main, Germany
    So, what I've tried:
    Hooking to the virtual address change event:
    Status = BS->CreateEvent ( EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE, TPL_NOTIFY, VariableClassAddressChangeEvent, NULL, &mVirtualAddressChangeEvent);
    Status = BS->CreateEvent ( EVT_SIGNAL_EXIT_BOOT_SERVICES, TPL_NOTIFY, ExitBootServicesEvent, NULL, &mRuntimeServicesEvent);
    My attempt to create a new RS table with the QueryVariableInfo added.
    ST->Hdr.Revision=((revision << 16) | version);
    Status=BS->AllocatePool(EfiRuntimeServicesCode, sizeof(EFI_RUNTIME_SERVICES), &NewRS);
    NewRS->Hdr.Signature             = RS->Hdr.Signature;
    NewRS->Hdr.Revision              = ((revision << 16) | version);
    NewRS->Hdr.HeaderSize            = sizeof(EFI_RUNTIME_SERVICES);
    NewRS->Hdr.CRC32                 = 0;
    NewRS->Hdr.Reserved              = RS->Hdr.Reserved;
    NewRS->GetTime                   = RS->GetTime;
    NewRS->SetTime                   = RS->SetTime;
    NewRS->GetWakeupTime             = RS->GetWakeupTime;
    NewRS->SetWakeupTime             = RS->SetWakeupTime;
    NewRS->SetVirtualAddressMap      = RS->SetVirtualAddressMap;
    NewRS->ConvertPointer            = RS->ConvertPointer;
    NewRS->GetVariable               = RS->GetVariable;
    NewRS->GetNextVariableName       = RS->GetNextVariableName;
    NewRS->SetVariable               = RS->SetVariable;
    NewRS->GetNextHighMonotonicCount = RS->GetNextHighMonotonicCount;
    NewRS->ResetSystem               = RS->ResetSystem;
    NewRS->UpdateCapsule             = RS->UpdateCapsule;
    NewRS->QueryCapsuleCapabilities  = RS->QueryCapsuleCapabilities;
    NewRS->QueryVariableInfo         = QueryVariableInfo;
    ST->Hdr.Revision=((revision << 16) | version);
    Status=BS->CalculateCrc32 (ST, ST->Hdr.HeaderSize, (VOID *) &ST->Hdr.CRC32);
    Status=BS->CalculateCrc32 (RS, RS->Hdr.HeaderSize, (VOID *) &RS->Hdr.CRC32);
    Virtaddresschange Event Handler
    RS->ConvertPointer (0x0, (VOID **) &RS->GetTime);
    RS->ConvertPointer (0x0, (VOID **) &RS->SetTime);
    RS->ConvertPointer (0x0, (VOID **) &RS->GetWakeupTime);
    RS->ConvertPointer (0x0, (VOID **) &RS->SetWakeupTime);
    RS->ConvertPointer (0x0, (VOID **) &RS->ResetSystem);
    RS->ConvertPointer (0x0, (VOID **) &RS->GetNextHighMonotonicCount);
    RS->ConvertPointer (0x0, (VOID **) &RS->GetVariable);
    RS->ConvertPointer (0x0, (VOID **) &RS->SetVariable);
    RS->ConvertPointer (0x0, (VOID **) &RS->GetNextVariableName);
    RS->ConvertPointer (0x0, (VOID **) &RS->QueryVariableInfo);
    RS->ConvertPointer (0x0, (VOID **) &RS->UpdateCapsule);
    RS->ConvertPointer (0x0, (VOID **) &RS->QueryCapsuleCapabilities);
    My guess is the the Apple provided Runtime DXE will NOT convert the pointers on my Runtime Table, it will only convert them on the original Runtime Table. So I'm converting all the pointers in my RS table.

    My original problem was that the DXE was unloaded on ExitBootServices since the USB Handle from which the DXE was loaded disappeared. I wrote a new loader that loads the DXE to memory and executes it straight from there. It does not free the memory pool before exiting so the memory buffer containing the DXE remains allocated. It's also allocated as EfiRuntimeCode, so that the OS doesn't mess it up.

    You have 3 posts left!

Share This Page