SlideShare a Scribd company logo
Linux Booting Procedure
2
How Linux boot?
System startup
4
How computer startup?
 Booting is a bootstrapping process
that starts operating systems when
the user turns on a computer
system
 A boot sequence is the set of
operations the computer performs
when it is switched on that load an
operating system
5
Booting sequence
1. Tern on
2. CPU jump to address of BIOS (0xFFFF0)
3. BIOS runs POST (Power-On Self Test)
4. Find bootale devices
5. Loads and execute boot sector form MBR
6. Load OS
6
BIOS (Basic Input/Output System)
 BIOS refers to the software code run by a computer
when first powered on
 The primary function of BIOS is code program
embedded on a chip that recognises and controls
various devices that make up the computer.
BIOS on board
BIOS on screen
Boot loader
8
MBR (Master Boot Record)
 OS is booted from a hard disk, where the
Master Boot Record (MBR) contains the
primary boot loader
 The MBR is a 512-byte sector, located in
the first sector on the disk (sector 1 of
cylinder 0, head 0)
 After the MBR is loaded into RAM, the
BIOS yields control to it.
9
MBR (Master Boot Record)
10
MBR (Master Boot Record)
 The first 446 bytes are the primary boot
loader, which contains both executable
code and error message text
 The next sixty-four bytes are the partition
table, which contains a record for each of
four partitions
 The MBR ends with two bytes that are
defined as the magic number (0xAA55).
The magic number serves as a validation
check of the MBR
11
Extracting the MBR
 To see the contents of MBR, use this
command:
 # dd if=/dev/hda of=mbr.bin bs=512
count=1
 # od -xa mbr.bin
**The dd command, which needs to be run from
root, reads the first 512 bytes from /dev/hda (the
first Integrated Drive Electronics, or IDE drive) an
d writes them to the mbr.bin file.
**The od command prints the binary file in hex and
ASCII formats.
12
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.
13
Other boot loader (Several OS)
 bootman
 GRUB
 LILO
 NTLDR
 XOSL
 BootX
 loadlin
 Gujin
 Boot Camp
 Syslinux
 GAG
14
GRUB: GRand Unified Bootloader
 GRUB is an operating system independant
boot loader
 A multiboot software packet from GNU
 Flexible command line interface
 File system access
 Support multiple executable format
 Support diskless system
 Download OS from network
 Etc.
15
GRUB boot process
1. 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. GRUB Stage 1.5 is located in the first 30 kilobytes of
hard disk immediately following the MBR. Stage 1.5
loads Stage 2.
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.
16
Example GRUB config file
17
LILO: LInux LOader
 Not depend on a specific file system
 Can boot from harddisk and floppy
 Up to 16 different images
 Must change LILO when kernel
image file or config file is changed
Kernel
19
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
20
Task of kernel
 Process management
 Memory management
 Device management
 System call
21
Major functions flow for Linux kernel
boot
22
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
23
The Linux Init Processes
 The init process is identified by process id "1“
 Init is responsible for starting system processes
as defined in the /etc/inittab file
 Init typically will start multiple instances of
"getty" which waits for console logins which spaw
n one's user shell process
 Upon shutdown, init controls the sequence and
processes for shutdown
24
System processes
Process ID Description
0 The Scheduler
1 The init process
2 kflushd
3 kupdate
4 kpiod
5 kswapd
6 mdrecoveryd
25
Inittab file
 The inittab file describes which processes
are started at bootup and during normal
operation
 /etc/init.d/boot
 /etc/init.d/rc
 The computer will be booted to the
runlevel as defined by the initdefault
directive in the /etc/inittab file
 id:5:initdefault:
26
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
27
Runlevels
Runlev
el
Scripts
Directory
(Red Hat/Fedor
a Core)
State
0 /etc/rc.d/rc0.d/ shutdown/halt system
1 /etc/rc.d/rc1.d/ Single user mode
2 /etc/rc.d/rc2.d/ Multiuser with no network services exported
3 /etc/rc.d/rc3.d/ Default text/console only start. Full multiuser
4 /etc/rc.d/rc4.d/ Reserved for local use. Also X-windows (Slackware/
BSD)
5 /etc/rc.d/rc5.d/ XDM X-windows GUI mode (Redhat/System V)
6 /etc/rc.d/rc6.d/ Reboot
s or S Single user/Maintenance mode (Slackware)
M Multiuser mode (Slackware)
28
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 # represents the run level
29
init.d
 Deamon is a background process
 init.d is a directory that admin can
