SlideShare a Scribd company logo
1 of 23
LINUX BOOT
PROCESS
CODE4VN.COM
TEXT
BOOT SEQUENCE
TEXT
BIOS (BASIC INPUT/OUTPUT SYSTEM)
▸Built-in firmware used to perform:
▸Initialize and test the system hardware components
▸Load a boot loader or an operating system from a mass
memory device (ex HDD).
▸The first software they run when powered on.
TEXT
TEXT
MASTER BOOT RECORD
▸512 bytes in size and contains machine code instructions for
booting the machine, the disk signature, and the partition table
for the disk.
▸Created when the disk is partitioned.
▸Scans the partition table for the active partition.
▸Finds the starting sector of the active partition.
▸Loads a copy of the boot sector from the active partition into
memory.
▸Transfers control to the executable code in the boot sector.
TEXT
GRUB: GNU GRAND UNIFIED BOOT LOADER
▸A program which enables the user to select which installed operating system or kernel to load at system
boot time. It also allows the user to pass arguments to the kernel.
▸GRUB loads itself into memory in the following stages:
▸The Stage 1 or primary boot loader is read into memory by the BIOS from the MBR[1]. The primary boot
loader exists on less than 512 bytes of disk space within the MBR and is capable of loading either the
Stage 1.5 or Stage 2 boot loader.
▸The Stage 1.5 boot loader is read into memory by the Stage 1 boot loader, if necessary. Some hardware
requires an intermediate step to get to the Stage 2 boot loader. This is sometimes true when the /boot/
partition is above the 1024 cylinder head of the hard drive or when using LBA mode. The Stage 1.5 boot
loader is found either on the /boot/ partition or on a small part of the MBR and the /boot/ partition.
▸The Stage 2 or secondary boot loader is read into memory. The secondary boot loader displays the
GRUB menu and command environment. This interface allows selection of the kernel or operating
system to boot, pass arguments to the kernel, or look at system parameters.
▸The secondary boot loader reads the operating system or kernel and initrd into memory. Once GRUB
determines which operating system to start, it loads it into memory and transfers control of the machine
to that operating system.
TEXT
TEXT
KERNEL
▸Initializes and configures the computer's memory, various
hardware attached to the system ie: all processors, I/O
subsystems, and storage devices.
▸Looks for the compressed initrd image in a predetermined
location in memory, decompresses it, mounts it, and loads all
necessary drivers.
▸Initializes virtual devices related to the file system, such as LVM
or software RAID.
▸Unmounting the initrd disk image and freeing up all the memory
the disk image once occupied.
TEXT
KERNEL
▸Creates a root device, mounts the root partition read-only,
and frees any unused memory.
▸At this point, the kernel is loaded into memory and
operational.
▸Kernel executes the /sbin/init program.
TEXT
KERNEL SPACE VS USER SPACE
▸Kernel space is strictly reserved for running a privileged operating system
kernel, kernel extensions, and most device drivers.
▸In contrast, user space is the memory area where application software and
some drivers execute.
▸Each user space process normally runs in its own virtual memory space,
and, unless explicitly allowed, cannot access the memory of other processes.
▸Depending on the privileges, processes can request the kernel to map part
of another process's memory space to its own, as is the case for debuggers.
▸Programs can also request shared memory regions with other processes,
although other techniques are also available to allow inter-process
communication.
TEXT
THE /SBIN/INIT PROGRAM (SYS V OR UPSTART)
▸Coordinates the rest of the boot process and configures the
environment for the user.
▸Becomes the parent or grandparent of all of the processes
that start up automatically on the system.
▸Runs the /etc/rc.d/rc.sysinit script, which sets the
environment path, starts swap, checks the file systems, and
executes all other steps required for system initialization.
▸Runs the /etc/inittab script, which describes how the system
should be set up in each SysV init runlevel
TEXT
THE /SBIN/INIT PROGRAM (SYS V OR UPSTART)
▸Sets the source function library, /etc/rc.d/init.d/functions, for
the system, which configures how to start, kill, and
determine the PID of a program.
▸Starts all of the background processes by looking in the
appropriate rc directory for the runlevel specified as default
in /etc/inittab (Redhat) or /etc/init/rc-sysinit.conf (Ubuntu).
▸Ex: When booting to runlevel 5, the init program looks in the
/etc/rc5.d/ directory to determine which processes to start
and stop.
TEXT
TEXT
SYS V - RUNLEVELS
▸The following runlevels are defined by default for Red Hat Enterprise
Linux:
▸0 — Halt
▸1 — Single-user text mode
▸2 — Not used (user-definable)
▸3 — Full multi-user text mode
▸4 — Not used (user-definable)
▸5 — Full multi-user graphical mode (with an X-based login screen)
▸6 — Reboot
TEXT
LINUX DAEMON
▸A daemon is a type of program on Unix-like operating
systems that runs unobtrusively in the background, rather
than under the direct control of a user, waiting to be
activated by the occurance of a specific event or condition
TEXT
/SBIN/GETTY
▸Forks an /sbin/getty process for each virtual console (login
prompt) allocated to the runlevel.
▸The /sbin/getty process opens communication pathways to
tty devices, sets their modes, prints the login prompt,
accepts the user's username and password and initiates the
login process.
TEXT
GETTY - LOGIN PROCESS
▸Step 1: Init creates the getty process
▸Step 2: getty process initiates login command
▸Step 3: login command try to check user credentials
▸Step 4: getty creates user shell process
▸Step 5: getty read shell property files
▸Step 6: getty provides you with PS1 prompt
TEXT
/ETC/PASSWD AND /ETC/SHADOW (STEP 3)
TEXT
/ETC/GROUP
▸Group name: It is the name of group.
▸Password: Generally password is not used, hence it is empty/blank. It can store
encrypted password. This is useful to implement privileged groups.
▸Group ID (GID): Each user must be assigned a group ID. You can see this number in
your /etc/passwd file.
▸Group List: It is a list of user names of users who are members of the group. The
user names, must be separated by commas.
TEXT
GETTY DETAIL
▸Step4: Gathers all the properties and before the start of user
shell it read /etc/motd file and display its content as banner
message to user.
▸Step5: Process reads /etc/profile file for shell related settings
and for importing any alias or some sort of variables which
we have to set for user shell.
▸Step6: Once it completes reading /etc/profile file, it will read
user home directory content and change user shell properties
according to .bashrc, .bash_profile if his default shell is bash.
The getty process get shell details from /etc/passwd file.
TEXT
/USR/SBIN/NOLOGIN AND /BIN/FALSE
▸When /usr/sbin/nologin is set as the shell, if user with that
shell logs in, they'll get a polite message saying 'This
account is currently not available.'. This message can be
changed with the file /etc/nologin.txt.
▸/bin/false is just a binary that immediately exits, returning
false, when its called, so when someone who has false as
shell logs in, they're immediately logged out when false
exits.
TEXT
THANK YOU!

