Boot Process Linux Focused (BSD differs)

Overview

  1. bios/UEFI -> select boot loader (grub)
  2. load boot loader (grub) -> select / load kernel (pass in cfg)
  3. start init/systemd

BIOS/UEFI

purpose: initializes and enumerates hardware

  • stored on firmware
  • has no boot loader
  • basically a mini os
  • enumerates hardware

exit: hand off execution to a boot loader

Commands

Bash
efibootmgr # you can change things in uefi from the os level

Bootloader

purpose: identify and load an appropriate operating system kernel

  • pass to kernel command line interface
  • pass to kernel marshaled existing cfg (grub.cfg)

exit: hand off the kernel + jump to kernel entry point


Systemd (init like)

purpose: start and manage processes in user space after the kernel hands off

  • dependency graph: of scripts to run, ie. start ‘unit B only after A is ready’, similar to terraform graph, but this is a manual graph
  • unified config format: instead of shell scripts you get declarative .service unit files
  • process supervision: if a service fails you can automatically restart (trad init doesn’t do this)
  • manages more than just processes: mounts, sockets, timers, network, logging

it has a cli to interact with the services created bt the unit files systemctl

Note

The spam of [ OK ] & [ FAILED ] is systemd starting its units and printing the log (to view after entering user space journalctl -b)

Note

The initial shell you get is a systemd unit called getty

exit: system is fully booted, user space is running (login prompt / display manager)