Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

🏠 Back to Blog

Startup and Init

  • Bootstrapping
    • First thing that happens when you power on a system is a positive voltage (5v) is applied to the reset pin of the CPU
    • Two registers are initialized:
      • CS Register: Has the address of the stack
      • EIP Register: The current instruction to execute
    • Load the BIOS from ROM
      • Linux doesn’t use the BIOS after boot, it only uses device drivers loaded by the kernel
      • MSDOS used the BIOS to execute system calls
      • BIOS Steps:
        1. POST (Power on self test)
        2. ACPI - builds tables of devices with information regrading power. Can be used to decide when a system can power down a device or set it to a lower power level
        3. Hardware Initialisation
        • 3 ways to communicate with devices on a PC:
          1. IO port from CPU to the device for communication via a port address
          2. Map memory from the device to the address space of the computer and read/write to it
          3. Use interrupts
        1. Find a boot device by searching for a boot sector on each device.
        • First sector of a disk is the master boot record with contains the partition table and a boot loader (GRUB)