More Related Content

What's hot

What's hot (20)

Linux Booting Process
Linux Booting ProcessLinux Booting Process
Linux Booting Process
 
Linux booting Process
Linux booting ProcessLinux booting Process
Linux booting Process
 
Linux booting process
Linux booting processLinux booting process
Linux booting process
 
Linux boot process
Linux boot processLinux boot process
Linux boot process
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot process
 
Linux Booting Steps
Linux Booting StepsLinux Booting Steps
Linux Booting Steps
 
Linux booting process - Linux System Administration
Linux booting process - Linux System AdministrationLinux booting process - Linux System Administration
Linux booting process - Linux System Administration
 
Booting & shut down,
Booting & shut down,Booting & shut down,
Booting & shut down,
 
Understanding The Boot Process
Understanding The Boot ProcessUnderstanding The Boot Process
Understanding The Boot Process
 
Order of boot process in Linux
Order of boot process in LinuxOrder of boot process in Linux
Order of boot process in Linux
 
Windows 10 Operating System
Windows 10 Operating SystemWindows 10 Operating System
Windows 10 Operating System
 
Booting Process OS
Booting Process OSBooting Process OS
Booting Process OS
 
System Booting Process overview
System Booting Process overviewSystem Booting Process overview
System Booting Process overview
 
