When the power-on button is pressed, the first chipset that gets activated is called BIOS. ๐๐๐๐ ๐ฌ๐ญ๐๐ง๐๐ฌ ๐๐จ๐ซ ๐๐๐ฌ๐ข๐ ๐๐ง๐ฉ๐ฎ๐ญ ๐๐ฎ๐ญ๐ฉ๐ฎ๐ญ ๐๐ฒ๐ฌ๐ญ๐๐ฆ and is responsible for three things.
1๏ธโฃ First, BIOS performs a Power On Self Test also known as POST. This BIOS verifies if the computer keyboard, random access memory, disk drives, and other hardware are working correctly or not. 2๏ธโฃ Next, BIOS searches and loads the master boot record or MBR into the RAM. MBR contains a partition table that has entries regarding partitions on your storage device. 3๏ธโฃ Now BIOS will look at the partition table and identify all the bootable partitions. If there is just one bootable partition then BIOS will proceed with the boot process else it will give you an option to select the OS that you want to boot.
๐๐๐ก๐ ๐๐จ๐จ๐ญ๐ฅ๐จ๐๐๐๐ซ ๐When BIOS knows which partition to boot from, it will go to that partition and again load a program stored in the first 512 bytes of the selected partition. This program is known as a bootloader. If you are using Linux then your bootloader will either be ๐๐ซ๐ฎ๐ ๐จ๐ซ ๐๐๐๐. In the case of windows, the program is very creatively called windows bootloader. ๐๐ก๐ ๐๐จ๐จ๐ญ๐ฅ๐จ๐๐๐๐ซ ๐ข๐ฌ ๐ซ๐๐ฌ๐ฉ๐จ๐ง๐ฌ๐ข๐๐ฅ๐ ๐๐จ๐ซ ๐ฅ๐จ๐๐๐ข๐ง๐ ๐ญ๐ก๐ ๐จ๐ฉ๐๐ซ๐๐ญ๐ข๐ง๐ ๐ฌ๐ฒ๐ฌ๐ญ๐๐ฆ ๐ข๐ง๐ญ๐จ ๐ญ๐ก๐ ๐๐๐.
๐Now control goes to the bootloader and the bootloader is responsible for loading the first major piece of the operating system into the RAM. ๐๐ก๐ข๐ฌ ๐ข๐ฌ ๐๐๐ฅ๐ฅ๐๐ ๐ ๐ค๐๐ซ๐ง๐๐ฅ. If you are using Linux, it is called Linux kernel and on Windows, it is called WNT which stands for Windows New Technology kernel.
๐Once the kernel is loaded into the RAM, the execution control is given to it and it starts the ๐ ๐ฌ๐ญ๐๐ ๐ ๐ฉ๐ซ๐จ๐๐๐ฌ๐ฌ to bring the computer to life.
1๏ธโฃ In the first stage, the kernel performs a test known as auto-probing. ๐๐ฎ๐ญ๐จ-๐ฉ๐ซ๐จ๐๐ข๐ง๐ simply means checking if other hardware components such as wifi-card, ethernet card, hard-drives, USB devices, keyboard, mouse, touchpad, etc are working correctly or not. Once, auto-probing is done the kernel will check if the hard drive is okay or not. 2๏ธโฃ Once all the checks are done, in the second stage, the kernel will start the system daemons. ๐๐๐๐ฆ๐จ๐ง๐ฌ are programs that run in the background and provide services to other programs. There are daemons for services such as printer spooling and networking. 3๏ธโฃ Once the daemons are running, the kernel will execute the ๐๐๐ ๐ฆ๐๐ง๐๐ ๐๐ซ or the display manager that will actually give you a login screen.
๐On a typical modern computer, it takes about 10โ15 seconds to see a login screen after pressing the power-on button. During this time, the computer actually executes over a million lines of code just to give you a login screen, which is quite magical.โจ