start/stop individual demons by cha
nging on it
 /etc/rc.d/init.d/ (Red Hat/Fedora )
 /etc/init.d/ (S.u.s.e.)
 /etc/init.d/ (Debian)
30
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 /etc/rc.d/init.d/
 (or /etc/init.d/ for S.u.s.e. and Debian)
 httpd stop
31
References
 http://en.wikipedia.org/
 http://www-
128.ibm.com/developerworks/linux/library/l-
linuxboot/
 http://yolinux.com/TUTORIALS/LinuxTutorialInitPr
ocess.html
 http://www.pycs.net/lateral/stories/23.html
 http://www.secguru.com/files/linux_file_structure
 http://www.comptechdoc.org/os/linux/
commands/linux_crfilest.html

More Related Content

What's hot (20)

PPTX
Linux kernel
Goutam Sahoo
 
PPTX
Booting Process OS
anilinvns
 
PDF
Linux Kernel Overview
Anil Kumar Pugalia
 
PDF
Embedded linux network device driver development
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
PPTX
Linux Kernel Booting Process (1) - For NLKB
shimosawa
 
PPTX
Boot process
Salman Memon
 
PDF
Linux systems - Linux Commands and Shell Scripting
Emertxe Information Technologies Pvt Ltd
 
PPTX
Slab Allocator in Linux Kernel
Adrian Huang
 
PPT
Intro to linux
Ravi Prakash Giri
 
PPT
Linux - Introductions to Linux Operating System
Vibrant Technologies & Computers
 
PPTX
U-Boot presentation 2013
Wave Digitech
 
PPTX
Linux booting Process
Gaurav Sharma
 
PPTX
Linux Initialization Process (1)
shimosawa
 
PPTX
Linux Device Tree
艾鍗科技
 
PPTX
Networking in linux
Varnnit Jain
 
PDF
Linux OS presentation
SahilGothoskar
 
PPTX
Linux booting process - Linux System Administration
Sreenatha Reddy K R
 
PPTX
Linux file system
Md. Tanvir Hossain
 
PPTX
qemu + gdb + sample_code: Run sample code in QEMU OS and observe Linux Kernel...
Adrian Huang
 
PPSX
Install ubuntu
pramoddps
 
Linux kernel
Goutam Sahoo
 
Booting Process OS
anilinvns
 
Linux Kernel Overview
Anil Kumar Pugalia
 
Embedded linux network device driver development
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
Linux Kernel Booting Process (1) - For NLKB
shimosawa
 
Boot process
Salman Memon
 
Linux systems - Linux Commands and Shell Scripting
Emertxe Information Technologies Pvt Ltd
 
Slab Allocator in Linux Kernel
Adrian Huang
 
Intro to linux
Ravi Prakash Giri
 
Linux - Introductions to Linux Operating System
Vibrant Technologies & Computers
 
U-Boot presentation 2013
Wave Digitech
 
Linux booting Process
Gaurav Sharma
 
Linux Initialization Process (1)
shimosawa
 
Linux Device Tree
艾鍗科技
 
Networking in linux
Varnnit Jain
 
Linux OS presentation
SahilGothoskar
 
Linux booting process - Linux System Administration
Sreenatha Reddy K R
 
Linux file system
Md. Tanvir Hossain
 
qemu + gdb + sample_code: Run sample code in QEMU OS and observe Linux Kernel...
Adrian Huang
 
Install ubuntu
pramoddps
 

Similar to Linux booting procedure (20)

PPT
Linux Booting Procedure system and networking.ppt
ubaidullah75790
 
PPTX
Bootloader and bootloading
Arpita Gupta
 
PPT
Linux Booting Process
Rishabh5121993
 
PPT
Linux Booting Steps
Anando Kumar Paul
 
PPTX
An Insight into the Linux Booting Process
Hardeep Bhurji
 
PPT
101 1.2 boot the system
Acácio Oliveira
 
PPTX
linux boot process ,kernal and file system
pethkarakash3898
 
PPTX
Linux startup
Amin Hashemi
 
PPTX
Order of boot process in Linux
Siddhesh Palkar
 
DOCX
6 stages of linux boot process
Hari Shankar
 
DOC
6 stages of linux boot process
sagarpdalvi
 
PPTX
Linux booting sequence
kuldeep singh shishodia
 
PPTX
introduction to computer Linux essential.pptx
musomicatherine
 
PDF
Grub2 Booting Process
Mike Wang
 
PDF
Understanding The Boot Process
Dom Cimafranca
 
PDF
Linux admin course
Manikanta Pushadapu
 
PPTX
Linux basics
suniljosekerala
 
PPTX
Linux basics
suniljosekerala
 
