"Powering On" Explained

Feeling a little perplexed by how your computer goes from idle aluminum to a full-fledged modern device? You’re not alone! Let’s demystify the Linux boot process, breaking it down into its fundamental stages.

1. BIOS/UEFI Initialization

BIOS (Basic Input/Output System) or UEFI (Unified Extensible Firmware Interface) act as the bridge between the firmware and the operating system. When the computer is powered on, the BIOS/UEFI performs a Power-On Self Test (POST) to check if the hardware components like RAM, disk drives, and other peripherals like your mouse are functioning correctly. After successful hardware verification, it searches for a bootable device, like a hard drive or USB drive.

System76 uses UEFI — the modern replacement of legacy BIOS — because it supports larger hard drives, faster boot times, and better security.

2. Bootloader

The bootloader is the software responsible for loading the operating system. It does this by initializing the kernel by loading it into memory and passing control to it.

In Linux, the most common bootloader is called GNU GRand Unified Bootloader (GRUB). It supports features like a graphical menu, called the boot manager, to select different operating systems or kernel versions.

The bootloader in Pop!_OS is called systemd-boot, a UEFI boot manager that provides a kernel command line editor, as well as a text menu for selecting a boot entry. These boot entries can include a choice of operating system, kernel version, and a recovery partition. Systemd-boot is responsible for executing the EFI image residing on the EFI System Partition (ESP), then passing the heavy lifting off to the firmware.

Our Intel-powered laptops use Coreboot as a key component of System76 Open Firmware. Coreboot is open source, provides faster boot times, and allows for flexibility with the configuration. Coreboot’s boot process occurs in a series of stages and binaries, and performs the required hardware initialization.

Control is then passed to a different executable, referred to in coreboot as the “payload,” which is usually Tianocore. The primary function of the payload is to boot the operating system (OS). Coreboot initializes hardware, while the payload executes the software, combining together to provide a true open source boot option.

“We have much more granular control over Open Firmware. Before we were shipping Open Firmware on our hardware, the changes we could make to a device’s firmware were very limited and superficial,” explained Levi Portenier, QA Manager at System76. “Now, though, we can tailor our firmware to our hardware to create a cohesive experience.”

3. Kernel Initialization

The kernel is the core of the Linux operating system. Once the bootloader hands over control, the kernel initializes its components and hardware devices: It sets up memory management, schedules processes, and mounts the root (admin) filesystem as read-only. Mounting the filesystem as read-only helps preserve the state of the system and prevents corruption to the boot process. This stage involves the execution of the initrd (initial ramdisk), a temporary filesystem loaded into memory, which includes drivers necessary to access the disk drives and other critical hardware.

4. Systemd

Linux systems use an init (initialization) system to transition to user space and manage system processes. Systemd is the most widely adopted option. It is responsible for initializing the system services defined in the /etc/systemd/system/ or /usr/lib/systemd/system/ directories. These services include sound servers, print servers, and network managers.

Systemd provides faster boot times and more control of services. It handles the mounting of filesystems, starting of system services, and the management of system states. Each Systemd unit can have a state of Active, Inactive or Loaded. A ‘unit’ is a systemd object that performs a particular task or action.

5. Targets

Linux systems have targets that define the state of the system. Targets include multi-user modes, graphical modes, and rescue modes. Targets group units together allowing a single target to be used, and establishes a dependency and a standardized name for the synchronization points of the different units. Administrators can define which services start at each target to customize the system for specific needs.

6. Login

Once all services are started, it’s time to log in to your server or desktop environment. That means the boot process is complete, and the login manager is ready for user interaction to start the desktop environment!

To sum up:

  • BIOS or UEFI initializes and verifies hardware components
  • Next, the bootloader loads the Linux kernel into memory
  • The kernel then uses a temporary filesystem containing drivers to access storage drives and other critical hardware
  • After that, the init system mounts the filesystem, and initializes the sound server, print server, and the network manager.
  • The system reaches a target, such as a multi-user mode when a system is shared across multiple users.
  • Boot was successful! Time to log in.

And that’s the Linux boot process, demystified. Something to think about after hitting the power button on your machine!


Like what you see?

Share on Social Media