1. Power-On Self-Test (POST)
When you press the power button on your computer, the BIOS (Basic Input/Output System) chip is triggered to perform a series of tests to ensure that all hardware components are functioning correctly.
2. Boot Device Selection
If POST is successful, the BIOS searches for a bootable device, such as a hard drive or solid-state drive (SSD). In our example, let's assume we're using an SSD.
3. Master Boot Record (MBR)
The BIOS reads the MBR from the selected device. The MBR contains information about the operating system and boot loader to be used.
4. GRUB Boot Loader
GRUB (Grand Unified Bootloader) is a popular open-source boot loader for Linux. In our example, let's assume we're using GRUB. When GRUB is loaded from the MBR, it searches for the kernel image files on the SSD.
5. Loading Linux Kernel and Initramfs
When GRUB finds the kernel image file (e.g.,
vmlinuz-5.10.0-14-generic) and initramfs (initial RAM filesystem) file (e.g.,
initrd.img-5.10.0-14-generic), it loads them into memory.
6. Kernel Execution
The loaded kernel is then executed, and the Linux operating system begins to boot.
Here's an example of what this process might look like on a Linux system:
Let's say you have a Linux distribution installed on an SSD with the following files:
bash
/dev/sda1/ (SSD partition 1)
└── boot/
└── grub/
├── grub.cfg
└── vmlinuz-5.10.0-14-generic
In this example:
vmlinuz-5.10.0-14-generic is the kernel image file.initrd.img-5.10.0-14-generic is not shown in this example, but it would typically be stored alongside the kernel image file.grub.cfg is the GRUB configuration file.
When you power on your computer, the BIOS performs POST and selects the SSD as the boot device. The MBR is read from the SSD, which contains information about GRUB. GRUB loads into memory and searches for the kernel image files on the SSD. When it finds
vmlinuz-5.10.0-14-generic, it loads it into memory alongside the initramfs file (not shown). Finally, the loaded kernel is executed, and the Linux operating system begins to boot.
Keep in mind that this is a simplified example and actual boot processes may vary depending on your specific hardware and software configuration.