Bootloader

In many desktop computers, for example, the bootstrapping process begins with the CPU executing software contained in ROM (for example, the BIOS of an IBM PC or an IBM PC compatible) at a predefined address (some CPUs, including the Intel x86 series, are designed to execute this software after reset without outside help).

This software contains rudimentary functionality to search for devices eligible to participate in booting, and load a small program from a special section (most commonly the boot sector) of the most promising device, typically starting at a fixed entry point such as the start of the sector.

Second-stage implementations can include interactive user interfaces, allowing boot option selection and parameter modification.

Its primary challenge lies in accomplishing these tasks within strict size constraints while handling potential hardware failures.

The bootloader must navigate disk structures, often implementing FAT file system support, and manage the delicate transition from the BIOS startup state to a stable environment for the next boot stage.

First-stage MBR boot loaders may face peculiar constraints, especially in size; for instance, on the earlier IBM PC and compatibles, a boot sector should typically work with 510 bytes of code (or less) and in only 32 KiB[4][5] (later relaxed to 64 KiB[6]) of system memory and only use instructions supported by the original 8088/8086 processors.

[8] When Microsoft added logical block addressing (LBA) and FAT32 support, they switched to a boot loader reaching over two physical sectors, using 386 instructions for size reasons.

At the same time, other vendors managed to squeeze much more functionality into a single boot sector without relaxing the original constraints on only minimal available memory (32 KiB) and processor support (8088/8086).

This expanded space allows implementation of complex features such as filesystem support, runtime configuration, and bootloader menu interfaces.

The second-stage boot loader does not need drivers for its own operation, but may instead use generic storage access methods provided by system firmware such as the BIOS, though typically with restricted hardware functionality and lower performance.

For example, waiting a minute for a digital television or a GPS navigation device to start is generally unacceptable.

GNU GRUB, a popular open source bootloader