The complete chain from power ON → kernel loaded, with every step mentioned, but kept simple and short.
-
Power ON
- Electricity reaches motherboard, CPU resets
-
CPU reset state
- CPU enters real mode (16-bit)
- Registers set to fixed values
- Instruction pointer = 0xFFFF0
-
CPU fetches first instruction
- Address 0xFFFF0 maps to BIOS ROM
- CPU reads and executes BIOS code
-
BIOS starts running (from ROM)
- Tests CPU
- Initializes chipset
- Initializes RAM
- Initializes keyboard, disk, video
-
POST (Power-On Self Test)
- Checks memory, basic hardware
- Shows BIOS screen / beep if error
-
BIOS selects boot device
- Uses boot order (floppy / HDD)
- Finds a bootable disk
-
BIOS reads boot sector
- Reads first 512 bytes (sector 0)
- Loads it into RAM at 0x7C00
-
BIOS jumps to 0x7C00
- Control passes to bootloader
-
Bootloader starts (boot.s)
- Still 16-bit real mode
- Uses BIOS interrupts
-
Bootloader relocates itself
- Moves from 0x7C00 → 0x90000
-
Bootloader loads kernel
- Reads kernel from disk
- Loads it at 0x10000
-
Bootloader prepares CPU
- Disables interrupts
- Enables A20 line
- Sets up GDT & IDT
-
Switch to protected mode
- Sets PE bit
- CPU becomes 32-bit
-
Jump to kernel entry
- Far jump to address 0x00000000
- Execution enters head.s
-
Kernel startup code (head.s)
- Sets segments
- Sets stack
- Sets paging
- Calls
main()in C
-
Kernel is running
- Hardware control taken from BIOS
- OS is now in charge
Power → CPU reset → BIOS (ROM) → Boot sector (RAM)
→ Bootloader → Protected mode → Kernel