LinuxIX · Boot ProcessPre-boot
Firmware, UEFI, and BIOS
What you'll learn
- Explain the difference between BIOS and UEFI
- Identify the firmware layer in the boot sequence
- Configure UEFI Secure Boot
- Recognise when firmware issues affect Linux boot
Prerequisites
None — start here.
Verified against Ubuntu 24.04 LTS · Debian 12 (Bookworm) · RHEL 9.x · Rocky Linux 9.x · AlmaLinux 9.x · Linux kernel 6.1 LTS / 6.6 LTS · systemd 255+ · OpenSSH 8.7p1 (RHEL 9) / 9.6p1 (Ubuntu 24.04) · nftables 1.0.x · chrony 4.x · Pacemaker 2.1.x · Corosync 3.1.x · 2026-08-09
The firmware is the first code that runs when a host powers on. It initialises the hardware, then hands control to the bootloader, which then loads the kernel. The firmware is also the layer that hosts UEFI Secure Boot, the TPM, and the out-of-band management interface.
BIOS vs UEFI
| Trait | Legacy BIOS | UEFI |
|---|---|---|
| Boot mode | 16-bit real mode, 1 MB address limit | 32/64-bit protected mode, no practical memory limit |
| Disk partitioning | MBR (4 primary partitions, 2 TB disk limit) | GPT (128 partitions, 8 ZB disk limit) |
| Bootloader location | First sector of disk (MBR) | EFI System Partition (ESP), FAT32 filesystem |
| Configuration | CMOS setup | UEFI variables (efivar -l) |
| Secure Boot | Not supported | Supported |
| Network boot | PXE | PXE + HTTP boot |
$ ls /sys/firmware/efi/ 2>/dev/null && echo UEFI || echo BIOSconfig_table efivars esrt fw_platform_size mok-variables runtime runtime-map systab
UEFIIllustrative output
UEFI Secure Boot
Secure Boot is a UEFI feature where the firmware verifies the signature of every bootloader, kernel, and (in some configurations) initramfs. The chain of trust starts with manufacturer-baked keys.
flowchart LR
OEM[OEM Platform Key]
DB[Allowed Signatures DB]
MOK[Machine Owner Key]
SB[Secure Boot state]
OEM --> DB
OEM --> SB
MOK --> SB
DB --> SB
- PK (Platform Key): the manufacturer’s key. Used to sign the DB.
- DB (Allowed Signatures Database): the keys and hashes allowed to boot.
- MOK (Machine Owner Key): a key the owner can add to the DB without replacing the OEM keys. Used for custom kernels.
- DBX (Forbidden Signatures Database): explicit revocation list.
$ mokutil --sb-state; mokutil --list-enrolledSecureBoot enabled
[user key 1234abcd] /CN=My Signing KeyIllustrative output
What firmware does at power-on
sequenceDiagram
participant Power as Power On
participant FW as Firmware (UEFI)
participant BL as Bootloader (GRUB)
participant K as Kernel
participant I as initramfs
Power->>FW: power-on reset
FW->>FW: POST (memory, devices)
FW->>FW: enumerate boot entries
FW->>BL: load EFI binary
BL->>K: load vmlinuz
BL->>I: load initramfs
K->>K: decompress, initialise
K->>I: mount / as tmpfs
I->>I: load drivers, mount rootfs
I->>FW: hand off (PID 1 = systemd)
The firmware’s responsibilities:
- POST (power-on self test): memory check, device probe.
- Initialise CPU cores, memory controller, basic peripherals.
- Enumerate boot devices and boot entries.
- Load the configured bootloader binary from the ESP.
- Transfer control.
The firmware’s time is typically 1-3 seconds on modern hardware; longer firmware delays indicate problems (memory training, failed peripherals).
Reading UEFI variables
$ efivar -l | head -20Boot0000: HD(1,GPT,...)/File(\\EFI\\ubuntu\\shimx64.efi)
BootOrder: 0000,0001,0002
Boot0001: Network Boot
Boot0002: USB
...Illustrative output
Knowledge check
Knowledge check · 3 questions
Q1. How can you tell if a host booted in UEFI mode?
Q2. An out-of-tree kernel module can be used with Secure Boot left enabled by enrolling its signing key as a MOK.
Q3. Which of the following are correct firmware practices? Select all that apply.
Passing score: 75%. Answers are checked in this browser.