Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction 
2.
What is Boot Block in Operating System?
2.1.
Boot Block in Windows
3.
Frequently Asked Questions
3.1.
Why is a boot block required in a computer system?
3.2.
Why is bootstrap stored in ROM?
3.3.
What is a boot control block?
3.4.
What is the Inode table?
4.
Conclusion
Last Updated: Mar 27, 2024
Easy

Boot Block

Operating Systems

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: 

  1. The operating system is started when the CPU registers, device controllers, and main memory have been initialized.
  2. The bootstrap program locates the operating system kernel on a disc and puts it into memory to complete its task.
  3. 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.

Frequently Asked Questions

Why is a boot block required in a computer system?

 When a computer is turned on or rebooted, it has to run an initial software to get it up and to run. And the bootstrap program, as the name implies, must be simple.

Why is bootstrap stored in ROM?

 The bootstrap loader is stored in the ROM because it is a non-volatile memory meaning that the information is not lost when the computer shuts down. In addition, it has a small memory size and is used only to keep permanent data that are necessary to bring about essential functions, i.e., bootstrap loader.

What is a boot control block?

 The Boot Control Block contains all of the information needed to boot an operating system from that volume. It is called a boot block in the UNIX file system. In NTFS, it is called the partition boot sector.

What is the Inode table?

The inode table contains a list of all inode numbers for the file system in question. When users look for or access a file, the UNIX system looks up the correct inode number in the inode table.

Read about - Lock based protocol in DBMS

Conclusion

So, in a nutshell, a boot block is just a place in secondary memory (ROM) where the program required to boot up the system resides. When we turn on our computer, this is the first program that is run and, in turn, runs the operating system. 

Recommended Reading:

Do check out The Interview guide for Product Based Companies as well as some of the Popular Interview Problems from Top companies like Amazon, Adobe, Google, Uber, Microsoft, etc. on Coding Ninjas Studio.

Also check out some of the Guided Paths on topics such as Data Structure and Algorithms, Competitive Programming, Operating Systems, Computer Networks, DBMS, System Design, etc. as well as some Contests, Test Series, Interview Bundles, and some Interview Experiences curated by top Industry Experts only on Coding Ninjas Studio.

Live masterclass