linux boot process

23
Linux Boot Process ~ Archana Chandrasekharan Email: [email protected]

Upload: archana-chandrasekharan

Post on 15-Jul-2015

189 views

Category:

Engineering


2 download

TRANSCRIPT

Linux Boot Process~ Archana Chandrasekharan

Email: [email protected]

Ever wondered what happens when you switch on your system until the Login Page of your Linux OS???

SMPS

● Switching Mode Power Supply● Converts AC to DC● Provides voltage to Motherboard

Bootstrapping

● Loads basic software into memory of computer

● Executes JUMP command● Tells the location of BIOS program in ROM

Steps towards a successful login page

Step 1: BIOS

● Basic Input/Output System● Executes MBR● Looks for Bootloader in HDD/external device

Step 2: MBR

● Found in /dev/sda or /dev/hda● Size: < 512 bytes● Contains info about GRUB● Executes GRUB bootloader

Step 3: GRUB

● GRand Unified Bootloader● Can choose which kernel to be executed● Displays a screen for a few seconds● Default kernel image: /boot/grub/grub.

cfg

grub.cfg

● GRUB configuration file● Has linux and initrd image

/initrd

● INITial RamDisk● Way to load RAMdisk using Bootloader

Step 4: Kernel

● Mounts the root file system● Executes /sbin/init

Step 5: init

● init daemon starts processes from /etc/inittab

● init identifies default init level and uses to load appropriate program

/etc/inittab

● id:rstate:action:process● id - identifier of the entry● rstate - lists the runlevels● action - which action to be taken● process - process to start, monitor or

restart if terminated

Run levels

6 run levels:● 0 - halt● 1 - Single user mode● 2 - Multiuser without NFS● 3 - Full Multiuser mode● 4 - unused● 5 - X11● 6 - Reboot

When not in quite mode, you can see a lot messages while booting.

These are the runlevel programs executed from the runlevel directory

Runlevel programs

● Run level 0 – /etc/rc.d/rc0.d/● Run level 1 – /etc/rc.d/rc1.d/● Run level 2 – /etc/rc.d/rc2.d/● Run level 3 – /etc/rc.d/rc3.d/● Run level 4 – /etc/rc.d/rc4.d/● Run level 5 – /etc/rc.d/rc5.d/

/etc/rc.d/rc*.d

● rc scripts are run control scripts● Programs which starts with S are used for

Startup● Programs which starts with K are used for

Shutdown

Next time when you boot remember me and these steps :P