Loading an Operating System

07 Jun 2019

How do we get a computer started?

We have hardware and we give it power. What happens?

  • The CPU only knows how to perform its basic operations, load, move, add, etc.
  • The computer only does what it is told.

How do we get it to run the operating system and how does it know where, or how to load the first program?

System Boot

Booting or “Bootstrapping” a system is the procedure for loading and starting the operating system. The Bootstrap program or Boostrap loader locates the OS kernel, loads it into memory, and starts its execution.

Booting is usually a 2 step process:

  1. Load and execute a simple bootstrap loader.
  2. Which fetches a more complex kernel from disk and switches execution to the kernel.

The initial boot loader must be within the system. (no external device)

  • ROM or EPROM

Steps to Booting:

  1. Run diagnostics to make sure the hardware is working. (CPU, Memory)
  2. Find a device to boot from. (disk, flash, dvd, network, etc.)
  3. Load the primitive boot loader and transfer control
  4. Primitive boot loader then loads the secondary stage booloader
    • Examples of this secondary bootloader include LILO (Linux Loader), and GRUB (Grand Unified Bootloader).
    • Can select among multiple OS (on different partitions) - i.e. dual booting.
    • Once the OS is selected, the bootloader goes to that OS’s partition, finds the boot sector, and starts loading the OS’s kernel.