Linux Booting A Typical PC boot POST Power
Linux Booting
A Typical PC boot POST (Power on self test) Boot loader (grub, lilo) Kernel Init RC startup scripts
What a Kernel Does?
Logins, Gettys and shells A getty is a program that spawns a login program. Gettys are “generally” spawned from init. A shell is the program that the users interact directly with. A shell provides the user with a command prompt.
init When it starts up, init reads the /etc/inittab configuration file. While the system is running, it will re−read it, if sent the HUP signal (kill − 1 1 ); this feature makes it unnecessary to boot the system to makechanges to the init configuration take effect. The /etc/inittab file is a bit complicated. We'll start with the simple case of configuring getty lines.
General Syntax of inittab id: runlevels: action: process 1: 2345: respawn: /sbin/getty 9600 tty 1 Id-This identifies the line in the file. For getty lines, it specifies the terminal it runs on (the characters after /dev/tty in the device file name). For other lines, it doesn't matter, but it should be unique. Runlevels-The run levels the line should be considered for. The run levels are given as single digits, without delimiters.
General Syntax of inittab Con’t Action- What action should be taken by the line, IE), respawn to run the command in the next field again, when it exits, or once to run it just once. Process- The command to run.
Linux Run Levels 0 Halt the system. 1 Single−user mode (for special administration). 2 Local Multiuser with Networking but without network service. 3 Full Multiuser with Networking 4 Not Used 5 Full Multiuser with Networking and X (GUI) 6 Reboot.
RC Startup Scripts In each run−level you will find a series of scripts that are run on boot up. The location of these scripts will vary between Linux distributions Generally the first script that is executed is rc. K or rc. S.
RC Startup scripts (Slackware) /etc/rc. d/ rc. 0@ rc. 4* rc. 6* rc. K* rc. M* rc. S* rc. acpid* Rc. alsa* rc. atalk rc. bind rc. cups rc. dnsmasq rc. font. new* rc. hotplug* rc. httpd rc. inet 1* rc. inet 1. conf rc. inet 2* rc. inetd* rc. ip_forward rc. local* rc. modules* rc. mysqld rc. nfsd* rc. pcmcia* rc. portmap rc. samba rc. saslauthd rc. sendmail* rc. serial* rc. sshd* rc. syslog* rc. sysvinit* rc. udev rc. wireless* rc. wireless. co nf rc. yp*
Select “Important” Scripts rc. 0 - Runlevel 0 rc. inet 2 -Network Service rc. 4 - Runlevel 4 rc. 6 - Runlevel 6 rc. nfsd- Network File System rc. K- Single User rc. M- Multi-user rc. pcmcia-PC support rc. syslog- System log rc. S- System rc. bind- DNS Server rc. cups-Print Server rc. inet 1 -Network Config
- Slides: 11