What happens when you start your Linux machine?

What happens when you start your Linux machine?

When you turn on your computer, The BIOS instantly runs POST (Power on Self Test).

Post is a part of the BIOS which performs some diagnostic tests on hardware components such as storage devices, keyboard, Mouse, etc.

BIOS stands for Basic Input Output System. In modern computer systems, the BIOS contents are stored on a flash memory chip so that the contents can be rewritten without removing the chip from the motherboard.

Once POST has checked the hardware, the BIOS will now start looking for the Boot loader, which is usually stored in the hard disks.

Boot loader

There are several bootloaders for Linux, the most common of which are GRUB and LILO. When dual booting your system, GRUB2 lets you select which operating system to boot into.

UEFI

The Unified Extensible Firmware Interface is a publicly available specification that defines a software interface between an operating system and firmware. UEFI defines a new method by which OSes and platform firmware communicate, providing a lightweight BIOS alternative that uses only the information needed to launch the OS boot process (Firmware is the programming that's embedded in the nonvolatile memory of a device.) Most modern devices are using UEFI, as it provides features like Secure Boot, Quick Boot, etc.

MBR

MBR is the first sector of a hard disc that identifies the location of the OS to complete the booting process. It identifies how and where the system's operating system is located in order to be booted (loaded) into the computer's RAM.

Kernel

Once the chosen kernel is loaded into the memory and begins execution, it starts extracting itself before performing any useful task. Once loaded by the bootloader, it mounts the root file system and initializes the /sbin/init program, which is commonly referred to as init.

Initial RAM disk-initramfs image:

The initial RAM disk is an initial/temporary root file system that is mounted prior to when the real root file system is available. This initramfs image is embedded in the Kernel and contains minimal binary files, modules & programs required for mounting the real root filesystem.

/sbin/init

init is amongst the first command to be executed by the Kernel, once it's loaded. This program manages the rest of the booting process and sets up the environment for the user. The init command also assists in keeping the system running and shutting it down correctly.

Getty

Getty opens TTY (tty - teletype) lines, sets their modes, prints the login prompt, obtains the user's name, and then starts the login process for the user.

Resources:

Did you find this article valuable?

Support Things for DevOps by becoming a sponsor. Any amount is appreciated!