Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mark1234

macrumors member
Sep 2, 2011
80
0
Amsterdam, the Netherlands
Well I am sure that we should not set the VGAE register of any of the PCI bridges, but
I did not expect to see this behaviour when doing it.
For our Mac Mini, Intel is using a VideoController which directly operates on bus 0.
This is very unusual since most videocontrollers communicate via a PCI bridge in order
to reach bus 0. If you want to read out more, see http://tldp.org/LDP/tlk/dd/pci.html.

I think the way to go is to read out the EFI registers when booting in BIOS mode.
On page 15, I see that rip1999eternal has found a method by doing this with BOOT_DUET.

One thing I noticed is that when I boot in BIOS mode in Windows 7 and check the videocontroller
with hardwareInfo64 (Bus -> PCI BUS #0 -> Intel Sandy Bridge-MB GT2+ - Integrated Graphics Controller),
I see that Fast Back-to-Back Transactions is enabled.

When I boot in EFI into the EFI shell and check the register of the VideoController I see that
Fast Back-to-Back Transactions is disabled.

So we should at least enable this feature with an mm command.
 

624636

Suspended
Oct 10, 2011
103
0
Ok,

So I have made some progress. My initial thought was that my Intel Graphic chip is on bus 0, so I do not have to set the VGAE register of the corresponding PCI bridge. I was wrong!!!!!
When I set the VGAE register of any PCI bridge who has Primary Bus=0, I am able to boot into Windows 8 and I do not get a black screen. As long as the primary Bus=0 of the PCI bridge this works. When the primary bus of the PCI bridge is not 0, and I set the VGAE register of this PCI bridge, I will end up with a black screen.

So I am able to boot into Windows 8 now with the Intel accelerated graphic driver. However, there is an exclamation mark behind the "Intel HD Graphics" in the device manager. The message is as follows:

The device cannot find enough free resources that it can use (Code 12).
If you want to use this device, you will need to disable one of the other devices on this system.


I have tried it with all PCI bridges with primary bus=0 and I will always get the message above.

With this I think you desactivate the Pci Bridge and so the graphic acceleration ! I tried many configuration and none works.

Your new tracks in order to mimic the configuration of Bios mode is interesting !

Do you know the formula to set the register ? I think you have ton convert in hexadecimal.
 

mark1234

macrumors member
Sep 2, 2011
80
0
Amsterdam, the Netherlands
I don't have time to do some experiments the coming week, but I'll be lurking around on this forum.

The BIOS mode on an APPLE machine is basically a BIOS layer (CSM) on top of UEFI. With BOOT_DUET, it should be able to read the EFI registers in BIOS mode. Since in BIOS mode we have accelerated VGA drivers, there must be somethig different in the EFI registers. At least that's what I hope, althought rip99eternal did not have much success with finding differences.

----------

With this I think you desactivate the Pci Bridge and so the graphic acceleration ! I tried many configuration and none works.

Your new tracks in order to mimic the configuration of Bios mode is interesting !

Do you know the formula to set the register ? I think you have ton convert in hexadecimal.
You are absolutely right. When there is a problem with the PCI bridge, Windows automatically switches to the basic graphic driver. I did not realise this. It still is an easy way now to startup with the basic video driver.

The formula to set the register is with the EFI mm command. The register contains only bits. It is the EFI shell who shows a representation in Hexadecimal. In order to set the register we should therefore use the hexadecimal notation for the bits. It is important to note that the PCI registers are always little-endian. This means that the least significant byte always comes first. For example, the field for the Manufacturer is two bytes long. For Intel, the Manufacturer identification is 8086. This is two bytes long in hexadecimal notation. When you look in the PCI register you will notice 86 80, i.e. in reversed byte order. Thus, the least signaficant byte first.
 
Last edited:

d3vi1

macrumors member
May 18, 2011
68
10
Frankfurt am Main, Germany
I don't get it. In my understanding this is for emulating UEFI on a BIOS machine... :confused:

It is. As such, it runs in CSM (Bootcamp) mode, where the PCI registers are correctly configured and Windows runs correctly.
That's actually how I discovered the initial differences between the working DUET UEFI implementation and the Apple EFI implementation.
 

624636

Suspended
Oct 10, 2011
103
0
One thing I noticed is that when I boot in BIOS mode in Windows 7 and check the videocontroller
with hardwareInfo64 (Bus -> PCI BUS #0 -> Intel Sandy Bridge-MB GT2+ - Integrated Graphics Controller),
I see that Fast Back-to-Back Transactions is enabled.

When I boot in EFI into the EFI shell and check the register of the VideoController I see that
Fast Back-to-Back Transactions is disabled.

So we should at least enable this feature with an mm command.

I check mine and "Fast Back-to-Back Capable" are set to 0 on my Display Controller and on the related PCI bridge.

Which devices you think we have to activate ? Maybe the both ?

Any Idea on which "mm command" we have to type ?
 

kraades

macrumors member
May 1, 2012
44
0
The Netherlands
I don't get it. In my understanding this is for emulating UEFI on a BIOS machine... :confused:

Ok, so you go from EFI to BIOS emulation (Boot Camp) and then from BIOS emulation to EFI using Duet en read the settings using the EFI shell.

Correct?

Is this a good starting point?

Edit: After posting I saw the explanation of d3vi1... So I guess this is how it works. Thanks.
 
Last edited:

kraades

macrumors member
May 1, 2012
44
0
The Netherlands
Yes, we want to know what the PCI register settings are when running in BIOS mode.
Another option is to read out the PCI register settings from OS X. However, I don't think there exists a program who can read the PCI registers after booting into OS X. Althoug I haven't checked the link which mac-hacks has posted: http://www.macupdate.com/app/mac/12850/macpilot

So theoretically if you go from EFI -> BIOS emulation -> DUET -> Windows 8 EFI everything should work as expected because everything is set correctly in BIOS emulation?

I guess I can start installing DUET from scratch?
Because then EFI will detect non-EFI mode and execute the BIOS emulation?

And then try to see if Windows 8 in EFI mode will work.
Anyone know at what point you can start the EFI shell to dump the settings?
 

mac-hacks

macrumors regular
Jan 14, 2011
118
0
Swimming In Tsunami
I disassemble my MacPro 2010 boot.efi & my MacBook Pro 2011 Firmware.scap, after taking quick glance at both .asm. Looks like someone with experience writing code using Intel C Compiler for EFI could tweak Apple EFI. My background Hardware & simple Bash scripts. Here link's for disassemble.asm, if anybody got time & knowledge and wants to take look at it.

boot.efi

firmware.scap
 

mark1234

macrumors member
Sep 2, 2011
80
0
Amsterdam, the Netherlands
So theoretically if you go from EFI -> BIOS emulation -> DUET -> Windows 8 EFI everything should work as expected because everything is set correctly in BIOS emulation?

I guess I can start installing DUET from scratch?
Because then EFI will detect non-EFI mode and execute the BIOS emulation?

And then try to see if Windows 8 in EFI mode will work.
Anyone know at what point you can start the EFI shell to dump the settings?
I haven't read all the details about DUET, but it sounds like a good idea.
You can also try a more simpler scenario:

EFI -> BIOS emulation -> DUET -> EFI shell. Now dump out the PCI registers as they have been correctly set by the BIOS emulation layer.
 

DaGr8Gatzby

macrumors member
Dec 24, 2011
98
4
As much as I love my setup, I'm sorry that I have not been able to assist you guys further. Reading up on your latest updates, I have a theory about whether or not the following will work:

Mac EFI -> EFI shell -> Grub -> Legacy boot that loads tianocore -> install.

... Maybe I'll get around to testing this weekend. Are multiGPU systems still having issues when loading tianocore?
 

kraades

macrumors member
May 1, 2012
44
0
The Netherlands
I am looking at this Preparing to Use DUET...

One question:
What actually does trigger the BIOS emulation?
Everything that is not EFI? Is it that simple or is it more specific?

BTW
I have updated(*) the issue on the Intel forum.
I am curious how they will respond in the end...

(*) at the time of writing the post still needs to be approved...
 
Last edited:

mark1234

macrumors member
Sep 2, 2011
80
0
Amsterdam, the Netherlands
I think it is the MBR (master boot record) which will trigger it. If an USB stick has an MBR, when you press down the Option key during boot, the writing below the USB stick is "Windows".

It's good that you have reported it to Intel. Let's see what they will come with. I hope they will not answer that Apple does not support UEFI.
 

d3vi1

macrumors member
May 18, 2011
68
10
Frankfurt am Main, Germany
It's good that you have reported it to Intel. Let's see what they will come with. I hope they will not answer that Apple does not support UEFI.

Neither does Microsoft due to the VGA and int10h dependency. From what I've seen, the Windows video drivers use VGA for probing the video card for monitors. As such, we need the VGAE registers. Without them, the cards are good only for GPU computing.

In Mac OS X, unlike Windows, the video drivers work perfectly without ANY legacy VGA dependency on registers or memory ranges, IO ports, etc.

I would go as far as making the following assumption: most Windows drivers don't actually implement the DCC port scanning and use the VGA services for that.

On an UEFI, OpenFirmware, or other firmware system, the video driver MUST provide a way to scan the graphic card ports for attached monitors. Furthermore, operating systems designed for UEFI and OpenFirmware have drivers that can initialise hardware from scratch. Windows, or most Windows drivers that I've met until now, apparently doesn't do that and still requires the VGA Option ROM to initialise the card.
 

kraades

macrumors member
May 1, 2012
44
0
The Netherlands
I am looking at this Preparing to Use DUET...

I did the steps described in the chapter Installing DUET but it doesn't work for me.
I installed DUET on an USB disk.

I tried on two different computers: my HP notebook and the Mac Mini.
The USB disk is ignored on both systems.

Basically what I did is:
- Create a GPT partition table and a partition as described
- Install with sh ./duet-install -m -s /mnt/usb/syslinux-405/mbr /dev/sdb1

It does mention that an EFI boot loader needs to be copied to the disk but I guess that is to go from DUET to EFI...

Any ideas why this does not work? Thanks!
 
Last edited:

srs5694

macrumors newbie
Mar 18, 2012
22
0
I did the steps described in the chapter Installing DUET but it doesn't work for me.
I installed DUET on an USB disk.

I tried on two different computers: my HP notebook and the Mac Mini.
The USB disk is ignored on both systems.

FWIW, I'm the author of the article to which you referred. That said, I'm unable to test the procedure on a Mac, since my only Intel-based Mac uses a 32-bit CPU, and the only DUET builds to which I have access are 64-bit.

Basically what I did is:
- Create a GPT partition table and a partition as described
- Install with sh ./duet-install -m -s /mnt/usb/syslinux-405/mbr /dev/sdb1

It does mention that an EFI boot loader needs to be copied to the disk but I guess that is to go from DUET to EFI...

DUET is EFI. The EFI boot loader referred to is something like rEFIt, rEFInd, or GRUB. If your computer is ignoring the disk, then the problem is much earlier than that. A lack of an EFI boot loader would only become an issue after you successfully boot DUET and see a screen like that shown in Figure 6. My guess is that you're running into a problem with your firmware being unable/unwilling to start a BIOS boot from a GPT disk. This is a topic I cover in this Web page. IIRC, HP notebooks are known to suffer from this problem, as are Macs (with their own unique twist on it, of course). For your HP notebook, you might be able to get it to work by setting the MBR's protective 0xEE partition bootable, as described on that page. For the Mac, you'll need a hybrid MBR, and perhaps set a partition on it bootable, to activate the Mac firmware's BIOS compatibility mode. Creating a hybrid MBR on the USB flash drive might suffice, but I'm not positive of that; you might need to create a hybrid MBR on your hard disk instead of or in addition to on the USB flash drive.
 

kraades

macrumors member
May 1, 2012
44
0
The Netherlands
@d3vi1
Thanks, but I don't have an optical drive in the Mac Mini 2011.

@srs5694
Thank you for your input. Much appreciated!
My focus is to get it working on the Mac, but for fun I tried setting the MBR's protective 0xEE partition bootable using fdisk to get it going on the HP but unfortunately that didn't work.
Never mind, I will now try creating a hybrid MBR using your Hybrid MBRs: The Good, the Bad, and the So Ugly You'll Tear Your Eyes Out guide.
Hopefully I will survive... :)
 

d3vi1

macrumors member
May 18, 2011
68
10
Frankfurt am Main, Germany
You got DUET working without reverting to Hybrid MBR's?

I use GPT only MBRs. I only have a EFI Protective Partition on my drive, spanning the whole length of the drive. I've also found that Windows doesn't care about the length of the EFI Protective Partition in the MBR, as long as it's there and it's the only partition on the MBR.

I created a UEFI DUET iso file from the DUET Floppy image and it works like a charm on MBP6,2, MBA1,1 and MM9,1. It fails to boot on MBP5,3 due to some bug.

Try using this ISO file https://files.me.com/razvan.vilt/wm2ebv
 

RamGuy

macrumors 65816
Jun 7, 2011
1,351
1,913
Norway
I got a problem where as my MacBook Pro 17" 2011 model simply won't boot up CMS (BIOS Emulation) anymore, it's stuck with EFI boot only for some reason.

I've tried booting from both FAT32 and NTFS formatted Windows XP, Windows 7 and Windows 8 CP installations and NTFS formatted USB-drivers won't even show while holding down "alt / option" during startup, and FAT32 formatted USB-drivers with Windows 7 and Windows 8 CP will only show up as EFI Boot and not "Windows" as they would if the BIOS emulation was kicking in.


Why won't my system do the BIOS emulation no more? If I pop these NTFS and FAT32 formatted USB-drivers into my MacBook Air 13" 2011 model it has no problem whatsoever starting up all the different Windows installation using BIOS emulation instead of UEFI. So something makes my MacBook Pro 17" 2011 model not trigger the emulation for some annoying reason.

Now the big question is, how do I get Windows installed with fully working graphics drivers and 3D acceleration etc.. UEFI install does not work and will always prompt me with "Windows cannot be installed to this disk. The selected disk has an MBR partition table. The EFI systems, Windows can only be installed to GPT disks".
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.