If your web browser formats this page incorrectly, try viewing the
page source. In netscape 4, click the view menu, then click page source.
How Linux boots and loads:
lilo or loadlin or some other loader program copies the kernel image file
from the hard drive or network into memory, passes a command line to the
kernel, and runs the kernel.
If the kernel is compressed, the uncompression program runs, uncompresses
the kernel, and runs the kernel.
The kernel checks the command line it received from the loader program. The
kernel looks for something like 'init=foo' in the command line; then the
kernel runs the program specified by 'init='. If the kernel did not find
'init=' in the command line, then the kernel runs the default init, which is
probably /sbin/init.
If you do not like init, if you do not like being required to login before
you can use your computer, if you want the shell to start right away when
you turn on the computer like in DOS, then add 'init=/bin/bash' to the
kernel command line. If you have some kind of a boot prompt, where you
select how to boot the computer; then you should add a boot method with
'init=/bin/bash' because this is useful in emergencies when /etc/inittab or
the password file has been corrupted.
The configuration file for /sbin/init is usually named /etc/inittab.
/sbin/init reads /etc/inittab and does whatever /etc/inittab says to do.
See man init and man inittab. /etc/inittab usually says to run one or more
scripts. The scripts set environment data, initialize drivers, mount drives,
enable swap, and start programs which run all the time in the background,
like crond, atd, kerneld, and syslogd; such programs are called daemons. The
scripts usually have names like /etc/rc, or /etc/rc.d/rc.local, or
/etc/sysconfig. /etc/inittab usually also says to run several getty
programs, which might be /etc/agetty, /sbin/mgetty, or something like that.
/etc/inittab usually says to run one getty program for each terminal; there
are different getty programs for different kinds of terminals.
Each getty program runs login. The default name of the login program is
compiled into the getty program, and is usually /sbin/login. getty or login
prompts the user for the username/login and password. If the usrname/login
and password are correct, login gets the name of the user's shell from the
password file and runs the user's shell. Login or the user's shell sets
$HOME. The user's shell runs the user's personal configuration programs.