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

sirnh

macrumors regular
Original poster
Aug 16, 2006
105
0
I was doing more research about UGA cards and EFI last night, and I believe there may be a way to use off-the-shelf WinTel GFX cards with EFI.

First, a compatible EFI graphics card must exist. For this example, we will used an ATI X1900XT Pro. The firmware would need to be downloaded from the card's flash memory. This firmware may contain both a UGA and a BIOS implementation. The UGA driver would need to be extracted from the firmware.

The UGA driver should be compatible with existing WinTel cards, since the chipset probably uses the same register and memory mappings between BIOS and UGA implementations.

Once the UGA driver is extracted from the firmware, an EFI driver would be created which would wrap and load the UGA driver from local storage instead of from ROM.

The Apple drivers would still need to be changed to recognize the PCI/VENDOR strings of the WinTel cards, but that normally means just changing a text config file. If the UGA driver exists and is running, the card should be recognized by the OS driver.

Of course, this is a simplified description of the solution. It would require much more research:

* How to extract the UGA driver from the downloaded firmware.
* How to create an EFI driver.
* How to get the EFI driver to load the UGA driver, and then run it.
* How to not brick the entire system while developing the driver.

This solution is based on information from the following web page:

Specifically the following section on UGA:

Universal Graphics Adapter (UGA)

As mentioned earlier, legacy BIOS depends on VGA, a legacy standard. Thus, given the growing needs of pre-boot applications, graphics support in a firmware environment is both very limited and hard to program with (consider factors like 640x480 maximum resolution, small framebuffer, use of palette modes, and so on). EFI defines the UGA specification as a replacement for VGA and VESA. Microsoft is behind UGA, with support from major graphics device manufacturers like ATI.

Any graphics device with UGA firmware can be considered a UGA device. It may also contain VGA firmware for compatibility. The firmware execution environment interprets UGA firmware, which again is implemented in a high level language. Similarly, programming a UGA device does not require you to deal with hardware registers, etc.

The UGA model would work as follows: the UGA firmware may reside on the graphics device, may be a part of the system firmware in case of an onboard graphics device, or may even come from a regular storage device. The firmware contains an EFI driver, which is still a "lowest common denominator" driver, and is not meant to replace a "high-performance" device specific driver that would normally be part of the operating system. That said, the UGA driver may be used in the post-boot environment in various scenarios:

* As a fallback when the regular driver is corrupt or missing from the operating system.
* As the primary driver in machines where graphics performance is irrelevant, such as a server.
* In certain operating system modes such as "safe" and "panic".
* For displaying graphical elements when the primary driver may not be available temporarily, such as during operating system installation, early startup, hibernation, etc.

Unlike VGA, the UGA firmware does not access the graphics hardware directly. It operates within an EFI virtual machine. Microsoft provides a generic Virtual Machine Library (VML) that a UGA firmware is linked with. This virtual machine -- a thin logical layer above EFI -- wraps (encapsulates) a specific UGA firmware implementation.​
 

7on

macrumors 601
Nov 9, 2003
4,939
0
Dress Rosa
Though the debate is about whether or not the EFI Mac BTO cards have a larger firmware chip or not.
 

sirnh

macrumors regular
Original poster
Aug 16, 2006
105
0
7on said:
Though the debate is about whether or not the EFI Mac BTO cards have a larger firmware chip or not.

The point is to not need a firmware flash rom. You are actually loading the firmware from disk not from the card.
 

Krevnik

macrumors 601
Sep 8, 2003
4,101
1,312
sirnh said:
The point is to not need a firmware flash rom. You are actually loading the firmware from disk not from the card.

Good luck with that... let me know in a couple years how that turns out. ;)

The problem with loading firmware from disk is that you need to tell EFI to look there... which means you are overriding Apple's EFI implementation. You would likely need to hack something like rEFIt to do the job, which isn't exactly a very clean solution. An easier solution would be to simply reflash the card under Boot Camp once we know how difficult it would be to reflash.
 

sirnh

macrumors regular
Original poster
Aug 16, 2006
105
0
Krevnik said:
Good luck with that... let me know in a couple years how that turns out. ;)

The problem with loading firmware from disk is that you need to tell EFI to look there... which means you are overriding Apple's EFI implementation. You would likely need to hack something like rEFIt to do the job, which isn't exactly a very clean solution. An easier solution would be to simply reflash the card under Boot Camp once we know how difficult it would be to reflash.

Actually, EFI is extensible... Apple's EFI sdk includes an example for loading a removable storage driver. You should be able to make other extensions to do things like initializing a video card.
 

Krevnik

macrumors 601
Sep 8, 2003
4,101
1,312
sirnh said:
Actually, EFI is extensible... Apple's EFI sdk includes an example for loading a removable storage driver. You should be able to make other extensions to do things like initializing a video card.

It is extensible to a point. What you are talking about is trying to fetch something from disk, when it is normally loaded before the disk drivers are... The execution sequence is all wrong.
 

timb

macrumors regular
Jun 6, 2003
249
0
Just throwing my two cents in here...

With the help from Thomas over at Strangedogs, we managed to get a dump of the 7300 GT ROM. It clocks in at 128K in size. Out of curiosity we extracted just the EFI portion of the ROM (which is actually about 41K in size) and I reflashed the 7300 with it. So now I had a 7300 GT with just EFI on it. It boots into Mac OS X fine, but not Windows.

In theory, when the Mac 1900's are released, you should be able to get a ROM dump and extract *just* the EFI portion and then flash that to an off the shelf 1900, save some money. You won't however be able to boot into Windows with it.

-timb
 

sirnh

macrumors regular
Original poster
Aug 16, 2006
105
0
timb said:
Just throwing my two cents in here...

With the help from Thomas over at Strangedogs, we managed to get a dump of the 7300 GT ROM. It clocks in at 128K in size. Out of curiosity we extracted just the EFI portion of the ROM (which is actually about 41K in size) and I reflashed the 7300 with it. So now I had a 7300 GT with just EFI on it. It boots into Mac OS X fine, but not Windows.

In theory, when the Mac 1900's are released, you should be able to get a ROM dump and extract *just* the EFI portion and then flash that to an off the shelf 1900, save some money. You won't however be able to boot into Windows with it.

-timb

timb,

I would be curious to get one of those dumps, to know how you extract the EFI/UGA portion... then see if there is a way I can just get it to load from disk instead of ROM.
 

Krevnik

macrumors 601
Sep 8, 2003
4,101
1,312
sirnh said:
timb,

I would be curious to get one of those dumps, to know how you extract the EFI/UGA portion... then see if there is a way I can just get it to load from disk instead of ROM.

Well, to be honest, the whole firmware is UGA... after you have just the EFI portion... it ceases to be UGA. /nitpick ;)
 

jdwl

macrumors newbie
Aug 10, 2006
19
0
timb said:
Just throwing my two cents in here...
Out of curiosity we extracted just the EFI portion of the ROM (which is actually about 41K in size) and I reflashed the 7300 with it. So now I had a 7300 GT with just EFI on it. It boots into Mac OS X fine, but not Windows.
-timb

Was the 7300 you flashed with efi rom an apple card? do you think that would work to make a PC card mac friendly?
 

timb

macrumors regular
Jun 6, 2003
249
0
jdwl said:
Was the 7300 you flashed with efi rom an apple card? do you think that would work to make a PC card mac friendly?

It was an Apple card, and yes I think a PC one will work.

Send me a PM if anyone wants a copy of the ROM.

-timb
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.