CSE Roadmap

Core tier · about 2 hours · 7 parts

Part 2 of 7 · 1 min read

The bootstrap problem

Think of a car engine, which cannot start itself: a small starter motor must turn it over first. A computer has the same difficulty. The OS must be in memory before it can run, and something must put it there. Yet the thing that loads programs from disk is the OS.

In plain words: The answer is a small program kept in non-volatile memory, which survives power-off. It is the bootstrap program, also called the boot loader or firmware. It is simple, because it has to be. It knows how to set up the basic hardware and how to find the kernel and load it into memory. After that it hands over control. The word comes from the old phrase "pull yourself up by your bootstraps". Starting a computer by loading the kernel is called booting.

The process often has more than one step. A tiny first program loads a bigger second program, which loads the kernel. Each step is just able enough to start the next.

Bootstrap program

A bootstrap program is the first program that runs when a computer is powered on. It is stored in firmware, initialises the hardware, finds the operating system kernel on a storage device, loads it into main memory and passes control to it.

Example: at power-on, the firmware runs, finds the boot loader on the disk, and the loader then loads the Linux kernel.

Check yourself: 1. Why can the OS not simply load itself from the disk at power-on? 2. Where is the bootstrap program stored, and why there? 3. What is the starter motor in the analogy?