This is what happens when you turn on your computer.

Smruti Ranjan Badatya
3 min readDec 9, 2022

--

Most of us know how to turn on a computer and use it for whatever we want. We press the power button, then the computer screen displays a logo, and then after some seconds we see our desktop.

But here is the catch: a lot is going on between pressing the power button to the moment we see the desktop screen of our operating system.

Previously I talked about why knowing the operating system in detail is necessary for a computer science student in general. If you are unaware of this, have a look here —http://shorturl.at/kvwV3

Now, let's begin with our journey to understanding how a computer actually starts ( THE BOOTING PROCESS ).

When we turn on the power button, we are actually powering the motherboard inside our computer.

The motherboard has all sorts of things. The things we are interested in right now are the CPU ( Microprocessor ), ROM ( has BIOS ), RAM, and Secondary Storage devices( has OS ).

The CPU( microprocessor ) has various registers like AX, BX, SP( Stack Pointer ), and IP( Instruction Pointer ). The instruction pointer points to the memory addresses of RAM where we have our instructions ( which we want to execute ).

This is just the High-level Overview of the things needed for the explanation of Booting

When the motherboard powers up, the BIOS firmware is copied from the ROM( Read Only Memory ) to the RAM( Random Access Memory ). Then the IP points to the Address of the RAM where the BIOS got copied.

BIOS stands for Basic Input/Output System. This is a program, which checks the attached devices and manages the data flow from-and-to the attached devices. This is present inside the ROM.

  • BIOS starts executing code and initializes all hardware.
  • Then it runs some tests ( particularly POST = power-on self-test).

BIOS is a very basic program so it can’t load the OS on its own. In fact, BIOS looks for the bootloader on the hard disk. Then copies the Bootloader to the RAM and points the IP to the corresponding memory address on the RAM.

The bootloader has the responsibility of finding the operating system on our hard disk. This can be done in two ways:

The 1st method: Legacy Booting

BIOS loads the first sector of each bootable device into memory at location 0x7C00 ( usually this is the boot loader ).

BIOS checks for the magic number ( 0xAA55 ) at the end of first 512 bytes ( i.e. 511th byte should be 55 and then the 512th byte should be AA. If this is found the CPU starts executing this chunk of code.

The 2nd Method: EFI

BIOS looks for a certain EFI partition on our secondary storage devices which contains EFI compiled Operating System. Then it starts executing that.

Then our Operating System starts and we see the OS logo. This entire process is called the Boot process or BOOTING.

Woof! You see so much stuff going on between pressing a button to the desktop screen.

We usually go with the legacy booting process for writing our own bootloader and then eventually our own Operating System. ( When we are a noob )

I am Smruti Ranjan and I am trying to make my own operating system. If you feel this is cool follow me to get upcoming article notifications. I will be posting the updates.

See ya next time!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Smruti Ranjan Badatya
Smruti Ranjan Badatya

No responses yet

Write a response