Intro

Boot Process Linux Focused (BSD differs)

Overview

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

BIOS/UEFI

purpose: initializes and enumerates hardware

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

exit: hand off execution to a bootloader

Commands

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

Bootloader

purpose: identify and load an appropriate operating system kernel

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

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

Systemd (init like)

purpose: start and manage processes in userspace after the kernal 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 declartive .service unit files
  • process supervision: if a service fails you can automatically restart (trad init doesnt 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

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

the initial shell you get is a systemd unit called getty

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