Search Knowledge

© 2026 LIBREUNI PROJECT

Operating Systems Internals / System Initialization & Booting

The Hardware Handshake: BIOS vs. UEFI

The Hardware Handshake: BIOS vs. UEFI

Before an operating system can manage memory or schedule processes, it must be brought into existence by the hardware. This process, known as booting (short for bootstrapping), is the sequence of events that occurs from the moment you press the power button until the kernel takes control.

1. The Power-On Self-Test (POST)

When power is applied, the CPU is “reset” to a fixed execution state. On x86 systems, it begins in Real Mode (16-bit) and jumps to a specific memory address (usually 0xFFFFFFF0, the “reset vector”) where the firmware resides.

The firmware—either a Legacy BIOS or a modern UEFI—first performs the POST. This verifies that the hardware is functional: it checks the CPU, initializes the memory controller (RAM), and detects storage devices.

2. Legacy BIOS and the MBR

For decades, the BIOS (Basic Input/Output System) was the standard. It is limited by its 16-bit origins.

The Master Boot Record (MBR)

The BIOS looks at the first 512 bytes of the bootable disk. This sector is the MBR.

  • Bootstrap Code (446 bytes): Tiny machine code that knows how to find the rest of the OS.
  • Partition Table (64 bytes): Defines up to 4 primary partitions.
  • Boot Signature (2 bytes): The hex value 0x55AA. If this is missing, the BIOS won’t boot the disk.

BIOS Limitations

  1. 16-bit Real Mode: Access to only 1MB of RAM initially.
  2. 2TB Limit: MBR partitioning cannot address disks larger than 2TB.
  3. Interrupt Reliance: Relies on slow, ancient software interrupts (like INT 0x13 for disk I/O).

3. The Modern Standard: UEFI

The UEFI (Unified Extensible Firmware Interface) replaced BIOS to address these limitations. It is essentially a miniature operating system itself.

Key Advantages of UEFI

  • Mode Transition: Runs in 32-bit or 64-bit mode immediately, allowing access to all system memory.
  • GPT (GUID Partition Table): Supports disks up to 9.4 Zettabytes and up to 128 partitions by default.
  • EFI System Partition (ESP): Instead of hiding code in a “magic” sector (MBR), UEFI looks for a FAT32 partition containing .efi executable files.
  • Secure Boot: Uses digital signatures to ensure only trusted code (like a signed Linux or Windows bootloader) is executed.
Power OnPOSTFirmware Type?Legacy BIOSUEFIRead MBR (Sector 0) «BIOS»Execute 446 bytes of code«BIOS»Jump to Bootloader Stage 1«BIOS»Initialize Hardware Drivers«UEFI»Mount ESP (FAT32 Partition)«UEFI»Load and Execute .efi Bootloader«UEFI»Bootloader Takes Control

MBR vs. GPT Comparison

FeatureMBR (BIOS)GPT (UEFI)
Max Disk Size2 TB9.4 ZB
Max Partitions4 Primary128 (Default)
RedundancyNone (Single sector)Header and Table Backups
Execution Mode16-bit Real Mode32/64-bit Protected Mode

Interactive Exercise: The Magic Number

In the world of Legacy BIOS, how does the firmware know that a disk is actually bootable?

Interactive Lab

The Boot Signature

/* The last two bytes of a bootable MBR must be */\n0x

Whether you are using a 30-year-old server or a brand-new laptop, understanding this initial handshake is the first step in “operating” the system. In the next lesson, we’ll see how the Bootloader bridges the gap between this firmware and the Operating System kernel.

Previous Module File Systems