Jump to content











Photo
- - - - -

Use winload.efi from Windows 8

winload apple debugging

  • Please log in to reply
10 replies to this topic

#1 davidcie

davidcie
  • Members
  • 4 posts
  •  
    Poland

Posted 31 January 2016 - 04:13 PM

First of all in my first post here let me congratulate all of you on building such an extensive body of knowledge related to the Windows boot process. The amount of quality information here is really astonishing!

 

What I am trying to do is coerce a 13" Macbook Air Early 2015 into booting Windows 7. Apple specifically says W7 is not supported but cannot hurt trying :) (They recommend using W8 or W8.1 which do install work just fine.) This is their first firmware that does not have BIOS emulation / CSM mode available, and both the standard boot manager as well as rEFInd only show EFI-compatible bootloaders. W7 UEFI installer immediately goes into a blank screen but (long story short) I did get a UEFI-compatible W7 installed / imaged on the HDD and apropriate entries added to the BCD. However, like the installer, it will not boot, going straight into a blank screen and hanging there forever once W7 is selected in rEFInd.

 

Avenue One

Knowing that (1) Windows 8 works just fine and that (2) the hang seems to occur early on, I hoped that "simply" replacing a known-good winload.efi with one from W8 would get me started. Since its job is to mostly initialize hardware and then run ntoskrnl.exe I hoped this should not be too bad. Alas, my W7 install with winload.efi from W8 seems to get a little further: it displays a message that ntoskrnl.exe's signature could not be verified and allows me to go back to the F8 menu. Just for kicks I then replaced ntoskrnl.exe as well as its dependencies (BOOTVID.DLL, hal.dll and kdcom.dll) but got a crash soon after.

 

Do not yet know enough about the interplay between winload.efi and ntoskrnl.exe to judge if disabling signature verification is all I need to do or that there is so much communication between the two that they're utterly incompatible beyond surface-level hackery.

 

Avenue Two

Try to debug the boot process and see where it hangs. However, (1) Air does not have a serial port, (2) I do not yet have the required NET20DC debug cable, and (3) someone recently did not have much luck debugging even bootmgfw.efi with serial so I'm not sure I'm going to have much luck debugging a later-in-the-process EFI program with USB.

 

Summary

I do have programming experience but this is way more low-level than I have ever tried. Also, do have IDA but do not know what to look for yet, especially lacking the symbol files. Will thus be grateful if any of you could point me in the right direction. 

  • Do you think I should chase forcing W8's winload.efi to work with W7 or will I be better off looking for that USB debug cable already?
  • Is there some way I can learn — without a debug cable — at what step is W7 hanging to make sure it's winload.efi and not ntoskrnl.exe that is the root of the problem?
  • Looking at all this and knowing much more than I do, what likelihood would you guesstimate there is of making this to a successful end?

(Final remarks:

  • I did have a cursory search here as well as on Google but came back empty-handed. There are many threads on Air+W7 but all of them immediately conclude "not supposed to be done, sorry”.
  • No, I'd much rather spend a few days making it run natively than use a virtual machine.)


#2 cdob

cdob

    Gold Member

  • Expert
  • 1314 posts

Posted 31 January 2016 - 04:49 PM

firmware that does not have BIOS emulation / CSM mode

at what step is W7 hanging

.
Long shot, guessed, not tested: it's the graphic card without VESA BIOS routines.

Try a win 7 bootmgr.efi and 'novesa=on'
And try a win 8 bootmgr.efi and 'novga=on'
https://msdn.microso...2(v=vs.85).aspx

#3 Pockets69

Pockets69

    Newbie

  • Members
  • 26 posts
  •  
    United States

Posted 01 February 2016 - 03:11 AM

How great davidcie we are here for the exact same motives...

 

Although i own a much older machine, a macbook 7,1 (2010), the woes of booting windows 7 in EFI mode are old as well, some people have been successfull in accomplish that, but i would say that it was some models only and luck involved, over here at this thread: http://forums.macrum...ulation.696523/people discuss our exact issue, a white or black screen while trying to launch windows 7 efi installer, or booting windows 7 after installed.

 

Now people reported methods working like slipstream drivers and doing unattended installs, which actually worked for some people, that thread throughout it's 43 pages evolves into windows 8 and windows 10 booting, while those do show image on the screen unlike windows 7 (which only shows a black or white screen) they do have problems as well, mainly when you install gpu drivers you get a black screen, now i know your machine is new, and the firmware has probably better compatibility and as you told us windows 8.1 and 10 work, but I have been through hell and back to get my multiboot system working, I have done an extensive post on what i have gone through and tried over here as well: http://forums.macrum...e-320m.1953551/

In the end if you want to have an image on windows 7 you need to mess with EFI shell and PCI Registers, what you need to do is enable VGA on the PCI Bridge.

 

firstly you need to find which pci bridge is connected to your gpu and then poke it :)

 

