EFIBootLoaders

EFI/UEFI Boot Loaders

UEFI defines a new method of interfacing between PC operating systems and firmware. The UEFI interface is composed of data tables containing platform-related information, plus boot and runtime functions that are available to the operating system and the boot loader. These provide a standard environment for booting and running pre-boot applications.

The table following lists known features found in current EFI/UEFI capable boot loaders and boot managers. (Note: Boot managers present a menu of boot options, whereas boot loaders load a kernel. Many programs can do both tasks, although rEFIt can load a kernel on PC hardware only if it includes an EFI stub loader.)

Key: Yes - feature known to exist, ? - indeterminate feature presence, No - feature does not exist

Features

EFI/UEFI Bootloaders

EFI/UEFI Boot Managers

BIOS Bootloader

ELILO

GRUB 2

Kernel stub loader

rEFIt

rEFInd

systemd-boot

GRUB 0.97

Oldest/most stable Linux EFI bootloader, very limited features

Most complex Linux EFI bootloader available, actively developed

Linux kernels since v3.3.0 are bootable via system firmware; no bootloader needed

EFI graphical boot manager, development stopped in 2010

EFI graphical boot manager with OS auto-detection, semi-active development

EFI text-menu boot manager with modern features but very simple interface, actively developed

No EFI/UEFI support; for comparison only

Graphical interface mode

No

Yes

No

Yes

Yes

No

Background imgs only

Mouse support

No

No

No

No

Yes

No

No

Text menu interface mode

Yes

Yes

No

Yes

Yes

Yes

Yes

File-based configuration

Yes

Yes

No

Yes

Yes

Yes

Yes

select from multiple kernels

Yes

Yes

No

Yes

Yes

Yes

Yes

interactive mode

Yes

Yes

No

No

Yes

Yes

Yes

load initrd

Yes

Yes

Yes

Yes

Yes

Yes

Yes

kernel selector menu

Yes

Yes

No

Yes

Yes

Yes

Yes

kernel boot params

Yes

Yes

Yes

?

Yes

Yes

Yes

Boot old kernel if upgrade fails

Yes

Yes

No

No

Yes

Yes

Yes

Paramaterize kernel cmdline opts1

Yes

No

No

No

Yes

No

No

Enable legacy BIOS

?

?

No

Yes

Yes

No

BIOS ONLY

Chain loading

No

Yes

No

Yes

Yes

Yes

Yes

Gzip compression support

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Load ELF binaries

Yes

Yes

No

Yes

Yes

Yes

Yes

Apple fat image

?

?

?

Yes

?

?

?

Boot unmodified linux kernel

Yes

Yes

Yes

?

Yes

Yes

Yes

Relocate Kernel

No

Yes

No

No

Yes

Yes

Yes

IA-64 modified kernel

Load FPSWA driver2

Yes (IA-64 only)

?

?

?

?

?

N/A

Custom font support

Yes

Yes

No

Yes

Yes

No

?

Architecture Support:

x86-64

Yes

Yes

Yes

Yes

Yes

?

Yes

x86-32

Yes

Yes

Yes

Yes

Yes

?

Yes

IA-64

Yes

?

Yes

?

File System Support:3

AFFS

Yes

AFS

Yes

Btrfs

Yes

Yes

CPIO

Yes

FAT

Yes

Yes

Yes

Yes

Yes

Yes

Yes

EXT2

Yes

Yes

Yes

Yes

Yes

Yes

Yes

EXT3

Yes

Yes

Yes

Yes

Yes

Yes

Yes

EXT4

Yes

Yes

Yes

Yes (Jaunty+)

FFS

Yes

Yes

HFS

Yes

HFS+

Yes

Yes

Yes

Yes

Yes

ISO9660

Yes

Yes

Yes

Yes

Yes

Yes

JFS

Yes

Yes

MINIX

Yes

Yes

NTFS

Yes

NTFSCOMP

Yes

ReiserFS

Yes

Yes

Yes

Yes

Yes

Yes

Yes

SFS (Amiga)

Yes

UDF

Yes

UFS

Yes

Yes

XFS

Yes

Yes

Disk Volume/Partition Support:

RAID

Yes

Yes

LVM

Yes

Yes

ADFS (Acorn partition maps)

Yes

Amiga partition tables

Yes

Macintosh partition tables

Yes

Master Boot Record (MBR) tables

Yes

Yes

Yes

Yes

Yes

Sun partition tables

Yes

GPT (GUID partition tables)

Yes

Yes

Yes

Yes

Yes

Yes

No

Disk loopback

Yes

Filesystems by UUID/Label

Yes

Yes (Intrepid+)

Image File Format Support:

JPG images

No

Yes

No

?

Yes

No

No

BMP images

No

No

No

Yes

Yes

No

No

PNG images

No

Yes

No

No

Yes

