What happens when you throw the switch?

Unix Insider |  Operating Systems

Booting is a shortened version of bootstrapping, which comes from the expression "to lift yourself up by your own bootstraps." Oddly enough, that would be impossible, but the expression means "to help yourself."


On a computer, bootstrapping is the process of loading and executing a startup standalone program. Although that description may not be exactly accurate for any given computer, all computers must go through similar steps to start up.


Deep in the bowels of the computer lies a Read Only Memory (ROM) that contains a short program burned into the memory. When the computer is switched on, the CPU is configured to start its internal program counter at the beginning of the ROM program.


The ROM program varies in length, but basically performs the following:

  • Diagnostics, usually called Power On Self Test (POST)
  • Location, loading, and execution of a larger bootstrap program from the bootable drive
  • Loading and execution of the kernel by the bootstrap program


The ROM bootstrap program does the following, though not necessarily in this order:

  • Performs POST, including testing memory, keyboard, and console.
  • Polls all addresses where a device can reside, and either runs diagnostics in the ROM or asks the device to run a self-diagnostic and report the results.
  • Finds the device that is bootable, usually the first drive.
  • Determines whether that device has a program in its own ROM that needs to be loaded in order to control the device, then loads it.
  • Jumps to the now-loaded device control program that lets you load the disk bootstrap program, and loads it. The program resides in the boot block or boot sector of a disk. That sector has become a favorite target area for virus writers, because it's very hard to boot a computer without loading and executing the boot sector.
  • Jumps to the beginning of the now-loaded disk bootstrap program and executes it.


Then the disk bootstrap program locates and loads a larger program (usually the Unix/Linux kernel) and begins executing. In an alternative version, the disk bootstrap program loads and runs a very extensive booting program. When complete, that booting program finally loads and executes the Unix kernel.


You can see why this process is called booting. The ROM program A loads small disk program B (the boot sector) and executes it. Disk program B loads larger program C and executes it.

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Answers - Powered by ITworld

ITworld Answers helps you solve problems and share expertise. Ask a question or take a crack at answering the new questions below.

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Ask a Question
randomness