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)
and 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
spawn 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
Runlevel Scripts Directory
(Red Hat/Fedora
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
changing 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/LinuxTutorialInitProc
ess.html
 http://www.pycs.net/lateral/stories/23.html
 http://www.secguru.com/files/linux_file_structure
 http://www.comptechdoc.org/os/linux/commands/linu
x_crfilest.html
Linux booting procedure

More Related Content

PDF
Part 02 Linux Kernel Module Programming
PPT
U Boot or Universal Bootloader
PPTX
Booting Process OS
PPTX
Sistemi operativi
PDF
U-Boot - An universal bootloader
PPT
Linux Booting Steps
PPTX
Bootloaders (U-Boot)
PPTX
System Booting Process overview
Part 02 Linux Kernel Module Programming
U Boot or Universal Bootloader
Booting Process OS
Sistemi operativi
U-Boot - An universal bootloader
Linux Booting Steps
Bootloaders (U-Boot)
System Booting Process overview

What's hot (20)

PPTX
U-Boot presentation 2013
PPTX
Linux Device Driver’s
PPTX
Linux booting process
PPTX
Linux Boot Process
PPTX
Secure boot general
PPTX
Particion disco duro
PDF
Linux Internals - Interview essentials - 1.0
PPTX
Linux booting Process
PPTX
What is Bootloader???
PDF
Boot process: BIOS vs UEFI
PDF
ARQUITECTURA Y MANTENIMIENTO
PPTX
An Insight into the Linux Booting Process
PDF
Dokumentacja techniczna stanowiska komputerowego
PPTX
Unix- the process
PPT
Synchronization linux
DOC
OPERATING SYSTEM - SHORT NOTES
PDF
SFO15-200: Linux kernel generic TEE driver
PPTX
Interrupciones
PDF
Introduction to Modern U-Boot
U-Boot presentation 2013
Linux Device Driver’s
Linux booting process
Linux Boot Process
Secure boot general
Particion disco duro
Linux Internals - Interview essentials - 1.0
Linux booting Process
What is Bootloader???
Boot process: BIOS vs UEFI
ARQUITECTURA Y MANTENIMIENTO
An Insight into the Linux Booting Process
Dokumentacja techniczna stanowiska komputerowego
Unix- the process
Synchronization linux
OPERATING SYSTEM - SHORT NOTES
SFO15-200: Linux kernel generic TEE driver
Interrupciones
Introduction to Modern U-Boot
Ad

Viewers also liked (16)

PPT
Booting Process
PDF
Armboot process zeelogic
PDF
Linux introduction Class 02
PDF
Linux : Booting and runlevels
PDF
Embedded_Linux_Booting
PPTX
PPT
Linux installation and booting process
PPTX
Linux Kernel Booting Process (1) - For NLKB
PPTX
Bootloader and bootloading
PPTX
Linux booting process!!
PPTX
Linux boot process
ODP
CLUG 2010 09 - systemd - the new init system
PPTX
Linux booting process - Linux System Administration
PDF
Understanding The Boot Process
PPT
Booting Process
Armboot process zeelogic
Linux introduction Class 02
Linux : Booting and runlevels
Embedded_Linux_Booting
Linux installation and booting process
Linux Kernel Booting Process (1) - For NLKB
Bootloader and bootloading
Linux booting process!!
Linux boot process
CLUG 2010 09 - systemd - the new init system
Linux booting process - Linux System Administration
Understanding The Boot Process
Ad

Similar to Linux booting procedure (20)

PPT
Linux booting procedure
PPT
Linux Booting Procedure system and networking.ppt
PPT
Linux Booting Process
DOCX
6 stages of linux boot process
DOCX
6 stages of linux boot process
DOC
6 stages of linux boot process
DOCX
6 stages of linux boot process
PPTX
Order of boot process in Linux
PPTX
Linux startup
PDF
Linux boot process – explained
PPTX
introduction to computer Linux essential.pptx
PDF
Linux boot process
PPTX
Introduction to Operating Systems.pptx
PPTX
Linux booting process, Dual booting, Components involved
PPT
Ch04 system administration
PPTX
Linux booting sequence
PDF
Linux basics 1/2
PPTX
Linux basics
PDF
OS_lab_file.pdf
Linux booting procedure
Linux Booting Procedure system and networking.ppt
Linux Booting Process
6 stages of linux boot process
6 stages of linux boot process
6 stages of linux boot process
6 stages of linux boot process
Order of boot process in Linux
Linux startup
Linux boot process – explained
introduction to computer Linux essential.pptx
Linux boot process
Introduction to Operating Systems.pptx
Linux booting process, Dual booting, Components involved
Ch04 system administration
Linux booting sequence
Linux basics 1/2
Linux basics
OS_lab_file.pdf

More from Dhaval Kaneria (19)

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

Recently uploaded (20)

PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
OMC Textile Division Presentation 2021.pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Chapter 5: Probability Theory and Statistics
PDF
Getting Started with Data Integration: FME Form 101
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
August Patch Tuesday
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
Tartificialntelligence_presentation.pptx
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Digital-Transformation-Roadmap-for-Companies.pptx
Programs and apps: productivity, graphics, security and other tools
Agricultural_Statistics_at_a_Glance_2022_0.pdf
OMC Textile Division Presentation 2021.pptx
Group 1 Presentation -Planning and Decision Making .pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Chapter 5: Probability Theory and Statistics
Getting Started with Data Integration: FME Form 101
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
A comparative analysis of optical character recognition models for extracting...
Zenith AI: Advanced Artificial Intelligence
August Patch Tuesday
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Tartificialntelligence_presentation.pptx
Heart disease approach using modified random forest and particle swarm optimi...
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
cloud_computing_Infrastucture_as_cloud_p
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
A comparative study of natural language inference in Swahili using monolingua...
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...

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) and 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 spawn 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 Runlevel Scripts Directory (Red Hat/Fedora 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 changing 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/LinuxTutorialInitProc ess.html  http://www.pycs.net/lateral/stories/23.html  http://www.secguru.com/files/linux_file_structure  http://www.comptechdoc.org/os/linux/commands/linu x_crfilest.html