Booting process of Linux

The Linux booting process involves multiple stages and is in many ways similar to the BSD and other Unix-style boot processes, from which it derives. Although the Linux booting process depends very much on the computer architecture, those architectures share similar stages and software components,[1] including system startup, bootloader execution, loading and startup of a Linux kernel image, and execution of various startup scripts and daemons.[2] Those are grouped into 4 steps: system startup, bootloader stage, kernel stage, and init process.[3] When a Linux system is powered up or reset, its processor will execute a specific firmware/program for system initialization, such as the power-on self-test, invoking the reset vector to start a program at a known address in flash/ROM (in embedded Linux devices), then load the bootloader into RAM for later execution.[2] In IBM PC–compatible personal computers (PCs), this firmware/program is either a BIOS or a UEFI monitor, and is stored in the mainboard.[2] In embedded Linux systems, this firmware/program is called boot ROM.[4][5] After being loaded into RAM, the bootloader (also called first-stage bootloader or primary bootloader) will execute to load the second-stage bootloader[2] (also called secondary bootloader).[6] The second-stage bootloader will load the kernel image into memory, decompress and initialize it, and then pass control to this kernel image.[2] The second-stage bootloader also performs several operation on the system such as system hardware check, mounting the root device, loading the necessary kernel modules, etc.[2] Finally, the first user-space process (init process) starts, and other high-level system initializations are performed (which involve with startup scripts).[2]

For each of these stages and components, there are different variations and approaches; for example, GRUB, coreboot or Das U-Boot can be used as bootloaders (historical examples are LILO, SYSLINUX or Loadlin), while the startup scripts can be either traditional init-style, or the system configuration can be performed through modern alternatives such as systemd or Upstart.

  1. ^ M. Tim Jones 2006, "Introduction", "The process of booting a Linux® system consists of a number of stages. But whether you're booting a standard x86 desktop or a deeply embedded PowerPC® target, much of the flow is surprisingly similar."
  2. ^ a b c d e f g M. Tim Jones 2006, "Overview", "Figure 1. The 20,000-foot view of the Linux boot process"
  3. ^ M. Tim Jones 2006, "Linux booting process are grouped into 4 stages, based on IBM source"
  4. ^ Bin, Niu; Dejian, Li; Zhangjian, LU; Lixin, Yang; Zhihua, Bai; Longlong, He; Sheng, Liu (August 2020). "Research and design of Bootrom supporting secure boot mode". 2020 International Symposium on Computer Engineering and Intelligent Communications (ISCEIC). pp. 5–8. doi:10.1109/ISCEIC51027.2020.00009. ISBN 978-1-7281-8171-4. S2CID 231714880.
  5. ^ Alberto Liberal De Los Ríos 2017, p. 28, , "Linux Boot Process".
  6. ^ M. Tim Jones 2006, , "Stage 1 boot loader".