[ipxe-devel] Figuring out if system is (U)EFI or not

Robin Smidsrød robin at smidsrod.no
Sat Apr 6 08:57:29 UTC 2013

On 05.04.2013 22:34, James A. Peltier wrote:
> I've looked through the documentation but I can't seem to find out
> if there is a way to determine if the system is (U)EFI or not in a
> way similar to getting the cpuid value.  Is there such a thing?
> If so how would I go about accomplishing this?  Pointing me to docs is

The BIOS and UEFI platforms are wildly different, so a binary that works
in one would not work in another. In terms of figuring out which iPXE
binary to use on a system, that is something you'd have to figure out
during DHCP/TFTP discovery.

I was looking for an example I know I saw not a long time ago, but I
couldn't find it. Instead I found this not from Jarrod Johnson here on
the mailing-list.

"the client-architecture will be '7' for uefi, '0' for x86"

Doing a conditional in ISC dhcpd shouldn't be too hard.

If you're looking into figuring out what the platform is during runtime
(like in an iPXE script, considering the caveats still for the UEFI
platform) you'd have to look at the iPXE feature flags as mentioned on

The one you're interested in is this one:

option ipxe.efi code 36 = unsigned integer 8;

I'm not exactly sure how you can use the command "isset" to verify that
it is set, but I'm sure someone more knowledgeable will chime in.

Do make sure you read http://ipxe.org/efi/vision to be aware of some of
the (current) challenges with the iPXE UEFI implementation. Also make
sure you look at the commits of the recent weeks, as EFI support has
improved a lot recently.

-- Robin

More information about the ipxe-devel mailing list