Of all the gin joints in all the towns in all the world, Stephen Polkowski had 
to walk into mine at 10:30:41 on Wednesday 19 February 2014 and say:

> Rats.  Thanks Andrew.

Note that this does not mean you can't use the EDKII to build an EFI 
application which will run on the Apple EFI firmware. (Not sure about EFI 
drivers though.) EFI 1.10 still uses the same executable format (PE32/PE32+) 
and many of the protocols are the same. You can write hello world programs 
that will run on both Apple machines and newer UEFI-based systems. It may not 
be officially supported, but it works. You just need to be careful to 
constrain yourself to protocols that are supported in EFI 1.10.

There is one thing which may stymie you a little which is that when a Mac 
boots, the console is in "graphics" mode. This is to say that if you call one 
of the console I/O services to try and print something on the screen, you 
won't see it displayed. You need to use the ConsoleControl protocol to switch 
it to "text" mode first.

EFI 1.10 uses the UgaDraw protocol. Apparently it makes a distinction between 
graphic and text modes, even though technically they're both the same thing 
(in text mode, software still BLTs characters onto the screen a pixel at a 
time). If the console is in graphics mode, then you can use the UgaDraw BLT 
method to draw graphics on the screen. If it's in text mode, then you can use 
the console I/O services to print things. But you can't use the UgaDraw BLT 
method to draw stuff on the screen while it's in text mode, and vice-versa.

By contast, with the GraphicsOutput protocol in UEFI, you can do both at the 
same time.

You can see an example of how to use the ConsoleControl protocol to switch the 
screen to text mode here (among other places, probably):

http://sourcecodebrowser.com/refit/0.7/ebounce_8c.html

Although it's not used in UEFI, the protocol definition is still in the EDKII 
under:

EdkCompatibilityPkg/Foundation/Protocol/ConsoleControl/ConsoleControl.h

I've found that the simplest way to run a UEFI app on a Mac is to do the 
following:

- Format a USB thumb drive with a FAT32 filesystem on it.
- Create a \EFI\BOOT directory on it
- Copy your app to \EFI\BOOT\BOOTIA32.EFI (or BOOTX64.EFI, if you have a 64-
bit build) on the drive
- Plug the thumb drive into the Mac
- Reboot it
- Hold down the left ALT key on the keyboard as the machine starts up (try to 
hit it before or as soon as you hear the chime)
- You should see a boot selection screen appear. There should be a yellow USB 
device icon labeled "EFI Boot" or something to that effect on the right side 
of the screen
- Use the mouse to click on it, or use the arrow keys to select it and hit 
enter

Your program should run. If you used the ConsoleControl example to switch the 
sceen mode, you should see the grey screen turn black and your console output 
should appear.

-Bill

> Andrew Fish wrote:
> > On Feb 19, 2014, at 8:53 AM, Stephen Polkowski <step...@centtech.com> 
wrote:
> >> Hi all,
> >> 
> >>    Does anyone know if the latest mac laptops have
> >> 
> >> support for UEFI 2.0?  I heard a rumor on the net that the Macbook Air
> >> 2013 now has support for it.  Older Macs supported EFI 1.0 or something
> >> like it.
> > 
> > All shipping Macs are EFI 1.10.
> > 
> >> Thanks,
> >> 
> >> Stephen
> >> 
> >> 
> >> 
> >> ------------------------------------------------------------------------
> >> ------ Managing the Performance of Cloud-Based Applications
> >> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> >> Read the Whitepaper.
> >> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.cl
> >> ktrk _______________________________________________
> >> edk2-devel mailing list
> >> edk2-devel@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/edk2-devel
> > 
> > -------------------------------------------------------------------------
> > ----- Managing the Performance of Cloud-Based Applications
> > Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> > Read the Whitepaper.
> > http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clk
> > trk _______________________________________________
> > edk2-devel mailing list
> > edk2-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/edk2-devel

-- 
=============================================================================
-Bill Paul            (510) 749-2329 | Senior Member of Technical Staff,
                 wp...@windriver.com | Master of Unix-Fu - Wind River Systems
=============================================================================
   "I put a dollar in a change machine. Nothing changed." - George Carlin
=============================================================================

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to