No

No

XPM images

No

?

No

No

No

No

Yes

ICNS images

No

?

No

Yes

Yes

No

?

Command Line Operations

background

Yes

beep (PC speaker)

Yes

print file block list

Yes

Yes

set border color

Yes

read text file contents

Yes

Yes

Yes

clear screen

Yes

compare files

Yes

Yes

identify CPU

Yes

debug mode

Yes

Yes

display APM BIOS info

N/A

N/A

N/A

N/A

Yes

display RAM info

Yes

dump file (copy)

Yes

echo / print

Yes

Yes

fallback to known good kernel

Yes

Yes

Yes

find filename on partition

Yes

filesystem test mode

Yes

Yes

Yes

help

Yes

Yes

Yes

Yes

display disk geometry

Yes

manually load config. file

Yes

halt machine

Yes

Yes

Yes

Yes

hide partition

Yes

Yes

file hexdump

Yes

intel multiprocessor probe

Yes

disk I/O port probe

Yes

load/save env. variables

Yes

Yes

Yes

show directory contents

Yes

Yes

Yes

probe PCI bus

Yes

set partition boot flag

Yes

map one drive to another

Y

screen pager

Y

partition manipulation

Y

pause/sleep

Y

Y

read variables from user input

Y

read memory address

Y

reboot computer

Y

Y

Y

select terminal

Y

serial console support

Y

set keyboard mappings

Y

expression handling

Y

video testing

Y

list vbe modes

Y

Y

vbe test

Y

load font files

Y

block users from using EFI shell

Y

Y

disable booting from optical drive

Y

Y

disable booting from internal drives

Y

Y

block apple HW testing

Y

Y

Toolchain Contraints

IA-64: gcc version

3.1, 3.2

?

?

?

?

?

IA-64: binutils

2.13.90

?

?

?

?

?

x86-32: gcc-version

3.2

?

?

?

?

?

x86-32: binutils

2.13.90.0.2

?

?

?

?

?

x86-64: gcc-version

4.1.1+

?

?

?

?

?

x86-64: bintil

2.17.50.0.14+

?

?

?

?

?

Netboot Methods:

PXE

Y

DCHP

Y

Y

TFTP

Y

Y

BOOTP

Y

IFCONFIG

?

Y

RARP

Y


Footnotes:

  1. e.g. root=/dev/nfs ip=%I:%z:%G:%N, where the utility can generate the needed values based on information it can probe for (1)

  2. Floating Point Software Assist (2)

  3. Loading of kernel+initrd occurs using EFI firmware, hence only supports FAT16/32 (but if given 3rd-party EFI drivers can then read: ext2, ext3, ext4, ReiserFS, Btrfs, HFS+, or ISO-9660) (3)

Booting from EFI

All EFI compliant systems have an EFI System Partition (ESP), which is a FAT32 partition containing EFI firmware modules and boot images. Note that there can be one or more system partions. The ESP is effectively the boot partition, and contains the necessary images to boot a system. This boot partition should probably be mounted on a Linux system as /boot/efi for the updating of new kernels and initrd images.

Each vendor "must" use a dedicated directory in \EFI\vendor for the .efi bootloader code.

nshell is the EFI shell. It will execute the boot script called startup.nsh found in the root of an ESP. startup.nsh can be used to load and execute the preferred boot loader. More commonly, a list of boot loaders is maintained in NVRAM variables called Boot####, where #### is a hexadecimal number. The boot order is maintained in the BootOrder variable. These variables can be manipulated in Linux with the efibootmgr utility. If the NVRAM contains no such entries or if they're all invalid, recent EFI implementations default to using a boot loader of the form \EFI\BOOT\boot{arch}.efi, where {arch} is an architecture code, such as "x64" for x86-64 or "ia32" for x86.

All EFI executable images contain a PE/COFF header defining the format of the executable code. The code may be one of:

  • IA-32
  • x86-64 (aka X64)
  • Itaninum
  • ARM
  • Processor agnostic generic EFI byte code

ELILO, the kernel's EFI stub loader, Grub 2 (with EFI support), rEFIt, and rEFInd are all processor native executable code.

KERNEL configuration

Build the kernel with the following configuration.

    CONFIG_FB_EFI=y
    CONFIG_FRAMEBUFFER_CONSOLE=y

If EFI runtime services are expected, the following configuration should be selected.

    CONFIG_EFI=y
    CONFIG_EFI_VARS=y or m          # optional

To use the EFI stub loader, you must set the following option:

    CONFIG_EFI_STUB=y

The kernel can then be loaded from an EFI shell or by entering it into the EFI's boot list in NVRAM. Getting the options right can be tricky, though. Using rEFInd to launch a kernel with EFI stub support can simplify matters.

References

EFIBootLoaders (last edited 2021-05-21 00:57:44 by roguescholar)