The boot process for a computer checks the system and loads the operating system into memory.

A computer without a program running is just an inert hunk of electronics. The first thing a computer has to do when it is turned on is to start up a special program called an operating system. The operating system’s job is to help other computer programs work by handling the messy details of controlling the computer’s hardware. 

An overview of the boot process  

The boot process is something that happens every time you turn your computer on. You don’t really see it, because it happens so fast. You press the power button and come back a few sec (or minutes if on slow storage like HDD) later and Windows 10, or Windows 11, or whatever Operating System you use is all loaded. 

The BIOS chip tells it to look in a fixed place, usually on the lowest-numbered hard disk (the boot disk) for a special program called a boot loader (under Linux the boot loader is called Grub or LILO). The boot loader is pulled into memory and started. The boot loader’s job is to start the real operating system. 

Functions of BIOS

1. POST (Power On Self Test): The Power On Self Test happens each time you turn your computer on. It sounds complicated and that’s because it kind of is. Your computer does so much when it’s turned on and this is just part of that. 



  • It initializes the various hardware devices. 
  • It is an important process to ensure that all the devices operate smoothly without any conflicts. BIOSes following ACPI create tables describing the devices in the computer. 
  • The POST first checks the bios and then tests the CMOS RAM. 
  • If there is no problem with this then POST continues to check the CPU, hardware devices such as the Video Card, and the secondary storage devices such as the Hard Drive, Floppy Drives, Zip Drive, or CD/DVD Drives. 
  • If some errors are found then an error message is displayed on the screen or a number of beeps are heard. 
  • These beeps are known as POST beep codes. 

2. Master Boot Record: The Master Boot Record (MBR) is a small program that starts when the computer is booting, in order to find the operating system (eg. Windows XP). This complicated process (called the Boot Process) starts with the POST (Power On Self Test) and ends when the Bios searches for the MBR on the Hard Drive, which is generally located in the first sector, first head, first cylinder (cylinder 0, head 0, sector 1). 
A typical structure looks like this: 

The bootstrap loader is stored in the computer’s EPROM, ROM, or another non-volatile memory. When the computer is turned on or restarted, it first performs the power-on-self-test, also known as POST. If the POST is successful and no issues are found, the bootstrap loader will load the operating system for the computer into memory. The computer will then be able to quickly access, load, and run the operating system. 

3. init: init is the last step of the kernel boot sequence. It looks for the file /etc/inittab to see if there is an entry for initdefault. It is used to determine the initial run level of the system. A run-level is used to decide the initial state of the operating system. 
Some of the run levels are: 

  • Level 0: System Halt.
  • Level 1: Single user mode.
  • Level 3: Full multiuser mode with network.
  • Level 5: Full multiuser mode with network and X display manager.
  • Level 6: Reboot.

The above design of init is called SysV- pronounced as System five. Several other implementations of init have been written now. Some of the popular implementations are systemd and upstart. Upstart is being used by ubuntu since 2006. More details of the upstart can be found here. 

The next step of init is to start up various daemons that support networking and other services. X server daemon is one of the most important daemons. It manages the display, keyboard, and mouse. When X server daemon is started you see a Graphical Interface and a login screen is displayed. 

This article is contributed by Saket Kumar. If you like GeeksforGeeks and would like to contribute, you can also write an article using write.geeksforgeeks.org or mail your article to . See your article appearing on the GeeksforGeeks main page and help other Geeks. 

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above. 

Practice Tags :

In order to continue enjoying our site, we ask that you confirm your identity as a human. Thank you very much for your cooperation.

When you turn on the power to a computer, the first program that runs is usually a set of instructions kept in the computer's firmware called the boot ROM. For a typical PC, this can be the basic input output system (BIOS), or on newer machines, the unified extensible firmware interface (UEFI). This code examines the system hardware to make sure everything is functioning properly and in the case of UEFI, that the boot software is legitimate and secure. Once the test has successfully completed, the firmware continues the boot process.

The bootstrap loader, or boot loader, is a small program that has a single function: It loads the operating system into memory and allows it to begin operation. In the most basic form, the bootstrap loader sets up the small driver programs that interface with and control the various hardware subsystems of the computer. It sets up the divisions of memory that hold the operating system, user information and applications. It establishes the data structures that hold the myriad signals, flags and semaphores that are used to communicate within and between the subsystems and applications of the computer. Then it turns control of the computer over to the operating system.

The operating system's tasks, in the most general sense, fall into several categories:

  • Processor management
  • Memory management
  • Device management
  • Storage management
  • Application interface
  • User interface
  • System security management

