Fireship
May 7, 2026
1. Stage 1: The Boot Loader
When the power button is pressed, firmware (UEFI or BIOS) wakes minimal hardware, locates the boot loader (Grub on Linux, IBO on Mac, Bootmgr on Windows), which loads the kernel into RAM and hands off control with full hardware privileges.
2. Stage 2: Privilege Rings
CPUs enforce multiple privilege levels (rings 0-3 on x86). Ring 0 allows kernels unrestricted hardware access, while ring 3 user space requires permission for sensitive operations, protecting programs from interfering with each other.
3. Stage 3: Virtual Memory
The MMU translates fake virtual addresses to real physical addresses using page tables. Each process gets its own page table, creating isolated memory spaces. The TLB caches recent translations, and page faults trigger disk access when needed memory isn't in RAM.
4. Stage 4: File Systems
File systems abstract disk blocks into organized files and folders. Index nodes store metadata and pointers to data blocks but not filenames; directories map filenames to inode numbers. Journaling writes intentions before data, preventing corruption during unexpected shutdowns.
5. Stage 5: Device Drivers and Interrupts
Drivers translate kernel requests into hardware-specific commands for GPUs, Wi-Fi, keyboards, etc. Interrupts are electrical signals that preempt CPU execution, allowing instant response to hardware events without continuous polling.
6. Stage 6: PID1 and Process Creation
The kernel creates PID1 (systemd on Linux), the first user space process and ancestor of all others. Process creation allocates memory, loads executables, sets up virtual address spaces, and adds entries to the process table.
7. Stage 7: System Calls
System calls are the secure API between user applications and kernel operations. They require privilege escalation from ring 3 to ring 0. Linux has ~400 system calls; critical ones include fork and exec for process creation.
8. Stage 8: Process Scheduling
The scheduler manages multiple processes on limited CPU cores by fairly distributing CPU time. Modern Linux uses earliest eligible virtual deadline first (EEVDF) algorithm to ensure each process gets fair access.
9. Stage 9: Threads
Threads share memory and file descriptors but have separate stacks and program counters, allowing single programs to do multiple things simultaneously. Shared memory introduces race condition risks; languages like Go and Rust provide safeguards.
10. Stage 10: Interprocess Communication and Shutdown
Pipes, sockets, and message queues allow safe communication between separate processes. On shutdown, SIGTERM requests graceful process termination, followed by SIGKILL if needed, then file system flushing, driver cleanup, and CPU halt.