Bootloader
- In Turkish
- önyükleyici
In short
A bootloader is a small program that runs after the computer's firmware starts, loads the operating system kernel into memory, and hands control over to it.
What is a bootloader?
When you power on a computer, the CPU cannot load a full operating system by itself. First the firmware built into the motherboard, UEFI on modern PCs or the legacy BIOS on older ones, checks and initializes the hardware. It then runs the bootloader, whose job is to find the operating system kernel on disk, load it into memory, and start it.
On UEFI systems, the firmware reads a small FAT-formatted partition called the EFI System Partition and runs a bootloader program stored there, such as GRUB, systemd-boot, or Windows Boot Manager. Older BIOS systems instead ran 512 bytes of code from the disk's master boot record, which then loaded a larger second stage. The bootloader may show a menu for choosing between operating systems or kernel versions, passes startup options to the kernel, and loads an initial RAM disk with the drivers needed to reach the root file system. With Secure Boot enabled, each step checks the digital signature of the next, so malware cannot slip itself into the boot chain.
A bootloader is like a stage manager before a play: the building's lights are already on, but someone has to bring the lead actor to the stage, hand over the script, and step aside. Phones, routers, and other embedded devices have bootloaders too, and unlocking the bootloader on an Android phone allows it to start an operating system the manufacturer didn't sign.
A bootloader is often confused with the firmware. The firmware lives in a chip on the motherboard and runs first, while the bootloader is stored on the disk and is part of the operating system installation. The bootloader is also not the kernel: its job ends the moment the kernel starts, after which the kernel and its first process, such as systemd on Linux, take over the rest of the startup.
Key takeaways
- The bootloader runs after the firmware and before the operating system kernel.
- It finds the kernel, loads it into memory, and passes it startup options.
- On UEFI systems it lives on the EFI System Partition.
- It can offer a menu to choose between operating systems or kernels.
- Secure Boot checks signatures so the boot chain can't be tampered with.
Example
# Show the kernel command line that the bootloader passed
cat /proc/cmdline
# Check whether the system booted with UEFI or legacy BIOS
[ -d /sys/firmware/efi ] && echo "UEFI" || echo "Legacy BIOS"
# List UEFI boot entries and the boot order
sudo efibootmgr -vReaders ask
What is the difference between a bootloader and BIOS or UEFI?
BIOS and UEFI are firmware stored on the motherboard that start the hardware and then launch the bootloader. The bootloader is software on the disk that loads the operating system kernel.
What is GRUB?
GRUB, the GRand Unified Bootloader, is the most common bootloader for Linux. It can boot several operating systems and lets you pick a kernel or edit boot options from a menu at startup.
What does unlocking the bootloader mean?
On phones and some other devices, the bootloader normally starts only operating systems signed by the manufacturer. Unlocking it removes that restriction so you can install a custom operating system, usually after the device erases its data for security.
See also
- KernelOperating Systems, p. 17A kernel is the core part of an operating system that manages the CPU, memory, and hardware devices and controls how programs get access to those resources.
- Device DriverOperating Systems, p. 9A device driver is software that lets the operating system control a specific piece of hardware, translating generic OS requests into device-specific commands.
- File SystemOperating Systems, p. 12A file system is the part of an operating system that organizes data on a storage device into files and folders and tracks where each piece is stored.
- ProcessOperating Systems, p. 23A process is a running instance of a program, with its own memory space, resources, and at least one thread of execution managed by the operating system.
- LinuxDevOps & Cloud, p. 33Linux is an open-source operating system kernel that powers most servers, cloud platforms, containers, and Android phones, usually packaged as a distribution.
- Digital SignatureSecurity, p. 11A digital signature is a cryptographic value made with a private key that proves who produced a message or file and that it hasn't changed since it was signed.
Spotted a mistake or something missing on this page?Suggest an edit