How booting works (BIOS, UEFI)
From the press of the power button to the login screen: how a computer with blank memory finds, loads and starts its own operating system, one small program at a time.
In 30 seconds
A computer starts with empty memory, so it boots in stages, each one loading the next.
First comes firmware stored in a chip on the motherboard (BIOS on older machines, UEFI today). It tests the hardware, then looks through its boot order for a bootloader.
The bootloader loads the kernel, the core of the operating system, which starts everything else.
UEFI can also verify digital signatures at each handover. That is Secure Boot: code that has been tampered with is refused.
How booting works (BIOS, UEFI), step by step
Simplified: real systems add stages (an early RAM disk, a signed “shim” on many Linux installs), and the details differ on phones and Macs. The outline is the same.
- Step 1: Power on: firmware first. When power arrives, RAM is blank and the operating system is still just files on a disk. So the processor is built to begin at one fixed address, the reset vector, which leads into a chip on the motherboard that keeps its contents without power. The program stored there is the firmware: BIOS or UEFI.
- Step 2: Self-test (POST). The firmware first checks that the machine is fit to start: it sets up the processor, finds and tests the memory, and wakes the graphics, keyboard and storage. This is the power-on self-test. If something vital fails, the boot stops here, often with a pattern of beeps or a blinking light.
- Step 3: Find a boot device. The firmware cannot start an operating system itself. It keeps a boot order, a list of places to look for a small starter program called the bootloader, and tries them in turn. Here no USB stick is plugged in, so it moves on to the internal disk and finds one.
- Step 4: Run the bootloader. The firmware copies the bootloader into RAM and jumps to it, so the processor is now running code that came from the disk. GRUB on Linux and Windows Boot Manager are bootloaders. A bootloader knows how to read the disk’s file system and may show a menu of systems to start.
- Step 5: Load the kernel. The bootloader finds the kernel, the core of the operating system, copies it into RAM and jumps to it. The kernel takes over the hardware through its drivers, opens the main file system and starts the first process. That process starts everything else, ending at the login screen.
- Step 6: BIOS vs UEFI. The two kinds of firmware find the bootloader differently. BIOS, from the 1981 IBM PC, blindly runs the first 512-byte sector of the disk. UEFI, its replacement on modern PCs, understands partitions and files: it loads a bootloader file from a small dedicated partition, handles far larger disks and can check signatures.
- Step 7: Secure Boot. With Secure Boot switched on, UEFI firmware holds a list of trusted public keys. Before running a bootloader it checks the file’s digital signature against them, and the bootloader checks the kernel in the same way. Code that has been altered, say by malware that wants to start before the system, fails the check and is not run.
Try it yourself
Learn this first
Nothing. This concept starts from scratch.
Learn next
- ProcessesA running program: its own memory, its state and its ID. Beginner
- Device driversThe translator that lets an operating system talk to each piece of hardware. Beginner
- Digital certificates and certificate authoritiesHow a signed file and a chain of authorities tie a public key to a name. Intermediate
Spotted a mistake on this page?