Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How Linux boots?

After you switch on? by krischrist
Posted: 1 Aug 01

I came to know this from the How-To's in www.justlinux.com.
The following a short sumamry of what happens when you boot up Linux.

1.After you switch on.
                 When the computer is switched on it test's itself if everything is working properly.This is called "Power self test".Then a program which is located in the ROM BIOS of your computer called the bootstrap loader looks for a boot sector.A boot sector is the first sector of a disk and has a small program that can load an operating system.Boot sectors are marked with a magic number eg.
OxAA55=43603 at byte Ox1FE.This is how the hardware can tell whether the sector is a boot sector or not.

3.Places to look for bootstrap loader.
                        The bootstrap loader looks at a list of places to look foir the boot sector.Older machines looks in the primary floppy drive, then the primary hardrive, nowdays newer machines also accesses the CD-ROM drive.
4.After that.
                Once a boot sector is found it loads it into the memory and passes control to the program that loads the operating system.In Linux this program will be LILO's first stage boot loader.
Its job is to only load and run the "second stage boot loader".This stage loader gives a prompt and loads the operating system you choose.
The LILO is actually a map installer, this reads the configuration file /etc/lilo.conf and writes the boot loaders and information about the operating system it can load to the hard disk.
After this init is loaded.

5. Init
Linux systems mostly use "System V" style of init.The init loads everything. It checks that the file systems are ok mounts them.It starts up daemons ,do networking , serve webpages and also starts the getty processes.
Init reads a file /etc/inittab, which tells it what to do.The first thing it does is to run the initialization script.Bash is the program that executes this script. On Redhat Linux this script is /etc/rc.d/rc.sysinit and in Debian systems it is /etc/init.d/rcS. The file systems are checked,  partitions are mounted etc.

After this another script is executed which takes us into the default run-level.The subsystems are started in this run-level.There is a set of directories /etc/rc.d/rc0.d, /etc/rc.d/rc1.d,... in Redhat Linux and /etc/rc0.d,/etc/rc1.d,.. etc in Debian, which corresponds to different run-levels. If the run-level 3 starts up in Debian then all the scripts in /etc/rc3.d that start with 'S' are executed.These scripts are links to scripts in a directory called init.d.
When a run-level script is called by init ,it then looks in a directory for scripts starting with 'S'.For eg. S10syslog runs first since there are no scripts starting with S00.S01 etc.

Thats it.
More topics to come...

Back to Linux (server) FAQ Index
Back to Linux (server) Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close