Last post we learned what elements go into defining what a computer is. Today we will explore how a modern computer boots up. To do this we will need to understand more about what's under the hood, both in terms of hardware and software.
To do this, we are going to go through what happens when you hit the power button on the computer and describe the series of events that follow, at a basic level. Definitions will be included if there is room, otherwise they can be accessed through the links provided.
Now: the first thing that happens is that the computer begins to boot or the bootstrap process. This comes from the phrase "pulling oneself up by the bootstraps". This is because in an unpowered state, the computer knows nothing about itself and without outside intervention can "pull itself up by the bootstraps" to get to a ready state for the user.
Booting the system are the actions that take part in turning the system on. You may have heard this term in relation to warm or cold booting. A warm boot is a powered on reset of the system and skips POST, a cold boot is starting the system from an unpowered state.
We will be looking at the cold boot. The only difference as noted is that the computer doesn't need to execute the POST routines during a warm boot.
The very first thing that happens after checking that the power is good, the CPU is initialized. This is accomplished by triggering a number of clock ticks that result in loading the first instruction from the BIOS.
This first instruction is to load and run the Power On Self Test or POST routines. During this stage the computer does the following:
- verify CPU registers
- verify the integrity of the BIOS code itself
- verify some basic components like DMA, timer, interrupt controller
- find, size, and verify system main memory
- initialize BIOS
- give control to other specialized extension BIOSes (video cards are usually initialized here)
- identify, organize, and select which devices are available for booting
These POST routines are in all BIOS versions back to the original! In later BIOS versions, POST will also:
- discover, initialize, and catalog system buses and devices
- provide a user interface for system's configuration
- construct whatever system environment is required by the target operating system
If at any stage in this process hardware is missing or not functioning, the computer will emit a series of beep codes that when looked up on a table for that BIOS, will in most cases tell you what's wrong.
Once the POST has determined that all components are functioning properly and the CPU has successfully initialized, the BIOS looks for an Operating System or OS to load.
The BIOS will look to CMOS to find out where to load the OS from. Typically in a modern PC, this will be some flavour of Windows from the local C drive on the hard disk. It should be noted that the computer can boot from other devices such as CDROM, ZIP drives or USB stick. This is provided the media is prepared ahead of time with the necessary files. Normally these other boot locations are reserved for installing an OS or troubleshooting problems with the computer.
Now the system looks to the boot drive and will first encounter the boot sector containing the master boot record. This will tell the computer where to find the beginning of the OS file that will initialize the bootloader for the OS from the active partition.
Once the OS is initialized (started), the BIOS copies itself into memory and allows the OS to take over the remainder of the boot process.
The OS does another inventory of memory in order to know availability to start the next step. Now it begins loading device drivers to run peripheral equipment like a mouse, keyboard, printers, scanners or other devices you have installed plus the code to make the computer useful and accept user input.
This is the final stage of the boot process. After completing this, the computer is ready for the user to access applications and perform tasks on the system!
I hope this gives you a little more insight into how the computer boots, some new terms, and shows the complexity of what goes into starting up a modern computer.