Grub2 Booting Process
Grub2 Booting ProcessGrub2 Booting Process
Grub2 Booting Process
 
Bootloader and bootloading
Bootloader and bootloadingBootloader and bootloading
Bootloader and bootloading
 
Boot process
Boot processBoot process
Boot process
 
Boot process -test
Boot process -testBoot process -test
Boot process -test
 
Linux : Booting and runlevels
Linux : Booting and runlevelsLinux : Booting and runlevels
Linux : Booting and runlevels
 
Ch 2
Ch 2Ch 2
Ch 2
 
5. boot process
5. boot process5. boot process
5. boot process
 

Viewers also liked

My Emacs Configs
My Emacs ConfigsMy Emacs Configs
My Emacs ConfigsQin Jian
 
Emacs - COSCUP 2012
Emacs - COSCUP 2012Emacs - COSCUP 2012
Emacs - COSCUP 2012Kan-Ru Chen
 
Emacs入门
Emacs入门Emacs入门
Emacs入门yinhm .
 
Emacs intro
Emacs introEmacs intro
Emacs introKhon
 
Emacs, a performant IDE for Perl
Emacs, a performant IDE for PerlEmacs, a performant IDE for Perl
Emacs, a performant IDE for PerlLaurent Dami
 
Emacs presentation
Emacs presentationEmacs presentation
Emacs presentationLingfei Kong
 
Emacs Modes I can't work without
Emacs Modes I can't work withoutEmacs Modes I can't work without
Emacs Modes I can't work withoutHitesh Sharma
 
London open stack meet up - nov 2015
London open stack meet up - nov 2015London open stack meet up - nov 2015
London open stack meet up - nov 2015Darryl Weaver
 
Enterprise Linux 7 new feature_systemd_booting
Enterprise Linux 7 new feature_systemd_bootingEnterprise Linux 7 new feature_systemd_booting
Enterprise Linux 7 new feature_systemd_bootingsuk kim
 
Kickstart, Puppet, Docker
Kickstart, Puppet, DockerKickstart, Puppet, Docker
Kickstart, Puppet, DockerHirokazu Tokuno
 
How Emacs changed my life
How Emacs changed my lifeHow Emacs changed my life
How Emacs changed my lifeyukihiro_matz
 
(IDEユーザのための) ClojureのEmacs開発環境について
(IDEユーザのための) ClojureのEmacs開発環境について(IDEユーザのための) ClojureのEmacs開発環境について
(IDEユーザのための) ClojureのEmacs開発環境についてKazuhiro Hara
 
How To Manage Services on RHEL 7 or CentOS 7
How To Manage Services on RHEL 7 or CentOS 7How To Manage Services on RHEL 7 or CentOS 7
How To Manage Services on RHEL 7 or CentOS 7VCP Muthukrishna
 
How to Manage journalctl Logging System on RHEL 7
How to Manage journalctl Logging System on RHEL 7How to Manage journalctl Logging System on RHEL 7
How to Manage journalctl Logging System on RHEL 7VCP Muthukrishna
 
How To Install and Configure Log Rotation on RHEL 7 or CentOS 7
How To Install and Configure Log Rotation on RHEL 7 or CentOS 7How To Install and Configure Log Rotation on RHEL 7 or CentOS 7
How To Install and Configure Log Rotation on RHEL 7 or CentOS 7VCP Muthukrishna
 
How To Install and Generate Audit Reports in CentOS 7 or RHEL 7
How To Install and Generate Audit Reports in CentOS 7 or RHEL 7How To Install and Generate Audit Reports in CentOS 7 or RHEL 7
How To Install and Generate Audit Reports in CentOS 7 or RHEL 7VCP Muthukrishna
 

