os cheatsheet.txt 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. Booting:
  2. - Power on is pressed.
  3. - CPU initializes itself and loads the 1st instruction (jump) from BIOS (or
  4. UEFI etc.) ROM (nowadays it's a rewriteable flash memory).
  5. - BIOS (Basic I/O System, specific to motherboard) loads, inits and tests
  6. hardware, lists available boot devices (HDD, CD, USB, ...) and selects one
  7. (BIOS used to be the abstraction for HW, but nowadays OS accesses HW
  8. directly.)
  9. - The boot device's first 512 bytes are MBR (Master Boot Record), which
  10. contains information about partitions of the device, plus a small
  11. executable code for loading an OS, called boot loader. Boot loader now
  12. gets executed. (Common boot loader is e.g. GRUB.)
  13. - Boot loader proceeds to load further boot loader stages from further
  14. device storage that will not be constrained by size that much. Normally
  15. stage 1.5 is loaded, then stage 2, but stage 2 can sometimes be loaded
  16. directly. These stages can include giving the user the choice of OS to
  17. load etc. Boot loader doesn't need drivers to access the file system
  18. because it can use BIOS's interface (can have lower performance).
  19. - Stage 2 of the boot loader loads the kernel itself (again can give
  20. the user the choice of kernel).
  21. - Kernel starts running, configures HW, loads drivers, mounts the root
  22. of the file system and runs the init process.
  23. Firmware:
  24. Runs on computer start, initializes HW and provides some basic services to SW
  25. (hard drive I/O, keyboard, display, ...) via given interface (interrupts).
  26. BIOS (Basic I/O System) - Old de facto standard by IBM, first proprietary,
  27. later reverse engineered. It has limitations, e.g. only 16bit CPU mode, only
  28. addresses 1 MB of RAM etc. Proprietary implementation exist as well as free
  29. ones (e.g. SeaBIOS).
  30. UEFI (Unified Extensible Firmware Interface) - A specification, new
  31. replacement for BIOS. Is more bloated, needs more memory and has a bigger
  32. feature creep (network capability, distant diagnostics, cryptography, big
  33. GUI etc.). Has proprietary and free implementations.
  34. coreboot (aka LinuxBIOS) - Free implementation of BIOS, uses proprietary
  35. blobs, like Linux.
  36. libreboot - Variant of coreboot without proprietary blobs (like Linux libre is
  37. to Linux). It is minimal and lightweight.
  38. Init:
  39. 1st OS process started after booting, runs as a daemon as long as the system
  40. is up.
  41. sysvinit
  42. systemd
  43. sinit
  44. Executable format:
  45. ELF