Username: Save?
Password:
Home Forum Links Search Login Register*
    News: Keep The TechnoWorldInc.com Community Clean: Read Guidelines Here.
Recent Updates
[April 24, 2024, 11:48:22 AM]

[April 24, 2024, 11:48:22 AM]

[April 24, 2024, 11:48:22 AM]

[April 24, 2024, 11:48:22 AM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[February 14, 2024, 02:00:39 PM]
Subscriptions
Get Latest Tech Updates For Free!
Resources
   Travelikers
   Funistan
   PrettyGalz
   Techlap
   FreeThemes
   Videsta
   Glamistan
   BachatMela
   GlamGalz
   Techzug
   Vidsage
   Funzug
   WorldHostInc
   Funfani
   FilmyMama
   Uploaded.Tech
   MegaPixelShop
   Netens
   Funotic
   FreeJobsInc
   FilesPark
Participate in the fastest growing Technical Encyclopedia! This website is 100% Free. Please register or login using the login box above if you have already registered. You will need to be logged in to reply, make new topics and to access all the areas. Registration is free! Click Here To Register.
+ Techno World Inc - The Best Technical Encyclopedia Online! » Forum » THE TECHNO CLUB [ TECHNOWORLDINC.COM ] » Computer / Technical Issues » Operating Systems » Linux
  Boot Sequence in Linux
Pages: [1]   Go Down
  Print  
Author Topic: Boot Sequence in Linux  (Read 983 times)
Daniel Franklin
TWI Hero
**********


Karma: 3
Offline Offline

Posts: 16647


View Profile Email
Boot Sequence in Linux
« Posted: October 06, 2007, 09:22:17 AM »


Boot Sequence in Linux

1) BIOS 2) Master Boot Record (MBR) 3) LILO or GRUB 4) Kernel 5) init 6) Run Levels

1) BIOS

Load boot sector from one of:

Floppy

CDROM

Hard drive

The boot order can be changed from within the BIOS. BIOS setup can be entered by pressing a key during boot up. The exact key depends varies, but is often one of Del, F1, F2, or F10.

2)(DOS) Master Boot Record (MBR)

DOS in the context includes MS-DOS, Win95, and Win98.

BIOS loads and execute the first 512 bytes off the disk (/dev/hda)

Standard DOS MBR will:

look for a primary partition (/dev/hda1-4) marked bootable

load and execute first 512 bytes of this partition

can be restored with fdisk /mbr from DOS

3) LILO

does not understand filesystems

code and kernel image to be loaded is stored as raw disk offsets

uses the BIOS routines to load

Loading sequence

load menu code, typically /boot/boot.b

prompt for (or timeout to default) partition or kernel

for "image=" (ie Linux) option load kernel image

for "other=" (ie DOS) option load first 512 bytes of the partition

Reconfiguring LILO

One minute guide to installing a new kernel

copy kernel image (bzImage) and modules to /boot and /lib/modules

edit /etc/lilo.conf

duplicate image= section, eg:

image=/bzImage-2.4.14

label=14

read-only

man lilo.conf for details.Click here for manpage of lilo.conf

run /sbin/lilo

reboot to test

GRUB

Understands file systems

config lives in /boot/grub/menu.lst or /boot/boot/menu.lst

4)Kernel

initialise devices

(optionally loads initrd, see below)

mounts root filesystem

specified by lilo or loadin with root= parameter

kernel prints: VFS: Mounted root (ext2 filesystem) readonly.

runs /sbin/init which is process number 1 (PID=1)

init prints: INIT: version 2.76 booting

can be changed with boot= parameter to lilo, eg boot=/bin/sh can be useful to rescue a system which is having trouble booting.

initrd

Allows setup to be performed before root FS is mounted

lilo or loadlin loads ram disk image

kernel runs /linuxrc

load modules

initialise devices

/linuxrc exits

"real" root is mounted

kernel runs /sbin/init

Details in /usr/src/linux/Documentation/initrd.txt (part of the kernel source).

5) /sbin/init

reads /etc/inittab (see man inittab which specifies the scripts below for manpage click here)

Run boot scripts:

debian: run /etc/init.d/rcS which runs:

/etc/rcS.d/S* scripts

/etc/rc.boot/* (depreciated)

run programs specified in /etc/inittab

6)Run Levels

0 halt

1 single user

2 Full Multi-User mode (default)

3-5 Same as 2

6 Reboot

Default is defined in /etc/inittab, eg:

id:3:initdefault:

The current runlevel can be changed by running /sbin/telinit # where # is the new runlevel, eg typing telinit 6 will reboot.

Run Level programs

Scripts in /etc/rc*.d/* are symlinks to /etc/init.d

Scripts prefixed with S will be started when the runlevel is entered, eg /etc/rc5.d/S99xdm

Scripts prefixed with K will be killed when the runlevel is entered, eg /etc/rc6.d/K20apache

X11 login screen is typically started by one of S99xdm, S99kdm, or S99gdm.

Run programs for specified run level

/etc/inittab lines:

1:2345:respawn:/sbin/getty 9600 tty1

Always running in runlevels 2, 3, 4, or 5

Displays login on console (tty1)

2:234:respawn:/sbin/getty 9600 tty2

Always running in runlevels 2, 3, or 4

Displays login on console (tty2)

l3:3:wait:/etc/init.d/rc 3 Run once when switching to runlevel 3. Uses scripts stored in /etc/rc3.d/ ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now Run when control-alt-d

Articles Source - Free Articles
About the Author

Researcher

Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Copyright © 2006-2023 TechnoWorldInc.com. All Rights Reserved. Privacy Policy | Disclaimer
Page created in 0.256 seconds with 25 queries.