Viewers also liked (20)

Rhel6 vs rhel7
Rhel6 vs rhel7Rhel6 vs rhel7
Rhel6 vs rhel7
 
My Emacs Configs
My Emacs ConfigsMy Emacs Configs
My Emacs Configs
 
Emacs - COSCUP 2012
Emacs - COSCUP 2012Emacs - COSCUP 2012
Emacs - COSCUP 2012
 
Emacs入门
Emacs入门Emacs入门
Emacs入门
 
Emacs intro
Emacs introEmacs intro
Emacs intro
 
Emacs, a performant IDE for Perl
Emacs, a performant IDE for PerlEmacs, a performant IDE for Perl
Emacs, a performant IDE for Perl
 
Learn Linux: Emacs
Learn Linux: EmacsLearn Linux: Emacs
Learn Linux: Emacs
 
Emacs tutorial
Emacs tutorialEmacs tutorial
Emacs tutorial
 
Emacs presentation
Emacs presentationEmacs presentation
Emacs presentation
 
Emacs Modes I can't work without
Emacs Modes I can't work withoutEmacs Modes I can't work without
Emacs Modes I can't work without
 
London open stack meet up - nov 2015
London open stack meet up - nov 2015London open stack meet up - nov 2015
London open stack meet up - nov 2015
 
Enterprise Linux 7 new feature_systemd_booting
Enterprise Linux 7 new feature_systemd_bootingEnterprise Linux 7 new feature_systemd_booting
Enterprise Linux 7 new feature_systemd_booting
 
Kickstart, Puppet, Docker
Kickstart, Puppet, DockerKickstart, Puppet, Docker
Kickstart, Puppet, Docker
 
Pdf c1t tlawaxb
Pdf c1t tlawaxbPdf c1t tlawaxb
Pdf c1t tlawaxb
 
How Emacs changed my life
How Emacs changed my lifeHow Emacs changed my life
How Emacs changed my life
 
(IDEユーザのための) ClojureのEmacs開発環境について
(IDEユーザのための) ClojureのEmacs開発環境について(IDEユーザのための) ClojureのEmacs開発環境について
(IDEユーザのための) ClojureのEmacs開発環境について
 
How To Manage Services on RHEL 7 or CentOS 7
How To Manage Services on RHEL 7 or CentOS 7How To Manage Services on RHEL 7 or CentOS 7
How To Manage Services on RHEL 7 or CentOS 7
 
How to Manage journalctl Logging System on RHEL 7
How to Manage journalctl Logging System on RHEL 7How to Manage journalctl Logging System on RHEL 7
How to Manage journalctl Logging System on RHEL 7
 
How To Install and Configure Log Rotation on RHEL 7 or CentOS 7
How To Install and Configure Log Rotation on RHEL 7 or CentOS 7How To Install and Configure Log Rotation on RHEL 7 or CentOS 7
How To Install and Configure Log Rotation on RHEL 7 or CentOS 7
 
How To Install and Generate Audit Reports in CentOS 7 or RHEL 7
How To Install and Generate Audit Reports in CentOS 7 or RHEL 7How To Install and Generate Audit Reports in CentOS 7 or RHEL 7
How To Install and Generate Audit Reports in CentOS 7 or RHEL 7
 

Similar to Code4vn - Linux day - linux boot process

Similar to Code4vn - Linux day - linux boot process (20)

101 1.2 boot the system
101 1.2 boot the system101 1.2 boot the system
101 1.2 boot the system
 
Ch04 system administration
Ch04 system administration Ch04 system administration
Ch04 system administration
 
Ch04
Ch04Ch04
Ch04
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot process
 
linux installation.pdf
linux installation.pdflinux installation.pdf
linux installation.pdf
 
Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)
 
Linux boot process
Linux boot processLinux boot process
Linux boot process
 
