Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction
2.
What is Bootloader
3.
Storage of Bootloaders
4.
Workflow of Bootloaders
4.1.
Applications of Bootloaders
5.
Some Famous Bootloaders
6.
Frequently Asked Questions
6.1.
Is the bootloader the same on all devices?
6.2.
What are some common Bootloader errors?
6.3.
What is firmware?
6.4.
Can the Bootloader be modified?
6.5.
What is the difference between a locked and unlocked bootloader?
7.
Conclusion
Last Updated: Mar 27, 2024

What is Bootloader

Roadmap to SDE career at Amazon
Speaker
Anubhav Sinha
SDE-2 @
25 Jun, 2024 @ 01:30 PM

Introduction

Hello Ninjas! Have you ever wondered what happens when we start our computer systems or smartphones? What changes occur at the hardware level, and how the operating system loads into the memory (RAM) so that we can see our desktop or home screen? It all happens due to a software named Bootloader.  

what is bootloader

In addition to loading operating systems, it also has other applications. Let's see the working and applications of Bootloader in detail. 

What is Bootloader

A bootloader is a small software program typically responsible for loading and starting up an operating system on a computer. After a computer is turned on, it is the first piece of software that runs on the memory. 

The Bootloader resides in a particular location on bootable devices. They can be anything like hard disks, SSDs, USB flash drives, etc. The particular location depends on the partition scheme of the bootable device. 

Get the tech career you deserve, faster!
Connect with our expert counsellors to understand how to hack your way to success
User rating 4.7/5
1:1 doubt support
95% placement record
Akash Pal
Senior Software Engineer
326% Hike After Job Bootcamp
Himanshu Gusain
Programmer Analyst
32 LPA After Job Bootcamp
After Job
Bootcamp

Storage of Bootloaders

On old devices, MBR (Master Boot Record) partition scheme was used. Here, the Bootloader is stored in the first sector of the bootable device, also known as the MBR. The contents of MBR are loaded into memory by the BIOS (Basic Input/Output System) or UEFI (Unified Extensible Firmware Interface) firmware during the boot process. For more information on BIOS and UEFI firmware, visit this blog.

Newer devices use GPT (GUID Partition Table) partition scheme. The Bootloader is stored in a dedicated partition called the Extensible Firmware Interface System Partition (ESP).  

They are usually stored with the name "bootloader.bin" or "bootloader.com" (on BIOS-supported systems). On devices that use UEFI (Unified Extensible Firmware Interface) firmware, they are stored with the name "bootx64.efi" or "bootia32.efi", depending on the device's architecture. To know more about MBR, visit this blog.

Recommended Topic: Bootstrap

Workflow of Bootloaders

Flow of bootloader

Let’s see how bootloaders help in starting the operating systems:

  • As the system is turned on, firmware is loaded into the memory, which is fetched from non-volatile memory (ROM), as the memory is volatile and no data is present during the turn-on. For more information on RAM and ROM, visit this blog.
     
  • Firmware can be BIOS or UEFI. After being loaded, they first perform the Power On Self Test (POST) and check the hardware is working correctly. Then they initialize a small set of hardware.
     
  • Now the firmware finds the bootable device and loads the Bootloaders into the memory from the respective partition (MBR or GPT in the bootable device).

Applications of Bootloaders

After being loaded in the memory, Bootloaders begin to perform the following operations:

  • Initialising all hardware: After the firmware initializes a small set of hardware, bootloaders initialize other components such as CPU, memory, input-output devices, etc.
     
  • Detects the Operating System: Bootloaders detect the operating system files in the boot device (using the partition's metadata).
     
  • Starting the Operating System: It loads the operating system into the memory and hands over the control to the Kernel of the Operating System. Kernel further carries the booting process. To learn more about Kernels, visit this blog.


Apart from booting, Bootloaders have other applications like:

  • Encrypting and decrypting the operating system to protect it from unauthorised access.
     
  • Updating the firmware to improve device performance.
     
  • Setting up dual boot configurations to easily switch between different operating systems.

Some Famous Bootloaders

Here are some famous Bootloaders:

  • BootX: It was designed by Apple for Macintosh computers.
     
  • GNU GRUB: It was designed by the GNU project. It stands for Grand Unified Bootloader. It is mainly for Linux devices.
     
  • iBoot: It is designed by Apple for its iPhones.
     
  • LILO: It stands for Linux Loader. It is used in Linux systems.
     
  • EFI Bootloader: It is present for UEFI-based systems.

Frequently Asked Questions

Is the bootloader the same on all devices?

No, the bootloader type depends on the hardware architecture, operating system and sometimes device manufacturers. 

What are some common Bootloader errors?

Some common Bootloader errors include Bootmgr corrupted, Boot file corrupted, Boot sector corrupted, etc.

What is firmware?

Firmware is a small software embedded in electronic devices and hardware components. It provides low-level hardware control and performs functions such as booting, controlling input/output operations, and managing the interaction between hardware and software.

Can the Bootloader be modified?

Advanced users or developers can modify the Bootloader to customize the boot process or add new functionality. However, modifying the Bootloader can be risky and may result in a non-functional device if done improperly.

What is the difference between a locked and unlocked bootloader?

A locked bootloader restricts the user from modifying the Bootloader or installing custom software on the device. An unlocked bootloader allows the user to alter the Bootloader and install custom software.

Conclusion

In this article, we discussed what is Bootloader. Their workflow when the system starts. We also saw its applications and importance in a system. Understanding Bootloaders is necessary to troubleshoot booting-related issues in a system.

To get more clarity about the booting procedure, visit the below blogs:

 

You may refer to our Guided Path on Code Studios to enhance your skill set on DSACompetitive ProgrammingSystem Design, etc. Check out essential interview questions, practice our available mock tests, look at the interview bundle for interview preparations, and so much more!

Happy Learning, Ninjas!

Previous article
Kernel in Operating System
Next article
File Management in Operating System
Live masterclass