6. How an OS Boots Up?

Tanish KumarTanish Kumar
3 min read

1. Overview

When you press the power button:

  • 5 Key Steps occur to load the OS from hardware to GUI.

  • Goal: Transition from BIOS/UEFIBootloaderOS Kernel.


2. Step-by-Step Boot Process

Step 1: Power On

  • What Happens?

    • Electricity flows to power supply unit (PSU) → Distributes power to motherboard, CPU, storage.
  • Analogy: Turning on a car’s ignition → Engine (CPU) gets power.


Step 2: CPU Loads BIOS/UEFI

  • BIOS (Basic Input/Output System) / UEFI (Unified Extensible Firmware Interface):

    • Small program stored in ROM chip on motherboard.

    • UEFI = Modern BIOS (supports LAN, faster boot).

  • CPU Action:

    • Fetches BIOS/UEFI instructions from ROM.

Key Term:

  • Non-Volatile Memory: BIOS persists even when power is off (unlike RAM).

Step 3: POST & Hardware Initialization

  • POST (Power-On Self-Test):

    • BIOS checks hardware (RAM, GPU, HDD) for errors.

    • Example: Beeps if RAM is missing.

  • CMOS Battery:

    • Preserves BIOS settings (time, boot order) via a small battery.

Fun Fact: Remove CMOS battery → BIOS resets to default!


Step 4: Locate Boot Device

  • Boot Device: Storage with OS (HDD, SSD, USB).

  • BIOS Searches For:

    1. MBR (Master Boot Record): Old method (sector 0 of disk).

    2. EFI Partition: Used by UEFI (separate partition for boot files).

  • Handoff: BIOS passes control to bootloader.

Why UEFI?:

  • Supports disks >2TB (MBR limitation).

  • Faster boot (no sector 0 scanning).


Step 5: Bootloader Loads OS

  • Bootloader’s Job:

    • Loads OS kernel into RAM.

    • Examples:

      • Windows: bootmgr.exe

      • Linux: GRUB

      • macOS: boot.efi

  • Final Step:

    • Kernel initializes GUI, drivers, and user apps.

Analogy:

  • BIOS = Construction crew (prepares site).

  • Bootloader = Foreman (starts building).

  • Kernel = Architect (manages the OS).


3. Key Components Explained

TermPurposeExample
BIOS/UEFILow-level hardware check & init.Sets boot order (USB → SSD).
MBRLegacy boot sector (512 bytes).Used in Windows XP.
EFIModern boot partition (UEFI).Used in Windows 10+, Linux.
BootloaderLoads OS kernel.GRUB (Linux), bootmgr (Windows).

4. Why This Matters?

  1. Troubleshooting:

    • No beep during POST? → Hardware issue (e.g., RAM failure).
  2. Dual Booting:

    • Bootloader (e.g., GRUB) lets you choose between OSes.
  3. Security:

    • UEFI supports Secure Boot (blocks malware).

5. Interview Questions

  1. Difference between BIOS and UEFI?

    • BIOS uses MBR; UEFI uses EFI partition + supports Secure Boot.
  2. What is POST?

    • Hardware diagnostic test run by BIOS.
  3. Role of the bootloader?

    • Loads OS kernel into memory from disk.

6. Homework

  1. Check Your System:

    • Windows: Run msinfo32 → Check "BIOS Mode" (Legacy/UEFI).

    • Linux: Run ls /sys/firmware/efi (if folder exists → UEFI).

  2. Explore GRUB:

    • On Linux, edit /etc/default/grub to customize boot options.

Visual Summary

Power On → BIOS/UEFI → POST → Boot Device → Bootloader → OS Kernel → GUI

Key Takeaways:

  1. BIOS/UEFI = Hardware checker.

  2. Bootloader = OS loader (GRUB, bootmgr).

  3. UEFI > BIOS (faster, secure, supports large disks).

0
Subscribe to my newsletter

Read articles from Tanish Kumar directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Tanish Kumar
Tanish Kumar