you will be needing the following commands:

pci -i -b to check your pci devices

pci -i device -b to check the registers of said devices, for instance pci -i 00 17 00 -b

then you need the mm command to poke the pci devices for instance this mm command will poke register 3E on device 00 17 00 and chnage it's value, mm 0017003E 8 -PCI

 

i was not able to get windows 7 working using this method but was actually able to make ubuntu work, as i said in the beginning this is an hit and miss situation some machines setting the correct pci registers makes windows 7 work, on others like my example i was not so lucky.

 

Feel free to read through my thread on macrumors or through the original 43 pages long thread (now abandoned) over there.

 

To finish up on this, I found this forum literally two or three hours ago, trying to search for new solutions regarding to my issue of not being able to boot windows 7 in efi mode on my macbook, although i am now exploring booting windows 7 in bios mode in a gpt disk (which i thought it would be impossible but apparently is not) and that was all thanks to the thread i found on this forum don't know if its going to work or not, but ill still try.

 

Also cdob is in fact right its the VESA Bios routines that's why you have a black screen, the mm comands may fix that, or in my case they didn't, I haven't tried cdob solution but i am going to give a go as well on my macbook, maybe it solves may problem, who knows?!  



#4 davidcie

davidcie
  • Members
  • 4 posts
  •  
    Poland

Posted 01 February 2016 - 03:52 PM

@cdob, @Pockets69, thank you for your comments.

 

Long shot, guessed, not tested: it's the graphic card without VESA BIOS routines.

Try a win 7 bootmgr.efi and 'novesa=on'
And try a win 8 bootmgr.efi and 'novga=on'
https://msdn.microso...2(v=vs.85).aspx

 

I switched to a Win7 bootmgfw.efi and added a novesa boot parameter. Still the same result thou — a blank screen immediately. I also played with other options:

  • bootlog on to get some logging going but the file this should produce (%WINDIR%\Ntbtlog.txt) does not get created
  • bootux disabled
  • novesa on
  • novga on
  • onecpu on
  • pciexpress forcedisable
  • tpmbootentropy ForceDisable
  • usefirmwarepcisettings off
  • uselegacyapicmode on
  • vga on
  • x2apicpolicy disable

None of them seems to have made any difference. (I was setting them on the W7 entry, {default}; was not possible to set any on the {bootmgr} entry.)

 

How great davidcie we are here for the exact same motives...

 

Although i own a much older machine, a macbook 7,1 (2010), the woes of booting windows 7 in EFI mode are old as well, some people have been successfull in accomplish that, but i would say that it was some models only and luck involved, over here at this thread: http://forums.macrum...ulation.696523/ people discuss our exact issue, a white or black screen while trying to launch windows 7 efi installer, or booting windows 7 after installed.

 

In the end if you want to have an image on windows 7 you need to mess with EFI shell and PCI Registers, what you need to do is enable VGA on the PCI Bridge.

 

Yes, I am aware of that mammoth thread :) Unfortunately I believe most of it, as well as your PCI registers ingenious tricks, have to do with NVIDIA discrete GPU chips. My case is a lot simpler, in that this Air only features a standard Intel HD Graphics 6000 so there is no trickery involved in switching it off for a more powerful chip. Moreover, it runs Ubuntu just fine, it's only Windows 7 that is not able to play with it well.



