What do BIOS and UEFI do when your PC starts?

The short answer

BIOS and UEFI are names for the first program your PC runs: firmware on a flash chip on the motherboard that wakes up the hardware, picks a loader, and hands control to Windows.

Animated diagram: What do BIOS and UEFI do when your PC starts?

BIOS vs UEFI

BIOS (Basic Input/Output System) and UEFI (Unified Extensible Firmware Interface) are both names for the first program your PC (personal computer) runs. That program is firmware. It’s stored on a flash chip on the motherboard, not on your disk. BIOS is the old version.

UEFI replaced it. Its forerunner, EFI (Extensible Firmware Interface), was handed to the UEFI Forum in July 2005. Windows 11 requires UEFI, with one exception: Windows 11 IoT (Internet of Things) Enterprise 24H2 and later. UEFI also adds Secure Boot, a check that decides which boot code your PC is allowed to run.

What UEFI actually does

When you press power, the firmware runs in phases. The first ones, SEC (Security) and PEI (Pre-EFI Initialization), wake up your RAM (random access memory). The DXE (Driver Execution Environment) phase loads drivers for the chipset, storage, USB (Universal Serial Bus) and graphics. In the BDS (Boot Device Selection) phase, the firmware reads a boot list called BootOrder and its Boot#### entries. These are variables in firmware NVRAM (non-volatile memory), not on the disk.

Each entry points to a loader file on the EFI System Partition. That’s a small FAT32 (File Allocation Table 32) partition of at least 200 MB (megabytes), or 300 MB on 4K-native drives. If no entry works, the firmware falls back to \EFI\BOOT\BOOTX64.EFI. The loader then calls ExitBootServices(). Boot services end, only runtime services remain, and Windows takes control. An old BIOS just loaded the disk’s first 512-byte sector, the MBR (master boot record), to address 0x7C00. Some checked for a 0x55 0xAA marker, but nothing was signed.

How Secure Boot checks the loader

  1. It checks before running. The firmware checks the loader’s signature first. The loader only runs if that check passes.
  2. db lists allowed signers. The db list holds the signers your PC trusts. A loader signed by one of them can run.
  3. dbx lists revoked signers. The dbx list holds what is no longer trusted. If something appears in both lists, dbx wins.
  4. KEK and PK guard changes. Updates to db and dbx must be signed with a KEK (Key Exchange Key). The PK (Platform Key) signs KEK updates or turns Secure Boot off.

The result is that only trusted, non-revoked boot code from the disk gets to start Windows. That’s why these lists get certificate updates, most often through Windows Update.

Secure Boot is not firmware protection

Many people assume Secure Boot or a fresh install keeps a PC clean. LoJax showed otherwise. ESET disclosed it on September 27, 2018, and called it the first UEFI rootkit found in the wild. This spy malware, used by the Sednit group, also known as APT28, was written into the SPI (Serial Peripheral Interface) flash chip. It needed admin rights, through a driver called RwDrv.sys. It also needed flash write protection that was vulnerable or misconfigured, or a bug in an older chipset. Because it lived in the chip, it survived reinstalling Windows and even a new hard drive. Secure Boot didn’t stop it. Secure Boot checks components from outside the flash chip, and LoJax lived inside.

What to do

  • Open Windows Security, go to Device security, then Secure Boot, and look for “Secure Boot is on and all required certificate updates have been applied.”
  • If it says your device is using an older boot trust configuration, run Windows Update and restart.
  • If Windows Update doesn’t finish the job, check your PC maker for a firmware update, since some devices need one from the OEM (original equipment manufacturer).
  • Keep your firmware updated, because it decides what your PC trusts before Windows starts.

#uefi#bios#secureboot#firmware#lojax#windows11#cybersecurity#infosec#pcsecurity

Watch it in 60 seconds