Introduction to Operating Systems.pptx
Introduction to Operating Systems.pptxIntroduction to Operating Systems.pptx
Introduction to Operating Systems.pptx
 
Linux boot process – explained
Linux boot process – explainedLinux boot process – explained
Linux boot process – explained
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Linux basics
Linux basics Linux basics
Linux basics
 
Linux
Linux Linux
Linux
 
Linux filesystemhierarchy
Linux filesystemhierarchyLinux filesystemhierarchy
Linux filesystemhierarchy
 
Grub and dracut ii
Grub and dracut iiGrub and dracut ii
Grub and dracut ii
 
1.2 boot the system v2
1.2 boot the system v21.2 boot the system v2
1.2 boot the system v2
 
Boot prom basics
Boot prom basicsBoot prom basics
Boot prom basics
 
An Introduction To Linux
An Introduction To LinuxAn Introduction To Linux
An Introduction To Linux
 
Unix Administration 2
Unix Administration 2Unix Administration 2
Unix Administration 2
 
101 1.2 boot the system
101 1.2 boot the system101 1.2 boot the system
101 1.2 boot the system
 
Linux basics
Linux basics Linux basics
Linux basics
 

Recently uploaded

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 

Recently uploaded (20)

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 

Code4vn - Linux day - linux boot process

  • 3. TEXT BIOS (BASIC INPUT/OUTPUT SYSTEM) ▸Built-in firmware used to perform: ▸Initialize and test the system hardware components ▸Load a boot loader or an operating system from a mass memory device (ex HDD). ▸The first software they run when powered on.
  • 5. TEXT MASTER BOOT RECORD ▸512 bytes in size and contains machine code instructions for booting the machine, the disk signature, and the partition table for the disk. ▸Created when the disk is partitioned. ▸Scans the partition table for the active partition. ▸Finds the starting sector of the active partition. ▸Loads a copy of the boot sector from the active partition into memory. ▸Transfers control to the executable code in the boot sector.
  • 6. TEXT GRUB: GNU GRAND UNIFIED BOOT LOADER ▸A program which enables the user to select which installed operating system or kernel to load at system boot time. It also allows the user to pass arguments to the kernel. ▸GRUB loads itself into memory in the following stages: ▸The Stage 1 or primary boot loader is read into memory by the BIOS from the MBR[1]. The primary boot loader exists on less than 512 bytes of disk space within the MBR and is capable of loading either the Stage 1.5 or Stage 2 boot loader. ▸The Stage 1.5 boot loader is read into memory by the Stage 1 boot loader, if necessary. Some hardware requires an intermediate step to get to the Stage 2 boot loader. This is sometimes true when the /boot/ partition is above the 1024 cylinder head of the hard drive or when using LBA mode. The Stage 1.5 boot loader is found either on the /boot/ partition or on a small part of the MBR and the /boot/ partition. ▸The Stage 2 or secondary boot loader is read into memory. The secondary boot loader displays the GRUB menu and command environment. This interface allows selection of the kernel or operating system to boot, pass arguments to the kernel, or look at system parameters. ▸The secondary boot loader reads the operating system or kernel and initrd into memory. Once GRUB determines which operating system to start, it loads it into memory and transfers control of the machine to that operating system.
  • 8.
  • 9. TEXT KERNEL ▸Initializes and configures the computer's memory, various hardware attached to the system ie: all processors, I/O subsystems, and storage devices. ▸Looks for the compressed initrd image in a predetermined location in memory, decompresses it, mounts it, and loads all necessary drivers. ▸Initializes virtual devices related to the file system, such as LVM or software RAID. ▸Unmounting the initrd disk image and freeing up all the memory the disk image once occupied.
  • 10. TEXT KERNEL ▸Creates a root device, mounts the root partition read-only, and frees any unused memory. ▸At this point, the kernel is loaded into memory and operational. ▸Kernel executes the /sbin/init program.
  • 11. TEXT KERNEL SPACE VS USER SPACE ▸Kernel space is strictly reserved for running a privileged operating system kernel, kernel extensions, and most device drivers. ▸In contrast, user space is the memory area where application software and some drivers execute. ▸Each user space process normally runs in its own virtual memory space, and, unless explicitly allowed, cannot access the memory of other processes. ▸Depending on the privileges, processes can request the kernel to map part of another process's memory space to its own, as is the case for debuggers. ▸Programs can also request shared memory regions with other processes, although other techniques are also available to allow inter-process communication.
  • 12. TEXT THE /SBIN/INIT PROGRAM (SYS V OR UPSTART) ▸Coordinates the rest of the boot process and configures the environment for the user. ▸Becomes the parent or grandparent of all of the processes that start up automatically on the system. ▸Runs the /etc/rc.d/rc.sysinit script, which sets the environment path, starts swap, checks the file systems, and executes all other steps required for system initialization. ▸Runs the /etc/inittab script, which describes how the system should be set up in each SysV init runlevel
  • 13. TEXT THE /SBIN/INIT PROGRAM (SYS V OR UPSTART) ▸Sets the source function library, /etc/rc.d/init.d/functions, for the system, which configures how to start, kill, and determine the PID of a program. ▸Starts all of the background processes by looking in the appropriate rc directory for the runlevel specified as default in /etc/inittab (Redhat) or /etc/init/rc-sysinit.conf (Ubuntu). ▸Ex: When booting to runlevel 5, the init program looks in the /etc/rc5.d/ directory to determine which processes to start and stop.
  • 14. TEXT
  • 15. TEXT SYS V - RUNLEVELS ▸The following runlevels are defined by default for Red Hat Enterprise Linux: ▸0 — Halt ▸1 — Single-user text mode ▸2 — Not used (user-definable) ▸3 — Full multi-user text mode ▸4 — Not used (user-definable) ▸5 — Full multi-user graphical mode (with an X-based login screen) ▸6 — Reboot
  • 16. TEXT LINUX DAEMON ▸A daemon is a type of program on Unix-like operating systems that runs unobtrusively in the background, rather than under the direct control of a user, waiting to be activated by the occurance of a specific event or condition
  • 17. TEXT /SBIN/GETTY ▸Forks an /sbin/getty process for each virtual console (login prompt) allocated to the runlevel. ▸The /sbin/getty process opens communication pathways to tty devices, sets their modes, prints the login prompt, accepts the user's username and password and initiates the login process.
  • 18. TEXT GETTY - LOGIN PROCESS ▸Step 1: Init creates the getty process ▸Step 2: getty process initiates login command ▸Step 3: login command try to check user credentials ▸Step 4: getty creates user shell process ▸Step 5: getty read shell property files ▸Step 6: getty provides you with PS1 prompt
  • 20. TEXT /ETC/GROUP ▸Group name: It is the name of group. ▸Password: Generally password is not used, hence it is empty/blank. It can store encrypted password. This is useful to implement privileged groups. ▸Group ID (GID): Each user must be assigned a group ID. You can see this number in your /etc/passwd file. ▸Group List: It is a list of user names of users who are members of the group. The user names, must be separated by commas.
  • 21. TEXT GETTY DETAIL ▸Step4: Gathers all the properties and before the start of user shell it read /etc/motd file and display its content as banner message to user. ▸Step5: Process reads /etc/profile file for shell related settings and for importing any alias or some sort of variables which we have to set for user shell. ▸Step6: Once it completes reading /etc/profile file, it will read user home directory content and change user shell properties according to .bashrc, .bash_profile if his default shell is bash. The getty process get shell details from /etc/passwd file.
  • 22. TEXT /USR/SBIN/NOLOGIN AND /BIN/FALSE ▸When /usr/sbin/nologin is set as the shell, if user with that shell logs in, they'll get a polite message saying 'This account is currently not available.'. This message can be changed with the file /etc/nologin.txt. ▸/bin/false is just a binary that immediately exits, returning false, when its called, so when someone who has false as shell logs in, they're immediately logged out when false exits.