#5 Pockets69

Pockets69

    Newbie

  • Members
  • 26 posts
  •  
    United States

Posted 01 February 2016 - 05:19 PM

umh bummer, well yeah it may be related to Nvidia gpus BUT not discrete gpu, as some of the people that attempted that on the thread only had one nvidia gpu and they succeeded, at least as far as i can remember, but still wouldn't you be able to find which PCI registers control the intel gpu poke them, so you hopefully get an image, to be honest i don't know much more to help you, this is what i could contribute, I would advise you to wait for cdob's input. 



#6 cdob

cdob

    Gold Member

  • Expert
  • 1314 posts

Posted 01 February 2016 - 05:46 PM

Still the same result thou — a blank screen immediately.

The culprit is a GOP only graphic card.
Windows 7 default graphic card driver dosn't support UEFI GOP graphic card:
waits endles for BIOS graphic card to respond

Microsoft Basic Display Driver
https://msdn.microso...y/dn653353.aspx

In Windows 8, The Microsoft Basic Display Driver (MSBDD) is the in-box display driver that replaces the XDDM VGA Save and VGA PnP drivers.

MSBDD supports Unified Extensible Firmware Interface (UEFI) Graphics Output Protocol (GOP).



Avoid windows 7 default graphic card driver vgapnp.sys.
However, this diver is deep included to the OS. It's the fall back solution.
It's a crazy idea to remove the default in-box display driver vgapnp.sys.
No idea, if this is possible at all.

Does exist Intel drivers at Windos 7, 8, 10 HD Graphics 6000 for this hardware?
Can you install indos 8 at UEFI and use a Intel driver? Which Intel driver does work?

Ideas:
-insert Windows 8 default graphic card driver files to Windows 7, result highly questionable
-install Window 7 to a (virtual) machine, clone the disk
-make a Windows 7 unattended version,
disable default graphic card driver
and integrate hardware related graphic card drivers
 

windows 7 (which only shows a black or white screen) they do have problems as well, mainly when you install gpu drivers you get a black screen

This promises even more fun :)
A black sreeen with a cursor (vgapnp.sys) and a black screen without a cursor (igdkmd64.sys)
Did anybody disabled vgapnp.sys at the long thread?

#7 Pockets69

Pockets69

    Newbie

  • Members
  • 26 posts
  •  
    United States

Posted 01 February 2016 - 05:59 PM


A black sreeen with a cursor (vgapnp.sys) and a black screen without a cursor (igdkmd64.sys)
Did anybody disabled vgapnp.sys at the long thread?

 

Sorry cdob I think i wasn't clear enough, I meant windows 7 results in black screen on my macbook (which has an nvidia 320m) and the GOP explanation was actually used on that giant thread.

 

On the windows 8 and 10 side for me i get an image because obviously i am running Microsoft Basic Display adapter, but as soon as i install the nvidia driver, black screen, the pci registers thingy i added that should correct my problem don't (but the hack does work on the linux side of things with nvidia proprietary driver), the black screen i get doesn't have any cursor its simply a black screen with no backlight if drivers are installed and pci registers are correctly set (same on windows 7 8.1 and 10) as for what you ask if anybody disabled vgapnp.sys no i don't think so, at least no one mentioned.

 

But let me see if i get this clear, you suggest removing vgapnp.sys and use windows 8 basic display driver?


Edited by Pockets69, 01 February 2016 - 06:04 PM.


#8 davidcie

davidcie
  • Members
  • 4 posts
  •  
    Poland

Posted 01 February 2016 - 06:04 PM

More winload.efi

