Skip to content

Instantly share code, notes, and snippets.

@mudassaralichouhan
Last active December 22, 2025 04:20
Show Gist options
  • Select an option

  • Save mudassaralichouhan/ccb306618fcc2ccef335b33fbc640404 to your computer and use it in GitHub Desktop.

Select an option

Save mudassaralichouhan/ccb306618fcc2ccef335b33fbc640404 to your computer and use it in GitHub Desktop.
the complete chain from power ON → kernel loaded

The complete chain from power ON → kernel loaded, with every step mentioned, but kept simple and short.


Power-on → Kernel load (x86, BIOS, Linux 0.01 style)

  1. Power ON

    • Electricity reaches motherboard, CPU resets
  2. CPU reset state

    • CPU enters real mode (16-bit)
    • Registers set to fixed values
    • Instruction pointer = 0xFFFF0
  3. CPU fetches first instruction

    • Address 0xFFFF0 maps to BIOS ROM
    • CPU reads and executes BIOS code
  4. BIOS starts running (from ROM)

    • Tests CPU
    • Initializes chipset
    • Initializes RAM
    • Initializes keyboard, disk, video
  5. POST (Power-On Self Test)

    • Checks memory, basic hardware
    • Shows BIOS screen / beep if error
  6. BIOS selects boot device

    • Uses boot order (floppy / HDD)
    • Finds a bootable disk
  7. BIOS reads boot sector

    • Reads first 512 bytes (sector 0)
    • Loads it into RAM at 0x7C00
  8. BIOS jumps to 0x7C00

    • Control passes to bootloader
  9. Bootloader starts (boot.s)

    • Still 16-bit real mode
    • Uses BIOS interrupts
  10. Bootloader relocates itself

    • Moves from 0x7C00 → 0x90000
  11. Bootloader loads kernel

    • Reads kernel from disk
    • Loads it at 0x10000
  12. Bootloader prepares CPU

    • Disables interrupts
    • Enables A20 line
    • Sets up GDT & IDT
  13. Switch to protected mode

    • Sets PE bit
    • CPU becomes 32-bit
  14. Jump to kernel entry

    • Far jump to address 0x00000000
    • Execution enters head.s
  15. Kernel startup code (head.s)

    • Sets segments
    • Sets stack
    • Sets paging
    • Calls main() in C
  16. Kernel is running

    • Hardware control taken from BIOS
    • OS is now in charge

One-line summary

Power → CPU reset → BIOS (ROM) → Boot sector (RAM)
→ Bootloader → Protected mode → Kernel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment