Between the moment you press the power button and your desktop appears there is no magic: there is a chain of checks in which every link distrusts the next one before letting it carry on. That ritual is called the boot chain, and in modern systems it is built on asymmetric cryptography and a process known as measured boot. This article breaks down the whole sequence: firmware, bootloader, kernel, and how a chip that costs pennies decides, at every step, whether what you are about to run can be trusted.
The first link: firmware and UEFI
None of this would work without a program that runs before any operating system. That is the firmware — the code burned onto the motherboard — and on modern machines we are talking about UEFI (Unified Extensible Firmware Interface), the successor to the old BIOS. UEFI is not a simple booter: it is a small operating system of its own, with its own partition table (GPT), drivers for disk and network, and its own executable format, PE, the same one used by Windows binaries.
On power-up, the firmware performs the POST (initializes memory and peripherals) and then decides what to boot: it looks on the EFI partitions of the disk for the .efi executables. But before running anything it checks one more thing: the signature.
Secure Boot: who signs what
The key step is Secure Boot, a UEFI specification that prevents unsigned code from running. The firmware keeps three databases in non-volatile memory: the PK (platform key), the KEK (key exchange keys) and the DB (database of allowed signatures). The logic is hierarchical: the PK grants authority over the KEK, and the KEK authorizes updates to the DB, where the hashes or public keys of the binaries the manufacturer allows to run are registered.
The result is a chain of trust: each component verifies the signature of the next one before handing over control. The firmware checks the signature of the bootloader (or of an intermediate shim) and only runs it if it is valid. If someone modifies the disk or installs a rootkit right at boot time, the signature stops matching and the machine refuses to start. It is the exact opposite of the blind trust of the old BIOS.
Measured boot: it is not only WHO, but WHAT
Verifying the signature proves the binary comes from a legitimate vendor, but not that it has not been tampered with along the way. That is what measured boot is for: before running each link, the firmware computes its hash (a digital fingerprint) and records it in the TPM chip (Trusted Platform Module). The TPM chains the measurement of each stage to the previous one in its PCR registers (Platform Configuration Registers), so the accumulated value reflects the exact state of the chain: if a single byte changes in any stage, the PCRs change.
The clever part is that the TPM uses those PCRs to seal secrets: an encryption key on disk (the one that decrypts your partition with BitLocker or LUKS) is only released if the PCRs match the expected values. So even if someone steals the disk, without the TPM in its correct state they cannot decrypt it. It is not that the chip hides the password: it is that the key only exists under the exact conditions recorded by the measurement.
From bootloader to kernel, and on to systemd
With the signature verified, UEFI launches the bootloader: on Linux it is usually GRUB (or systemd-boot on simpler machines), and consumer systems with Microsoft sometimes need to go through a shim signed by Microsoft, which in turn knows how to sign the distribution’s keys. The bootloader locates the kernel, hands it the parameters it needs (which root partition to mount, which initramfs options) and hands over control.
The kernel (the core of the system) continues the chain: it mounts the root filesystem, initializes the drivers and launches the first process with PID 1, which in practically every modern distro is systemd. systemd is not a simple daemon: it is the supervisor that starts all services in parallel, manages their dependencies and replaces the old SysV init. From that point on the system no longer “verifies” so much as “executes”, but the barrier has already been safely crossed.
How a boot is exploited, and how to protect it
The catch is that a chain is only as strong as its weakest link. An outdated firmware with a vulnerability, an unsigned bootloader or a TPM disabled in the BIOS leave gaps that bootkits exploit: malware that installs itself before the operating system, so that it runs on every boot and is invisible from inside the OS itself. Practical defense is not a single measure but the sum of them: keep the firmware up to date, have Secure Boot enabled, use the TPM for disk encryption, and pick a firmware PIN different from the one used to log in.
There is also a further twist underway: measured boot with remote attestation, in which an external service checks the machine’s PCRs before granting it access to a corporate network. It is the same idea as the boot chain, but amplified to the whole world: we do not trust what the machine claims to be, but the state that its own boot chain was able to measure and attest.
Distrust by design
Next time you “just turn the machine on”, remember you have witnessed a silent cryptographic negotiation: firmware validates bootloader, bootloader validates kernel, and a chip measures each signature to decide whether the disk unlocks. The modern boot sequence is, at its core, an exercise in rigorous, default-on distrust. And that paranoia, properly applied, is exactly what keeps your system safe from the very first executed kilobyte.