Had free time today and went to test my supposition that it's W7's winload.efi that is somehow not playing ball with Early 2015 Air, perhaps unable to communicate with the SSD (this would explain why I get no bootlog). To get some evidence on this front I deleted ntoskrnl.exe and here are the results:

  • [W7] bootmgfw + [W7] winload.efi: nothing, blank screen as always
  • [W7] bootmgfw + [W8] winload.efi: nothing
  • [W8] bootmgfw + [W7] winload.efi: screen with kernel missing message
  • [W8] bootmgfw + [W8] winload.efi: screen with kernel missing message

So even W7 winload.efi can in fact find out that ntoskrnl.exe is missing and so it has no problem communicating with the HDD. It would appear that @cdob is right in that winload.efi does hand off processing to ntoskrnl.exe, and the hang happens later in the process than I supposed

 

Back to VGA

In the meantime @cdob's new comment appeared. Some answers:

  1. Yes, there are Intel's official drivers for this card.
  2. I installed W8 on this machine and W8 with those drivers worked just fine, so I suppose preparing an unattended W7 with them should be fine too.

Right, getting to work on wiping vgapnp.sys off the face of the HDD :)



#9 cdob

cdob

    Gold Member

  • Expert
  • 1314 posts

Posted 01 February 2016 - 06:38 PM

]But let me see if i get this clear, you suggest removing vgapnp.sys and use windows 8 basic display driver?

Yes, that's the crazy idea. However kernel and hal may fail.
 
 

Right, getting to work on wiping vgapnp.sys off the face of the HDD :)

Be aware, back then setupldr.bin did load vga.sys, the name is hard encoded in setupldr.bin.
bootmgfw may load vgapnp.sys.

#10 davidcie

davidcie
  • Members
  • 4 posts
  •  
    Poland

Posted 03 February 2016 - 11:05 AM

@Pockets69, I have to eat my own words and apologize. You were right that I should have a closer look at that mammoth thread over at macrumors. Before I started this thread I did see it but assumed all you were doing was attempting to get both the integrated and discrete GPUs working... While in fact what happens in that thread is very closely related to what I am trying to do here.

 

As I read more and more about VGA, GOP, int10h, @cdob's words, I slowly gravitated towards that giant thread and read it from first to the very last post. It proved instrumental in getting me where I am now, and I have to thank you both for it. My case might be slightly more complicated because in addition to an EFI-only, BIOS-less world I also have NVMe to worry about.

 

As far as getting somewhere is concerned, however, I am superficially not very far. Got Windows (hopefully correctly this time) installed and on the outside the only thing that changed is I get a single characted displayed on screen — and then ntoskrnl.exe likely crashes because I am thrown back to the boot manager. But this single character is giving me hope that not all is lost.

 

Will continue my explorations over at macrumors, where I wrote a more extensive post on my endavours so far, as what is done there very closely resembles my journey (behind and ahead). It also seems that this journey has nothing to do with swapping winload.efi as I suspected starting this thread :) Feel invited to head over to macrumors and join the discussion for the benefit of mankind!



#11 Pockets69

Pockets69

    Newbie

  • Members
  • 26 posts
  •  
    United States

Posted 03 February 2016 - 02:59 PM

I have been trying to benefit mankind without asking for help for about 3 months, to be honest i had given up on it 2 or 3 days ago, your post just right now gives me a little hope, I did that post in macrumors that i linked in my first post here, and what i got was a guy saying "i can run Windows on my macbook just fine", and today someone telling me that "Apple will refer you to nvidia, nvidia will refer you to Microsoft, MS to apple, Efi booting of windows is impossible" which is pretty accurate, but that was why didn't post on apple support or any other official support forums, because they don't want to fix it.

 

Right now i got my multiboot setup done, my windows 7 boots when i set the partition flag to hybrid, and when i set it to protective it boots windows 10 (without graphics acceleration) but to be honest i don't mind wiping out everything and start over, maybe we can help each other over there or over here, I am going to read your post, maybe like you I should have just dug that post and continue the discussion, but i don't think it would do much difference, right now we can only hope discussion picks up again, Ill post over there and continue discussion.

 

cdob if you would like to help out please head over there and maybe your invaluable experience will help us out.







Also tagged with one or more of these keywords: winload, apple, debugging

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users