These tasks define the core of nearly all operating systems. Next, let's look at the tools the operating system uses to perform each of these functions.

Learn more about the startup sequence of a computer.

In this step, you’ll learn how the components of a computer work together from the moment you press the “on” button.

The startup sequence

From the moment you press the power button, a whirlwind of tasks happen inside your computer.

Let’s have a look at each of the components and systems that work together to start up your computer.

CPU

The CPU, or central processing unit, is a large chip inside the computer. This is the brains of the computer: it controls everything. It works by reading instructions and data from the random access memory (RAM), performing an instruction, and then writing the data back to RAM. Some of the instructions may involve other components like the hard drive, but the CPU is in control.

The boot process for a computer checks the system and loads the operating system into memory.

RAM

RAM temporarily stores data while your computer is running.

  • RAM is both readable and writable. You can add, change, and delete data stored in RAM.
  • It is volatile. When the computer is switched off, all the data stored in RAM is lost.
  • It is fast.

The boot process for a computer checks the system and loads the operating system into memory.

ROM

ROM stands for read-only memory. It is a chip containing data installed by the manufacturer that is not typically replaced or upgraded. It stores the BIOS.

  • ROM is read-only. It is usually programmed by the computer manufacturer, and cannot be changed or overwritten. (There is a process for overwriting the ROM, called “flashing” it, but it’s difficult and can lead to a completely broken and unrecoverable computer.)
  • ROM is non-volatile memory, which means it does not need power to keep the data inside it.
  • It is fast.

The boot process for a computer checks the system and loads the operating system into memory.

Hard Drive

The hard drive (sometimes called the hard disk) is the main storage device in your computer. Like RAM, it can be added to and changed, and like ROM it is non-volatile, but it is slow. If you have files and folders on your computer, are stored on the hard drive. The operating system is also stored on the hard drive.

The boot process for a computer checks the system and loads the operating system into memory.

BIOS stands for Basic Input Output System. The BIOS is stored in the ROM. It contains all the basic code for controlling your computer hardware (such as keyboards, mice, monitors and hard drives). After the startup sequence is complete, and control has gone to the operating system, the BIOS does very little.

When you start up your computer, you may see a black screen displaying “Press F2 for Setup”. This is the BIOS. By pressing F2, you enter a setup screen where you can change where the BIOS loads the operating system from.

The operating system is normally stored on the hard drive, but you can load an operating system from a USB drive or a CD instead.

Startup sequence

So, how are these components used in the startup sequence?

  • The CPU starts and fetches instructions into RAM from the BIOS, which is stored in the ROM.
  • The BIOS starts the monitor and keyboard, and does some basic checks to make sure the computer is working properly. For example, it will look for the RAM.
  • The BIOS then starts the boot sequence. It will look for the operating system.
  • If you don’t change any of the settings, the BIOS will fetch the operating system from the hard drive and load it into the RAM.
  • The BIOS then transfers control to the operating system.

That’s a lot of information and acronyms!

Hopefully, this step has helped you understand what happens underneath the bonnet of a computer when you turn it on. Once you know this sequence, you can create some really fun lesson plans based on it…

An example lesson

Give students or teams of students a component each:

  • CPU
  • BIOS
  • ROM
  • RAM
  • Operating system

Place them at different tables around the room with some paper. There should be some distance between the students so that everyone can clearly see what’s happening.

Get each team to discuss the key features of their component and write them down on a large piece of paper. They could use their notes, or this could be a test of what they’ve learnt so far.

Run through a simple scenario. For example, “I’m writing a document in Word and my computer crashes. What does RAM do?”

Get the students to physically throw a piece of paper that was on the RAM table into the bin. It’s lost without power. Throw ROM’s data in the bin, and ask the students: is this correct?

Run through the more complicated startup sequence. Have a piece of card with the word CONTROL on it to indicate who has control. Each team has to say what they’re doing as they’re doing it. For example:

I am the BIOS. I’m just going to go over here and check that I have some RAM.

Give a high five to the RAM team

OK, RAM is there. Now I’m going to look for the operating system.

Go over and give a thumbs up to the OS team

I’m going to pick the OS up and put it in the RAM.

The OS team follows BIOS over to the RAM table

Go through several iterations of the startup sequence until the students understand it without looking at their notes. If you can, get them to perform the startup sequence for another class.

Physically modeling the startup sequence is a great learning opportunity for students. Once they can visually see what is happening with the components during startup, they will remember the sequence more easily.

For more detailed descriptions of what’s happening inside some of these components, check out our How Computers Work course.