Linux Booting Procedure
Linux Booting Procedure
Linux Booting Procedure
System startup
Booting sequence
1.
2.
3.
4.
5
5.
6.
Tern on
CPU jump to address of BIOS (0xFFFF0)
BIOS runs POST (Power-On Self Test)
Find bootale devices
Loads and execute boot sector form MBR
Load OS
BIOS on board
Enabling the ARM Learning in INDIA
BIOS on screen
Boot loader
Boot loader could be more aptly called the kernel loader. The
task at this stage is to load the Linux kernel
Optional, initial RAM disk
GRUB and LILO are the most popular Linux boot loader.
bootman
GRUB
LILO
NTLDR
XOSL
BootX
loadlin
Gujin
Boot Camp
Syslinux
GAG
The BIOS finds a bootable device (hard disk) and transfers control to
the master boot record
2.
The MBR contains GRUB stage 1. Given the small size of the MBR,
Stage 1 just load the next stage of GRUB
3.
4.
GRUB Stage 2 receives control, and displays to the user the GRUB boot
menu (where the user can manually specify the boot parameters).
5.
GRUB loads the user-selected (or default) kernel into memory and
passes control on to the kernel.
Kernel image
The kernel is the central part in most computer operating
systems because of its task, which is the management of the
system's resources and the communication between hardware
and software components
Kernel is always store on memory until computer is tern off
Kernel image is not an executable kernel, but a compress
kernel image
zImage size less than 512 KB
bzImage size greater than 512 KB
Task of kernel
Process management
Memory management
Device management
S t
System
callll
Init process
The first thing the kernel does is to execute init program
Init is the root/parent of all processes executing on Linux
The first processes that init starts is a script
/etc/rc.d/rc.sysinit
Based on the appropriate run-level, scripts are executed to
start various processes to run the system and make it
functional
System processes
Process ID
0
1
2
3
4
5
6
Enabling the ARM Learning in INDIA
Description
The Scheduler
The init process
kflushd
kupdate
kpiod
kswapd
mdrecoveryd
Inittab file
The inittab file describes which processes are
started at bootup and during normal operation
/etc/init.d/boot
/etc/init.d/rc
Th
The computer will
ill b
be b
booted
d to the
h runlevel
l l as
defined by the initdefault directive in the
/etc/inittab file
id:5:initdefault:
Runlevels
A runlevel is a software configuration of the
system which allows only a selected group of
processes to exist
The processes spawned by init for each of
these runlevels are defined in the /etc/inittab
file
Init can be in one of eight runlevels: 0-6
Runlevels
Scripts Directory
(Red Hat/Fedora
Core)
State
/etc/rc.d/rc0.d/
shutdown/halt system
/etc/rc.d/rc1.d/
/etc/rc.d/rc2.d/
/etc/rc.d/rc3.d/
/etc/rc.d/rc4.d/
/etc/rc.d/rc5.d/
/etc/rc.d/rc6.d/
Reboot
s or S
rc#.d files
rc#.d files are the scripts for a given run level
that run during boot and shutdown
The scripts are found in the directory
/etc/rc d/rc# d/ where the symbol #
/etc/rc.d/rc#.d/
represents the run level
init.d
Deamon is a background process
init.d is a directory that admin can start/stop
individual demons by changing on it
/etc/rc.d/init.d/
/etc/rc d/init d/ (Red Hat/Fedora )
/etc/init.d/ (S.u.s.e.)
/etc/init.d/ (Debian)
Start/stop deamon
Admin can issuing the command and either
the start, stop, status, restart or reload option
i.e. to stop the web server:
cd
d /etc/rc.d/init.d/
/ t / d/i it d/
(or /etc/init.d/ for S.u.s.e. and Debian)
httpd stop
http://www.secguru.com/files/linux_file_structure
Enabling the ARM Learning in INDIA
file
lib - Files that change while the system is running normally
local - Variable data for programs installed in /usr/local.
lock - Lock files. Used by a program to indicate it is using a particular device
or file
log - Log files from programs such as login and syslog which logs all logins and
logouts.
run - Files that contain information about the system that is valid until the
system is next booted
spool - Directories for mail, printer spools, news and other spooled work.
tmp - Temporary files that are large or need to exist for longer than they
should in /tmp.
catman - A cache for man pages that are formatted on demand