summaryrefslogtreecommitdiffstats
path: root/topics/boot.txt
blob: 3d03935d77b3a169aab6d36777aff33d7ab57d02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
BIOS
	firmware image on ROM chip
		ROM is either a dual in-line package or plastic leaded chip carrier
	POST
	initializes HW, e.g. memory, video card, keyboard, USB hosts
	finds a bootable device (HDD, ODD, USB flash drive, etc.)
	reads MBR and executes stage 1 boot loader
boot loader, e.g. GNU GRUB
	may offer user OS list and/or some other interactive IX (e.g. CLI)
	will load a kernel, e.g. Linux, into memory and begin its execution
Linux
	initializes memory, interrupts, etc.
	may mount initial ramdisk
	loads and schedules init and kernel threads
initial ramdisk
	finds root filesystem
	loads required drivers and runs required utilities to mount root fs
		e.g. for RAID, LVM2, ext4
	checks for a suspend-to-disk virtual memory image and resumes if found
	look at initrd on Debian:
		$ gunzip -c /boot/initrd.img-`uname -r` | cpio --extract
		warning: will extract to current working directory
init
	multiple implementations
		GNU/Linux:
			System V-style init
			systemd
			Upstart
			runit
			OpenRC
			Initng
		BSDs:
			own lightweight and modular daemon
		BusyBox/Linux:
			own lightweight daemon
	SysV-style:
		runlevels
			0 - halt
			1 - single-user mode
			2-5 - multi-user mode
			6 reboot
		reads /etc/inittab
			default runlevel
			actions of runlevels
			Ctrl+Alt+Del behavior
			programs to control TTYs (e.g. /sbin/getty)
			etc.
		runs initialization scripts
			`/etc/rcN.d/* start`, where N = runlevel
			links to /etc/init.d/*
			cron, servers, ACPI daemon, Network Manager, DMs, etc.
getty
	prints /etc/issue, unless disabled
	prompts for username
	calls /bin/login
login
	prompts for password
	loads user environment
	starts user's default shell (e.g. /bin/bash)
display manager
	starts X.org server
	prompts for user name and password
	starts window manager and desktop shell