When we press the power button on our PC then some devices are checked whether they are working or not. The devices which are checked before our PC boots up are BIOS (Basic Input Output System), RAM (Random Access Memory), hard drive and processor. Before these devices are checked the power supply of the PC should be working fine also. Other peripheral devices like mouse, keyboard are also checked. The process of checking the devices before booting the system is known as POST (Power-On-Self-Test).
If all the devices are working fine then the boot sequence is checked. Now I want to explain what the boot sequence is.
The boot sequence is the sequence of devices to boot your system from. Suppose you have 4 devices to boot from. The first is the DVD drive, the second is a hard drive, and the third is a flash drive or USB drive. The boot sequence helps your computer to decide which device the computer has to boot from. If you bought a new computer then you have to set the first boot device as a flash drive or DVD drive. When your system starts then it will load from the flash drive. In a flash drive, you have a bootable operating system installed. So this flash drive first loads the bootable files and then the installation of your operating system starts. When you have installed your operating system then upon startup you set the hard drive as the first boot sequence in the BIOS settings.
After the boot sequence your operating system is loaded into the main memory (RAM). There is also one term used known as MBR (Master Boot Record). MBR is the small memory that is stored on any hard drive. MBR contains operating system startup files. After the boot sequence is checked the MBR loads the startup files. If you are booting your system via flash drive then MBR is stored in a flash drive. If you are booting your system from a hard drive or SSD drive then MBR is loaded from a hard drive or SSD drive. Every operating system comes with a couple of startup files (MBR) that help the computer load the operating system into RAM.
It should be noted that if you have already installed the operating system from a USB drive then you have to change the sequence of the first boot device to the hard drive so that your system now boots from the hard drive. If you have set the boot sequence in BIOS and if any device on your computer malfunction then that device, not loads and the device next in the boot sequence will load. For example, you have set the flash drive as the first boot sequence in BIOS and that flash drive is empty and not containing any windows files then your computer will go to the next boot sequence. If you have a hard drive in the next boot sequence then your computer loads from the hard drive because the flash drive is empty. The same thing goes for the DVD drive. If you have set the first sequence to the DVD drive and that DVD drive does not contain a windows DVD then the next device in your sequence will be loaded i.e. hard drive or flash drive.
If you have two hard drives on your computer and any of the hard drives not works then your computer will not boot and will show an error on the screen.
Android and iOS also checks if any of the hardware devices function properly or not before booting. If any hardware device like RAM is not working then your smartphone or tablet shows an error or it will not start up your mobile.