[Home] [Credit Search] [Category Browser] [Staff Roll Call] | The LINUX.COM Article Archive |
Originally Published: Tuesday, 4 September 2001 | Author: Siddharth Khosla |
Published to: learn_articles_firststep/General | Page: 1/1 - [Std View] |
The Linux Boot Process on the i386
Take another look at exactly what happens to your system during the boot process. Understanding the boot process is critical to understanding good useage and administration practices.
|
The MBR then looks for the first active partition in the drive. This active partition contains in its initial sectors what is known as a boot record. This boot record contains instructions on how to load the Boot Loader, which is a program used to load the particular OS. For Linux the boot loader is called the LInux LOader or LILO for short. As soon as the BIOS finds the LILO it runs it and control is passed on to the LILO.
All these parameters: the timeout time, the OS labels, the default OS to boot and the type of disk etc are specified in a file called the LILO.conf. Thus for any changes to the LILO the lilo.conf file has to be changed. Now as we are looking into the linux boot process we consider that LILO starts to boot Linux. On booting Linux the first thing that LILO does is look for the boot kernel of Linux which is a file by the name of vmlinuz-22.15 ...and some version number. This file is found in the /boot directory. When vmlinuz is found LILO's role in the boot process ends and control is passed to the kernel.
1.init.d 2.rc0.d 3.rc1.d 4.rc2.d 5.rc3.d 6.rc4.d 7.rc5.d 8.rc6.d
The init.d directory contains the scripts to run at various runlevels. The rc
Linux has in all six runlevels which are various kinds of modes the OS works in. Each runlevel has a different kind of mode which ends its booting sequence depending upon the preference of the user. The various runlevels are given below and would clear any doubt you have about them:
The etc/inittab file has a line towards the top that looks something like:
The etc/rc.d/rc also starts the default system processes and checks for the default rc directory for that particular runlevel. This can be ascertained by the numbers on the directories in etc/rc.d etc/rc.d/rc<n>.d where <n> is the runlevel.
There are a number of scripts that are started at different runlevels. You can have a list of these scripts if you check out the contents of the corresponding rc.d directory for that runlevel. the contents of this directory are not files but links to the required scripts in the /etc/rc.d/init.d directory. When these scripts are run the boot process is almost complete. As soon as the runlevel scripts are run the /etc/inittab starts the getty process which then shows the virtual console or the login prompt.
This file may be mirrored along with the site by obtaining permission from the
author. The electronic version of the paper is available free; you can print and
distribute it without making any changes and as long as this page is
included.
Corrections would greatly appreciated; please send them to
sid@sidkhosla.com/ob_stinatesid@hotmail.com
Siddharth Khosla
B. Tech (CSE)
Punjabi University
Patiala
India.
http://www.sidkhosla.com/papersഊ
Dedicated to:
My Family and Friends.ഊ
/etc/inittab
This file describes the way the system should be setup at different runlevels. It also specifies the default runlevels. The question that may come to your mind now might be,"what the heck is a runlevel?"
Runlevel Mode
0 Halt
1 Single User
2 Multi User w/o Networking
3 Full multi user mode
4 Free / not used
5 Full multi user (X Based GUI)
6 Reboot
id:
Changing Runlevels
Whenever runlevel changes the etc/rc.d/rc starts and stops the services for the particular set of runlevels. The same file also sets the source function library which tells the kernel how to start /Kill for various processes.
References
Http://www.redhat.com
Red Hat Linux Unleashed - Techmedia
The official Red Hat reference guide.