PPTX
Bootloaders (U-Boot)
Omkar Rane
 
PPT
Ch04 system administration
Raja Waseem Akhtar
 
Linux Booting Procedure system and networking.ppt
ubaidullah75790
 
Bootloader and bootloading
Arpita Gupta
 
Linux Booting Process
Rishabh5121993
 
Linux Booting Steps
Anando Kumar Paul
 
An Insight into the Linux Booting Process
Hardeep Bhurji
 
101 1.2 boot the system
Acácio Oliveira
 
linux boot process ,kernal and file system
pethkarakash3898
 
Linux startup
Amin Hashemi
 
Order of boot process in Linux
Siddhesh Palkar
 
6 stages of linux boot process
Hari Shankar
 
6 stages of linux boot process
sagarpdalvi
 
Linux booting sequence
kuldeep singh shishodia
 
introduction to computer Linux essential.pptx
musomicatherine
 
Grub2 Booting Process
Mike Wang
 
Understanding The Boot Process
Dom Cimafranca
 
Linux admin course
Manikanta Pushadapu
 
Linux basics
suniljosekerala
 
Linux basics
suniljosekerala
 
Bootloaders (U-Boot)
Omkar Rane
 
Ch04 system administration
Raja Waseem Akhtar
 
Ad

More from Dhaval Kaneria (20)

PPT
Swine flu
Dhaval Kaneria
 
PDF
Introduction of Xcode
Dhaval Kaneria
 
PPT
Objective-C for iOS Application Development
Dhaval Kaneria
 
PPTX
Gpu with cuda architecture
Dhaval Kaneria
 
PPT
Introduction to data structures and Algorithm
Dhaval Kaneria
 
PPT
Introduction to data structures and Algorithm
Dhaval Kaneria
 
PPTX
HDMI
Dhaval Kaneria
 
PPTX
Hdmi
Dhaval Kaneria
 
PPTX
open source hardware
Dhaval Kaneria
 
PPT
Serial Peripheral Interface(SPI)
Dhaval Kaneria
 
PDF
Linux booting procedure
Dhaval Kaneria
 
PDF
Manage Xilinx ISE 14.5 licence for Windows 8 and 8.1
Dhaval Kaneria
 
DOCX
VERILOG CODE
Dhaval Kaneria
 
PDF
8 bit single cycle processor
Dhaval Kaneria
 
PDF
Paper on Optimized AES Algorithm Core Using FeedBack Architecture
Dhaval Kaneria
 
PDF
PAPER ON MEMS TECHNOLOGY
Dhaval Kaneria
 
PPTX
VIdeo Compression using sum of Absolute Difference
Dhaval Kaneria
 
PPTX
Mems technology
Dhaval Kaneria
 
PPT
Network security
Dhaval Kaneria
 
PPT
Token bus standard
Dhaval Kaneria
 
Swine flu
Dhaval Kaneria
 
Introduction of Xcode
Dhaval Kaneria
 
Objective-C for iOS Application Development
Dhaval Kaneria
 
Gpu with cuda architecture
Dhaval Kaneria
 
Introduction to data structures and Algorithm
Dhaval Kaneria
 
Introduction to data structures and Algorithm
Dhaval Kaneria
 
open source hardware
Dhaval Kaneria
 
Serial Peripheral Interface(SPI)
Dhaval Kaneria
 
Linux booting procedure
Dhaval Kaneria
 
Manage Xilinx ISE 14.5 licence for Windows 8 and 8.1
Dhaval Kaneria
 
VERILOG CODE
Dhaval Kaneria
 
8 bit single cycle processor
Dhaval Kaneria
 
Paper on Optimized AES Algorithm Core Using FeedBack Architecture
Dhaval Kaneria
 
PAPER ON MEMS TECHNOLOGY
Dhaval Kaneria
 
VIdeo Compression using sum of Absolute Difference
Dhaval Kaneria
 
Mems technology
Dhaval Kaneria
 
Network security
Dhaval Kaneria
 
Token bus standard
Dhaval Kaneria
 
Ad

