Introduction
We understand computers, run programs, and some programs run other programs, but how does the computer know which program to run when we press the On button on our laptop?? We know when power is off, RAM gets off, so which program will run when the computer boots up?
For this, a program is just saved in the secondary memory's particular region, when the computer boots up, this program is loaded from a dedicated space in the hard disk or secondary memory of a computer, this dedicated space is called Boot Block, it's a block in secondary memory.
Also read, Multiprogramming vs Multitasking And Open Source Operating System
What is Boot Block in Operating System?
The Boot Block loads program is the Bootstrap program, and this program must initialize all the resources necessary for a computer to run. Following are the things which it initializes:
- The operating system is started when the CPU registers, device controllers, and main memory have been initialized.
- The bootstrap program locates the operating system kernel on a disc and puts it into memory to complete its task.
- When OS is loaded into the Main Memory, it moves to the initial address where OS is saved and begins its execution.
The bootstrap is kept in a read-only memory location (ROM). This position is convenient since ROM requires no startup and is at a fixed location where the CPU may begin executing immediately after being powered up or reset. Because ROM is read-only memory, a computer virus cannot infect it. The issue is that updating the bootstrap code necessitates replacing the ROM and hardware chips. That's why systems have a little bootstrap loader software in the boot ROM that loads a complete bootstrap program from the disc.
The complete bootstrap program is readily changed, and a new version is written to the disc. The entire bootstrap program is saved in "the boot block," a permanent area on the disc. A boot disc, or system disc, is a disc that contains a boot partition.
In a nutshell, the place where the bootstrap program is saved in the disk is called Boot Block.
Also see, Process Control Block in OS
Boot Block in Windows
Let's see how the boot block functions in an operating system, ie. Windows.
Here you can see the left block shows a schematic diagram of the disk of a computer. You know local disk C, local Disk D; they are all partitions in the main disk. We can see MBR and partitions in the disk.
MBR stands for Master Boot Record, and it has the boot code and Partition table to keep the information about partitions.
The following happens once we turn on our PC or laptop:
- Booting in Windows 2000 begins with executing code stored in the system's ROM memory.
- The system can read code directly from the master boot record, or MBR, with this code.
- The MBR also includes a table listing the hard drive partitions and a flag indicating which partition should be booted from the system.
-
When the system recognizes the boot partition, it reads the first sector, also known as a boot sector, from memory.
You can also read about the Multilevel Queue Scheduling.