OS Notes
Complete explanation of computer booting — from power-on to login screen, covering BIOS/UEFI, POST, bootloader (GRUB), kernel loading, init/systemd, and troubleshooting boot failures.
Introduction
Every time you press the power button on your computer, a carefully orchestrated sequence of events transforms a lifeless machine into a fully operational system. This sequence — the boot process — takes your computer from having no software running at all to presenting you with a login screen, ready for use. Understanding booting is essential because it reveals how hardware and software cooperate from the very first moment.
The word "boot" comes from "bootstrapping" — the idea of pulling yourself up by your own bootstraps. A computer with no OS loaded cannot run programs, but loading the OS IS a program. The boot process solves this chicken-and-egg problem through a chain of increasingly capable programs, each loading the next.
Boot Process Overview
Stage 1: Power-On and Reset Vector
When you press the power button, the power supply stabilizes and sends a "power good" signal to the motherboard. The CPU begins executing instructions from a hardwired address called the reset vector — typically 0xFFFFFFF0 on x86 systems. This address points to the BIOS/UEFI firmware stored in ROM or flash memory on the motherboard.
Stage 2: BIOS/UEFI Firmware
BIOS (Basic Input/Output System) — Legacy
The traditional firmware. It runs in 16-bit real mode, has a 1 MB address space limitation, and uses the Master Boot Record (MBR) partitioning scheme. Being phased out since ~2010.
UEFI (Unified Extensible Firmware Interface) — Modern
The replacement for BIOS. Runs in 32/64-bit mode, supports drives larger than 2 TB (GPT partitioning), has a graphical interface, supports Secure Boot, and can load bootloaders directly from a special EFI System Partition.
Stage 3: POST (Power-On Self-Test)
The firmware performs hardware diagnostics:
- Test RAM (memory check)
- Verify CPU functionality
- Check connected devices (keyboard, display, storage)
- Initialize hardware (set up interrupt controllers, DMA)
- Detect and enumerate PCI devices
If POST fails (bad RAM, missing CPU fan), the system halts with beep codes or error messages. Different beep patterns indicate different failures — one long beep might mean RAM failure, continuous beeps might mean no video card.
Stage 4: Bootloader
After POST, the firmware loads the bootloader — a small program whose job is to find and load the operating system kernel.
GRUB (GRand Unified Bootloader) — Linux
GRUB is the most common bootloader for Linux. It presents a menu allowing you to choose between multiple installed operating systems or kernel versions.
Windows Boot Manager
On Windows, the bootloader (bootmgfw.efi on UEFI systems) reads the BCD (Boot Configuration Data), loads winload.efi, which then loads the Windows kernel (ntoskrnl.exe).
Stage 5: Kernel Loading and Initialization
Once the bootloader loads the kernel into memory and jumps to it, the kernel takes over:
- Decompress itself (kernel is typically compressed)
- Set up memory management — initialize page tables, enable virtual memory
- Detect and initialize hardware — using device drivers
- Mount the root file system — make the disk accessible
- Start the first user-space process — PID 1 (init or systemd)
// Simplified kernel boot sequence (Linux)
void start_kernel(void) {
setup_arch(); // Architecture-specific setup
mm_init(); // Memory management init
sched_init(); // Scheduler init
init_IRQ(); // Interrupt setup
time_init(); // System clock
console_init(); // Console for messages
// Mount root filesystem
mount_root();
// Start PID 1
run_init_process("/sbin/init");
}Stage 6: Init System (systemd/init)
The first user-space process (PID 1) is the ancestor of all other processes. Its job is to bring the system to a usable state by starting services:
Traditional SysV Init
Reads /etc/inittab, executes startup scripts in /etc/rc.d/ sequentially. Runlevels (0-6) define which services run.
systemd (Modern Linux)
Starts services in parallel for faster boot. Uses unit files instead of scripts. Manages dependencies automatically.
# Check boot time breakdown
$ systemd-analyze
Startup finished in 2.1s (firmware) + 1.8s (loader) + 3.2s (kernel) + 5.4s (userspace) = 12.5s
# See which services took longest
$ systemd-analyze blame
2.3s NetworkManager.service
1.8s docker.service
1.2s systemd-journal-flush.serviceStage 7: Login Prompt
Finally, a login manager (getty for text, GDM/SDDM for graphical) is started. The user can now log in, and the system is fully operational.
Real-World Analogy
The boot process is like opening a restaurant in the morning. Power-on is unlocking the front door. POST is checking that all equipment works (ovens heat, fridge is cold, lights turn on). The bootloader is the manager arriving and reading the day's plan. Kernel loading is turning on all systems and setting up the kitchen. Init/systemd is the staff arriving and taking their positions. The login screen is the "Open" sign being flipped — ready for customers.
Key Takeaways
- Booting is a chain of programs, each loading and launching the next
- The CPU starts at a fixed address (reset vector) pointing to firmware (BIOS/UEFI)
- POST verifies hardware functionality before attempting to load an OS
- The bootloader (GRUB, Windows Boot Manager) finds and loads the kernel
- The kernel initializes hardware, memory management, and starts PID 1
- systemd (modern) starts services in parallel; SysV init starts them sequentially
- Understanding the boot process helps diagnose startup failures at each stage
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for The Booting Process.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Operating Systems topic.
Search Terms
operating-systems, operating systems, operating, systems, system, basics, booting, process
Related Operating Systems Topics