What happens when we switch on computer?
If you don't know when happens when we switch on the computer then this post is for you????
ย 18-Apr-2022
Created Byย :ย Priyanka Singh

๐–๐ก๐š๐ญ ๐ก๐š๐ฉ๐ฉ๐ž๐ง๐ฌ ๐ฐ๐ก๐ž๐ง ๐ฐ๐ž ๐ฌ๐ฐ๐ข๐ญ๐œ๐ก ๐จ๐ง ๐š ๐œ๐จ๐ฆ๐ฉ๐ฎ๐ญ๐ž๐ซ?๐Ÿค”

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.โœจ