Skip to content
Libre Computer
Platform

Module 7 ยท Lab 5

UEFI

In lab 4 you booted a kernel by giving U-Boot exact files and addresses. UEFI replaces that board-specific knowledge with a standard interface, so a generic distribution image boots the same way on a single-board computer as on a PC.

Where this stage sits

The boot chain: each stage loads the nextBoot ROMfixed in the chipmodule 3First stageclocks, consolemodule 4Memory bring-uptimings, trainingmodule 5Secure monitorTF-A, stays residentmodule 6U-Bootstorage, USB, networkmodule 6UEFIstandard interfacemodule 7Linux kerneldrivers, rootmodule 8initsystemd, servicesmodule 8runs from On-chip ROMruns from On-chip SRAMruns from DRAMPower and reset come first (module 2); I/O, drivers and your project run on the finished system (modules 9 to 12).
Where this module sits in the boot chain.

Key ideas

  • UEFI is a specification for the interface between firmware and an operating system: services to read storage, allocate memory and keep boot settings, plus a few services that stay available after the OS starts.
  • U-Boot implements UEFI. Both course boards keep a UEFI bootloader in their SPI flash, so the boot media only has to carry the OS. On Das Frite, which has no card slot, this is how a stock distribution boots from a USB drive.
  • The OS's loader lives on the EFI system partition, a FAT filesystem. Firmware finds it through boot entries, or through the fallback path \EFI\BOOT\BOOTAA64.EFI on 64-bit Arm.
  • On Arm boards the firmware passes the device tree to the OS through UEFI as well, so the OS still learns the board's hardware.
  • The payoff: distributions ship one arm64 image for many boards, and the firmware, not the image, carries what is specific to the board.

On the bench

In short, what you do in lab 5, where the steps are given in full:

  1. Write a stock generic arm64 distribution image to a second USB drive or card and boot it through the bootloader in SPI flash.
  2. Inspect the EFI system partition and list the boot entries with efibootmgr -v.
  3. Compare the UEFI boot with the boot you did by hand in Lab 4: who chose each file and each address?

Resources

ResourceUse in this module
Debian 11 for Libre Computer boardsA generic distribution on the kit boards
Fedora for Libre Computer boardsAnother generic distribution
openSUSE for Libre Computer boardsAnother generic distribution
Board firmware update imagesUpdating the bootloader in SPI flash
La Frite: how to update board UEFI firmwareThe UEFI firmware update on Das Frite's predecessor
UEFI specificationsThe standard itself