Linux booting procedure

  • 4. 4 How computer startup?  Booting is a bootstrapping process that starts operating systems when the user turns on a computer system  A boot sequence is the set of operations the computer performs when it is switched on that load an operating system
  • 5. 5 Booting sequence 1. Tern on 2. CPU jump to address of BIOS (0xFFFF0) 3. BIOS runs POST (Power-On Self Test) 4. Find bootale devices 5. Loads and execute boot sector form MBR 6. Load OS
  • 6. 6 BIOS (Basic Input/Output System)  BIOS refers to the software code run by a computer when first powered on  The primary function of BIOS is code program embedded on a chip that recognises and controls various devices that make up the computer. BIOS on board BIOS on screen
  • 8. 8 MBR (Master Boot Record)  OS is booted from a hard disk, where the Master Boot Record (MBR) contains the primary boot loader  The MBR is a 512-byte sector, located in the first sector on the disk (sector 1 of cylinder 0, head 0)  After the MBR is loaded into RAM, the BIOS yields control to it.
  • 10. 10 MBR (Master Boot Record)  The first 446 bytes are the primary boot loader, which contains both executable code and error message text  The next sixty-four bytes are the partition table, which contains a record for each of four partitions  The MBR ends with two bytes that are defined as the magic number (0xAA55). The magic number serves as a validation check of the MBR
  • 11. 11 Extracting the MBR  To see the contents of MBR, use this command:  # dd if=/dev/hda of=mbr.bin bs=512 count=1  # od -xa mbr.bin **The dd command, which needs to be run from root, reads the first 512 bytes from /dev/hda (the first Integrated Drive Electronics, or IDE drive) an d writes them to the mbr.bin file. **The od command prints the binary file in hex and ASCII formats.
  • 12. 12 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.
  • 13. 13 Other boot loader (Several OS)  bootman  GRUB  LILO  NTLDR  XOSL  BootX  loadlin  Gujin  Boot Camp  Syslinux  GAG
  • 14. 14 GRUB: GRand Unified Bootloader  GRUB is an operating system independant boot loader  A multiboot software packet from GNU  Flexible command line interface  File system access  Support multiple executable format  Support diskless system  Download OS from network  Etc.
  • 15. 15 GRUB boot process 1. 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. GRUB Stage 1.5 is located in the first 30 kilobytes of hard disk immediately following the MBR. Stage 1.5 loads Stage 2. 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.
  • 17. 17 LILO: LInux LOader  Not depend on a specific file system  Can boot from harddisk and floppy  Up to 16 different images  Must change LILO when kernel image file or config file is changed
  • 19. 19 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
  • 20. 20 Task of kernel  Process management  Memory management  Device management  System call
  • 21. 21 Major functions flow for Linux kernel boot
  • 22. 22 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
  • 23. 23 The Linux Init Processes  The init process is identified by process id "1“  Init is responsible for starting system processes as defined in the /etc/inittab file  Init typically will start multiple instances of "getty" which waits for console logins which spaw n one's user shell process  Upon shutdown, init controls the sequence and processes for shutdown
  • 24. 24 System processes Process ID Description 0 The Scheduler 1 The init process 2 kflushd 3 kupdate 4 kpiod 5 kswapd 6 mdrecoveryd
  • 25. 25 Inittab file  The inittab file describes which processes are started at bootup and during normal operation  /etc/init.d/boot  /etc/init.d/rc  The computer will be booted to the runlevel as defined by the initdefault directive in the /etc/inittab file  id:5:initdefault:
  • 26. 26 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
  • 27. 27 Runlevels Runlev el Scripts Directory (Red Hat/Fedor a Core) State 0 /etc/rc.d/rc0.d/ shutdown/halt system 1 /etc/rc.d/rc1.d/ Single user mode 2 /etc/rc.d/rc2.d/ Multiuser with no network services exported 3 /etc/rc.d/rc3.d/ Default text/console only start. Full multiuser 4 /etc/rc.d/rc4.d/ Reserved for local use. Also X-windows (Slackware/ BSD) 5 /etc/rc.d/rc5.d/ XDM X-windows GUI mode (Redhat/System V) 6 /etc/rc.d/rc6.d/ Reboot s or S Single user/Maintenance mode (Slackware) M Multiuser mode (Slackware)
  • 28. 28 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 # represents the run level
  • 29. 29 init.d  Deamon is a background process  init.d is a directory that admin can start/stop individual demons by cha nging on it  /etc/rc.d/init.d/ (Red Hat/Fedora )  /etc/init.d/ (S.u.s.e.)  /etc/init.d/ (Debian)
  • 30. 30 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 /etc/rc.d/init.d/  (or /etc/init.d/ for S.u.s.e. and Debian)  httpd stop
  • 31. 31 References  http://en.wikipedia.org/  http://www- 128.ibm.com/developerworks/linux/library/l- linuxboot/  http://yolinux.com/TUTORIALS/LinuxTutorialInitPr ocess.html  http://www.pycs.net/lateral/stories/23.html  http://www.secguru.com/files/linux_file_structure  http://www.comptechdoc.org/os/linux/ commands/linux_crfilest.html