SlideShare a Scribd company logo
THE SHELLSYSTEM BOOT AND THE INIT PROCESSA presentation byArvind Krishnaa J
Topics CoveredThe Shell
Algorithm for the Shell
Redirection of IO
Piping
Asynchronous Execution of commands
System Boot Process
Algorithm for the boot process
Init Process
Algorithm for the init process
Other types of processes
Characteristics of these processes“Try and try until you succeed”Old Wise saying
The ShellShell reads a command line from its standard input.
Interprets it according to a fixed set of rules.
Standard input and output for the login shell are both the terminal.
If the shell recognizes the input as an internal command(like cd, for, while and others)
Executes the command internally without creating  new processesElseAssumes that the command is the name of an         executable file
More about the SHELLSimplest command lines contain a program name and some parameters
such aswhogrep –n include *.cls –lShell forks and creates a child process.It execs the program that the user specified on the command line.The shell waits until the child process exits from the command and loops back to read the next command.
SHELL Algorithm/*read command line until “end of file” */while(read(stdin,buffer,numchars)){/*parse command line */if(/*command line contains & */)amper=1;elseamper=0;/*for commands not part of the shell command language */if(fork()==0){/*redirection of IO? */if( /*redirect output */ ){fd=creat(newfile,fmask);close(stdout);dup(fd);close(fd);/* stdout is now redirected */}
SHELL Algorithmif( /* piping */ ){pipe(fildes);if(fork()==0){/* first component of command line */close(stdout);dup(filedes[1]);close(filedes[1]);close(filedes[0]);/* stdout now goes to pipe *//* child process does command */execlp(command1,command1,0);}/* 2nd command component of command line */close(stdin);dup(filedes[0]);close(filedes[0]);close(filedes[1]);/*standard input now comes from pipe */}
SHELL Algorithmexecve(command2,command2,0);}/* parent continues over here…* waits for child to exit if required*/if(amper==0)retid=wait(&status);}
Continuing the shell algorithmTo run a process asynchronously in the background, nroff –mm bigdocument &Shell sets an internal variable amper when it parses the ampersand characterif amper is set at the end of the loopShell does not execute wait but immediately restarts the loop and reads next command line.
Redirection of IOChild process has access to a copy of the shell command line after the fork.To redirect standard output to a file,nroff –mm bigdocument > outputChild “creats” the output file specified on the command line if creat fails the child would exit immediatelyelse child closes its previous standard output file and dups the file descriptor of the new output file.Standard output file descriptor now refers to the redirected output file.Child process closes the file descriptor obtained from creat to conserve file descriptors for the execed program.“Similar redirection occurs for standard input and standard error files”
PipingConsider the commandls-l|wcAfter parent forks and creates a child process child creates a pipe.
Child then forks another process.
It and its child handle one component of the command line.
Ad

More Related Content

What's hot (20)

Operating system 22 threading issues
Operating system 22 threading issuesOperating system 22 threading issues
Operating system 22 threading issues
Vaibhav Khanna
 
bios booting process
bios booting processbios booting process
bios booting process
Taimoor Ashraf
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulation
Sanjeev Patel
 
Shell and its types in LINUX
Shell and its types in LINUXShell and its types in LINUX
Shell and its types in LINUX
SHUBHA CHATURVEDI
 
Etude DéTailléé de la pile réseau sous GNU Linux
Etude DéTailléé de la pile réseau sous GNU LinuxEtude DéTailléé de la pile réseau sous GNU Linux
Etude DéTailléé de la pile réseau sous GNU Linux
Thierry Gayet
 
Basic Computer Organization and Design
Basic Computer Organization and DesignBasic Computer Organization and Design
Basic Computer Organization and Design
Kamal Acharya
 
PCD - Process control daemon
PCD - Process control daemonPCD - Process control daemon
PCD - Process control daemon
haish
 
Linux Programming
Linux ProgrammingLinux Programming
Linux Programming
Emertxe Information Technologies Pvt Ltd
 
Bash Shell Scripting
Bash Shell ScriptingBash Shell Scripting
Bash Shell Scripting
Raghu nath
 
Linux Booting Process
Linux Booting ProcessLinux Booting Process
Linux Booting Process
Rishabh5121993
 
Arm
ArmArm
Arm
anishgoel
 
Process management in linux
Process management in linuxProcess management in linux
Process management in linux
Mazenetsolution
 
Instruction cycle with interrupts
Instruction cycle with interruptsInstruction cycle with interrupts
Instruction cycle with interrupts
Shubham Jain
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Stefano Stabellini
 
Ext filesystem4
Ext filesystem4Ext filesystem4
Ext filesystem4
Neha Kulkarni
 
Threads in Operating System | Multithreading | Interprocess Communication
Threads in Operating System | Multithreading | Interprocess CommunicationThreads in Operating System | Multithreading | Interprocess Communication
Threads in Operating System | Multithreading | Interprocess Communication
Shivam Mitra
 
Chapter 22 - Windows XP
Chapter 22 - Windows XPChapter 22 - Windows XP
Chapter 22 - Windows XP
Wayne Jones Jnr
 
Deadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbianDeadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbian
saad symbian
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
Nikhil Jain
 
Exploring Your Apple M1 devices with Open Source Tools
Exploring Your Apple M1 devices with Open Source ToolsExploring Your Apple M1 devices with Open Source Tools
Exploring Your Apple M1 devices with Open Source Tools
Koan-Sin Tan
 
Operating system 22 threading issues
Operating system 22 threading issuesOperating system 22 threading issues
Operating system 22 threading issues
Vaibhav Khanna
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulation
Sanjeev Patel
 
Shell and its types in LINUX
Shell and its types in LINUXShell and its types in LINUX
Shell and its types in LINUX
SHUBHA CHATURVEDI
 
Etude DéTailléé de la pile réseau sous GNU Linux
Etude DéTailléé de la pile réseau sous GNU LinuxEtude DéTailléé de la pile réseau sous GNU Linux
Etude DéTailléé de la pile réseau sous GNU Linux
Thierry Gayet
 
Basic Computer Organization and Design
Basic Computer Organization and DesignBasic Computer Organization and Design
Basic Computer Organization and Design
Kamal Acharya
 
PCD - Process control daemon
PCD - Process control daemonPCD - Process control daemon
PCD - Process control daemon
haish
 
Bash Shell Scripting
Bash Shell ScriptingBash Shell Scripting
Bash Shell Scripting
Raghu nath
 
Process management in linux
Process management in linuxProcess management in linux
Process management in linux
Mazenetsolution
 
Instruction cycle with interrupts
Instruction cycle with interruptsInstruction cycle with interrupts
Instruction cycle with interrupts
Shubham Jain
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Stefano Stabellini
 
Threads in Operating System | Multithreading | Interprocess Communication
Threads in Operating System | Multithreading | Interprocess CommunicationThreads in Operating System | Multithreading | Interprocess Communication
Threads in Operating System | Multithreading | Interprocess Communication
Shivam Mitra
 
Deadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbianDeadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbian
saad symbian
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
Nikhil Jain
 
Exploring Your Apple M1 devices with Open Source Tools
Exploring Your Apple M1 devices with Open Source ToolsExploring Your Apple M1 devices with Open Source Tools
Exploring Your Apple M1 devices with Open Source Tools
Koan-Sin Tan
 

Viewers also liked (20)

File models and file accessing models
File models and file accessing modelsFile models and file accessing models
File models and file accessing models
ishmecse13
 
On Becoming A Marketing Tour de Force
On Becoming A Marketing Tour de Force On Becoming A Marketing Tour de Force
On Becoming A Marketing Tour de Force
Accrue Performance Marketing Inc.
 
Smart camera monitoring system
Smart camera monitoring systemSmart camera monitoring system
Smart camera monitoring system
Arvind Krishnaa
 
Canvas Based Presentation tool - First Review
Canvas Based Presentation tool - First ReviewCanvas Based Presentation tool - First Review
Canvas Based Presentation tool - First Review
Arvind Krishnaa
 
Economics of Green Growth & National Innovation Strategies
Economics of Green Growth & National Innovation StrategiesEconomics of Green Growth & National Innovation Strategies
Economics of Green Growth & National Innovation Strategies
CambridgeIP Ltd
 
My Home Goodrich Global
My Home Goodrich GlobalMy Home Goodrich Global
My Home Goodrich Global
Goodrich Global
 
20130415 paparan deputi bidang pelayanan publik mahasiswa ui wamen
20130415 paparan deputi bidang pelayanan publik mahasiswa ui wamen20130415 paparan deputi bidang pelayanan publik mahasiswa ui wamen
20130415 paparan deputi bidang pelayanan publik mahasiswa ui wamen
Mohammad Subhan
 
Burns supper (3ºb 2012 13)
Burns supper (3ºb 2012 13)Burns supper (3ºb 2012 13)
Burns supper (3ºb 2012 13)
Rocio Torres
 
clodfoundrydoc.pdf
clodfoundrydoc.pdfclodfoundrydoc.pdf
clodfoundrydoc.pdf
Parag Gajbhiye
 
Resume M Pitcher 2010 08 27
Resume   M Pitcher 2010 08 27Resume   M Pitcher 2010 08 27
Resume M Pitcher 2010 08 27
Michael Pitcher
 
Huracan alex mty 01 jul 2010
Huracan alex mty 01 jul 2010Huracan alex mty 01 jul 2010
Huracan alex mty 01 jul 2010
Daniel Oropeza
 
A day in the Life of Beaver Brook Nature Center
A day in the Life of Beaver Brook Nature CenterA day in the Life of Beaver Brook Nature Center
A day in the Life of Beaver Brook Nature Center
celestepbarr
 
NäIn Onnistut Verkossa - HSY tarjoaa vinkkejä ruokaa rippeistä -teemalla Koti...
NäIn Onnistut Verkossa - HSY tarjoaa vinkkejä ruokaa rippeistä -teemalla Koti...NäIn Onnistut Verkossa - HSY tarjoaa vinkkejä ruokaa rippeistä -teemalla Koti...
NäIn Onnistut Verkossa - HSY tarjoaa vinkkejä ruokaa rippeistä -teemalla Koti...
Darwin Oy
 
Final review presentation
Final review presentationFinal review presentation
Final review presentation
Arvind Krishnaa
 
CambridgeIP: Case Studies Of Recent Client Engagements
CambridgeIP: Case Studies Of Recent Client EngagementsCambridgeIP: Case Studies Of Recent Client Engagements
CambridgeIP: Case Studies Of Recent Client Engagements
CambridgeIP Ltd
 
M Pitcher Resume
M Pitcher ResumeM Pitcher Resume
M Pitcher Resume
Michael Pitcher
 
Participants List For Jsm
Participants List For JsmParticipants List For Jsm
Participants List For Jsm
JADE aisbl
 
Asiakkaan Kohtaaminen
Asiakkaan KohtaaminenAsiakkaan Kohtaaminen
Asiakkaan Kohtaaminen
Darwin Oy
 
File models and file accessing models
File models and file accessing modelsFile models and file accessing models
File models and file accessing models
ishmecse13
 
Smart camera monitoring system
Smart camera monitoring systemSmart camera monitoring system
Smart camera monitoring system
Arvind Krishnaa
 
Canvas Based Presentation tool - First Review
Canvas Based Presentation tool - First ReviewCanvas Based Presentation tool - First Review
Canvas Based Presentation tool - First Review
Arvind Krishnaa
 
Economics of Green Growth & National Innovation Strategies
Economics of Green Growth & National Innovation StrategiesEconomics of Green Growth & National Innovation Strategies
Economics of Green Growth & National Innovation Strategies
CambridgeIP Ltd
 
20130415 paparan deputi bidang pelayanan publik mahasiswa ui wamen
20130415 paparan deputi bidang pelayanan publik mahasiswa ui wamen20130415 paparan deputi bidang pelayanan publik mahasiswa ui wamen
20130415 paparan deputi bidang pelayanan publik mahasiswa ui wamen
Mohammad Subhan
 
Burns supper (3ºb 2012 13)
Burns supper (3ºb 2012 13)Burns supper (3ºb 2012 13)
Burns supper (3ºb 2012 13)
Rocio Torres
 
Resume M Pitcher 2010 08 27
Resume   M Pitcher 2010 08 27Resume   M Pitcher 2010 08 27
Resume M Pitcher 2010 08 27
Michael Pitcher
 
Huracan alex mty 01 jul 2010
Huracan alex mty 01 jul 2010Huracan alex mty 01 jul 2010
Huracan alex mty 01 jul 2010
Daniel Oropeza
 
A day in the Life of Beaver Brook Nature Center
A day in the Life of Beaver Brook Nature CenterA day in the Life of Beaver Brook Nature Center
A day in the Life of Beaver Brook Nature Center
celestepbarr
 
NäIn Onnistut Verkossa - HSY tarjoaa vinkkejä ruokaa rippeistä -teemalla Koti...
NäIn Onnistut Verkossa - HSY tarjoaa vinkkejä ruokaa rippeistä -teemalla Koti...NäIn Onnistut Verkossa - HSY tarjoaa vinkkejä ruokaa rippeistä -teemalla Koti...
NäIn Onnistut Verkossa - HSY tarjoaa vinkkejä ruokaa rippeistä -teemalla Koti...
Darwin Oy
 
Final review presentation
Final review presentationFinal review presentation
Final review presentation
Arvind Krishnaa
 
CambridgeIP: Case Studies Of Recent Client Engagements
CambridgeIP: Case Studies Of Recent Client EngagementsCambridgeIP: Case Studies Of Recent Client Engagements
CambridgeIP: Case Studies Of Recent Client Engagements
CambridgeIP Ltd
 
Participants List For Jsm
Participants List For JsmParticipants List For Jsm
Participants List For Jsm
JADE aisbl
 
Asiakkaan Kohtaaminen
Asiakkaan KohtaaminenAsiakkaan Kohtaaminen
Asiakkaan Kohtaaminen
Darwin Oy
 
Ad

Similar to Unix Shell and System Boot Process (20)

Linux startup
Linux startupLinux startup
Linux startup
Amin Hashemi
 
Systemcall1
Systemcall1Systemcall1
Systemcall1
pavimalpani
 
578781849-RHSA-1-Chap578781850-RHSA-1-Chapter-4ter-7.pptx
578781849-RHSA-1-Chap578781850-RHSA-1-Chapter-4ter-7.pptx578781849-RHSA-1-Chap578781850-RHSA-1-Chapter-4ter-7.pptx
578781849-RHSA-1-Chap578781850-RHSA-1-Chapter-4ter-7.pptx
AbdellahELMAMOUN
 
Ch04
Ch04Ch04
Ch04
Raja Waseem Akhtar
 
Ch04 system administration
Ch04 system administration Ch04 system administration
Ch04 system administration
Raja Waseem Akhtar
 
linux m1 part 1 notes in mca departement.pptx
linux m1 part 1 notes in mca departement.pptxlinux m1 part 1 notes in mca departement.pptx
linux m1 part 1 notes in mca departement.pptx
abhinavas9207
 
What is-a-computer-process-os
What is-a-computer-process-osWhat is-a-computer-process-os
What is-a-computer-process-os
Manish Singh
 
brief intro to Linux device drivers
brief intro to Linux device driversbrief intro to Linux device drivers
brief intro to Linux device drivers
Alexandre Moreno
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
mukul bhardwaj
 
Your first dive into systemd!
Your first dive into systemd!Your first dive into systemd!
Your first dive into systemd!
Etsuji Nakai
 
11_UNIX_Processes_Including_Select.ppt
11_UNIX_Processes_Including_Select.ppt11_UNIX_Processes_Including_Select.ppt
11_UNIX_Processes_Including_Select.ppt
SIDDHARTHANANDCSE202
 
OS_lab_file.pdf
OS_lab_file.pdfOS_lab_file.pdf
OS_lab_file.pdf
KarthickS942388
 
Linux process management
Linux process managementLinux process management
Linux process management
Raghu nath
 
Os notes
Os notesOs notes
Os notes
LakshmiSarvani6
 
Week 11Linux InternalsProcesses, schedulingLecture o.docx
Week 11Linux InternalsProcesses, schedulingLecture o.docxWeek 11Linux InternalsProcesses, schedulingLecture o.docx
Week 11Linux InternalsProcesses, schedulingLecture o.docx
melbruce90096
 
Operating Systems
Operating Systems Operating Systems
Operating Systems
Ziyauddin Shaik
 
Tarea - 3 Actividad intermedia trabajo colaborativo 2
Tarea - 3 Actividad intermedia trabajo colaborativo 2Tarea - 3 Actividad intermedia trabajo colaborativo 2
Tarea - 3 Actividad intermedia trabajo colaborativo 2
HectorFabianPintoOsp
 
Unix Administration 2
Unix Administration 2Unix Administration 2
Unix Administration 2
Information Technology
 
intro unix/linux 10
intro unix/linux 10intro unix/linux 10
intro unix/linux 10
duquoi
 
LINUX Device Drivers
LINUX Device DriversLINUX Device Drivers
LINUX Device Drivers
Partha Bhattacharya
 
578781849-RHSA-1-Chap578781850-RHSA-1-Chapter-4ter-7.pptx
578781849-RHSA-1-Chap578781850-RHSA-1-Chapter-4ter-7.pptx578781849-RHSA-1-Chap578781850-RHSA-1-Chapter-4ter-7.pptx
578781849-RHSA-1-Chap578781850-RHSA-1-Chapter-4ter-7.pptx
AbdellahELMAMOUN
 
linux m1 part 1 notes in mca departement.pptx
linux m1 part 1 notes in mca departement.pptxlinux m1 part 1 notes in mca departement.pptx
linux m1 part 1 notes in mca departement.pptx
abhinavas9207
 
What is-a-computer-process-os
What is-a-computer-process-osWhat is-a-computer-process-os
What is-a-computer-process-os
Manish Singh
 
brief intro to Linux device drivers
brief intro to Linux device driversbrief intro to Linux device drivers
brief intro to Linux device drivers
Alexandre Moreno
 
Your first dive into systemd!
Your first dive into systemd!Your first dive into systemd!
Your first dive into systemd!
Etsuji Nakai
 
11_UNIX_Processes_Including_Select.ppt
11_UNIX_Processes_Including_Select.ppt11_UNIX_Processes_Including_Select.ppt
11_UNIX_Processes_Including_Select.ppt
SIDDHARTHANANDCSE202
 
Linux process management
Linux process managementLinux process management
Linux process management
Raghu nath
 
Week 11Linux InternalsProcesses, schedulingLecture o.docx
Week 11Linux InternalsProcesses, schedulingLecture o.docxWeek 11Linux InternalsProcesses, schedulingLecture o.docx
Week 11Linux InternalsProcesses, schedulingLecture o.docx
melbruce90096
 
Tarea - 3 Actividad intermedia trabajo colaborativo 2
Tarea - 3 Actividad intermedia trabajo colaborativo 2Tarea - 3 Actividad intermedia trabajo colaborativo 2
Tarea - 3 Actividad intermedia trabajo colaborativo 2
HectorFabianPintoOsp
 
intro unix/linux 10
intro unix/linux 10intro unix/linux 10
intro unix/linux 10
duquoi
 
Ad

More from Arvind Krishnaa (15)

Twitter Agreement Analysis
Twitter Agreement AnalysisTwitter Agreement Analysis
Twitter Agreement Analysis
Arvind Krishnaa
 
Analogical thinking
Analogical thinkingAnalogical thinking
Analogical thinking
Arvind Krishnaa
 
Recognition of unistroke gesture sequences
Recognition of unistroke gesture sequencesRecognition of unistroke gesture sequences
Recognition of unistroke gesture sequences
Arvind Krishnaa
 
Human Altruism and Cooperation
Human Altruism and CooperationHuman Altruism and Cooperation
Human Altruism and Cooperation
Arvind Krishnaa
 
Chowka bhara
Chowka bharaChowka bhara
Chowka bhara
Arvind Krishnaa
 
Canscape
CanscapeCanscape
Canscape
Arvind Krishnaa
 
Third review presentation
Third review presentationThird review presentation
Third review presentation
Arvind Krishnaa
 
Second review presentation
Second review presentationSecond review presentation
Second review presentation
Arvind Krishnaa
 
First review presentation
First review presentationFirst review presentation
First review presentation
Arvind Krishnaa
 
Zeroth review presentation - eBay Turmeric / SMC
Zeroth review presentation - eBay Turmeric / SMCZeroth review presentation - eBay Turmeric / SMC
Zeroth review presentation - eBay Turmeric / SMC
Arvind Krishnaa
 
Canvas Based Presentation - Zeroth Review
Canvas Based Presentation - Zeroth ReviewCanvas Based Presentation - Zeroth Review
Canvas Based Presentation - Zeroth Review
Arvind Krishnaa
 
Data Binding and Data Grid View Classes
Data Binding and Data Grid View ClassesData Binding and Data Grid View Classes
Data Binding and Data Grid View Classes
Arvind Krishnaa
 
Marine Pollution
Marine PollutionMarine Pollution
Marine Pollution
Arvind Krishnaa
 
Multithreading Concepts
Multithreading ConceptsMultithreading Concepts
Multithreading Concepts
Arvind Krishnaa
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of Algorithms
Arvind Krishnaa
 
Twitter Agreement Analysis
Twitter Agreement AnalysisTwitter Agreement Analysis
Twitter Agreement Analysis
Arvind Krishnaa
 
Recognition of unistroke gesture sequences
Recognition of unistroke gesture sequencesRecognition of unistroke gesture sequences
Recognition of unistroke gesture sequences
Arvind Krishnaa
 
Human Altruism and Cooperation
Human Altruism and CooperationHuman Altruism and Cooperation
Human Altruism and Cooperation
Arvind Krishnaa
 
Third review presentation
Third review presentationThird review presentation
Third review presentation
Arvind Krishnaa
 
Second review presentation
Second review presentationSecond review presentation
Second review presentation
Arvind Krishnaa
 
First review presentation
First review presentationFirst review presentation
First review presentation
Arvind Krishnaa
 
Zeroth review presentation - eBay Turmeric / SMC
Zeroth review presentation - eBay Turmeric / SMCZeroth review presentation - eBay Turmeric / SMC
Zeroth review presentation - eBay Turmeric / SMC
Arvind Krishnaa
 
Canvas Based Presentation - Zeroth Review
Canvas Based Presentation - Zeroth ReviewCanvas Based Presentation - Zeroth Review
Canvas Based Presentation - Zeroth Review
Arvind Krishnaa
 
Data Binding and Data Grid View Classes
Data Binding and Data Grid View ClassesData Binding and Data Grid View Classes
Data Binding and Data Grid View Classes
Arvind Krishnaa
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of Algorithms
Arvind Krishnaa
 

Recently uploaded (20)

To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 

Unix Shell and System Boot Process

  • 1. THE SHELLSYSTEM BOOT AND THE INIT PROCESSA presentation byArvind Krishnaa J
  • 8. Algorithm for the boot process
  • 10. Algorithm for the init process
  • 11. Other types of processes
  • 12. Characteristics of these processes“Try and try until you succeed”Old Wise saying
  • 13. The ShellShell reads a command line from its standard input.
  • 14. Interprets it according to a fixed set of rules.
  • 15. Standard input and output for the login shell are both the terminal.
  • 16. If the shell recognizes the input as an internal command(like cd, for, while and others)
  • 17. Executes the command internally without creating new processesElseAssumes that the command is the name of an executable file
  • 18. More about the SHELLSimplest command lines contain a program name and some parameters
  • 19. such aswhogrep –n include *.cls –lShell forks and creates a child process.It execs the program that the user specified on the command line.The shell waits until the child process exits from the command and loops back to read the next command.
  • 20. SHELL Algorithm/*read command line until “end of file” */while(read(stdin,buffer,numchars)){/*parse command line */if(/*command line contains & */)amper=1;elseamper=0;/*for commands not part of the shell command language */if(fork()==0){/*redirection of IO? */if( /*redirect output */ ){fd=creat(newfile,fmask);close(stdout);dup(fd);close(fd);/* stdout is now redirected */}
  • 21. SHELL Algorithmif( /* piping */ ){pipe(fildes);if(fork()==0){/* first component of command line */close(stdout);dup(filedes[1]);close(filedes[1]);close(filedes[0]);/* stdout now goes to pipe *//* child process does command */execlp(command1,command1,0);}/* 2nd command component of command line */close(stdin);dup(filedes[0]);close(filedes[0]);close(filedes[1]);/*standard input now comes from pipe */}
  • 22. SHELL Algorithmexecve(command2,command2,0);}/* parent continues over here…* waits for child to exit if required*/if(amper==0)retid=wait(&status);}
  • 23. Continuing the shell algorithmTo run a process asynchronously in the background, nroff –mm bigdocument &Shell sets an internal variable amper when it parses the ampersand characterif amper is set at the end of the loopShell does not execute wait but immediately restarts the loop and reads next command line.
  • 24. Redirection of IOChild process has access to a copy of the shell command line after the fork.To redirect standard output to a file,nroff –mm bigdocument > outputChild “creats” the output file specified on the command line if creat fails the child would exit immediatelyelse child closes its previous standard output file and dups the file descriptor of the new output file.Standard output file descriptor now refers to the redirected output file.Child process closes the file descriptor obtained from creat to conserve file descriptors for the execed program.“Similar redirection occurs for standard input and standard error files”
  • 25. PipingConsider the commandls-l|wcAfter parent forks and creates a child process child creates a pipe.
  • 26. Child then forks another process.
  • 27. It and its child handle one component of the command line.
  • 28. Grand child process created by second fork executes the first command line component(ls).
  • 29. It writes to the pipe, dups it and closes its standard output FD.
  • 30. The parent(wc) closes its standard input file and dups the pipe read descriptor causing it to be the standard input file descriptor.
  • 31. Closes the original pipe’s read descriptor
  • 32. Executes the second component of the original command line.Relationship of processes for ls=l|wc
  • 33. Piping (contd..)ls-l|wcBoth the processes execute asynchronously.
  • 34. Output of one process goes as the input of the other process.
  • 35. Parent shell (i.e the actual shell) waits until wc exits then proceeds as usual.
  • 36. Entire command line completes when wc exits.
  • 37. Shell loops and reads the next commandRelationship of processes for ls=l|wc
  • 38. SYSTEM BOOT To initialize a system from an inactive state, an administrator goes through a “bootstrap” sequence.
  • 39. Administrator “boots” the system.Goal of the boot process:Get a copy of the operating system into machine memoryStart executing it.It is usually done in a series of stages.Administrator may set switches on the computer console to specify the address of a special hardcoded bootstrap programOr just push a button that instructs the machine to load a bootstrap program from its microcode.
  • 40. UNIX SYSTEM BOOT Bootstrap procedure eventually reads the boot block (block 0) of a disk and load it into memory.
  • 41. Program in the boot block loads the kernel from the file system  from the file /unix
  • 42. After the kernel is loaded in memory, the boot process transfers control to the start address of the kernel, and the kernel starts running.start Algorithmalgorithm start/* system startup procedure */input : noneoutput : none{initialize all kernel data structures;pseudo-mount of root;hand-craft environment of process 0;fork process 1;{/* process 1 in here */allocate region;attach region to init address space;grow region to accommodate code about to copy in;copy code from kernel space to init user space to exec init;change mode: return from kernel mode to user mode;/* init never gets here—as a result of above change mode.* init execs /etc/init and becomes a “normal” user process* with respect to invocation of system calls*/}
  • 43. start Algorithm/* proc 0 continues here */fork kernel process;/* process 0 invokes the swapper to manage the allocation of* process address space to main memory and the swap devices.* This is an infinite loop;process 0 usually sleeps in the * loop unless there is work for it to do*/execute code for swapper algorithm;}
  • 44. Explanation of start AlgorithmKernel initializes its internal data structures.
  • 45. eg., Constructs linked list of free buffers and inodes, constructs hash queues for buffers and inodes, initializes region structures , page table entries and so on.
  • 46. Then it mounts the root file system onto root (“/”) and fashions the environment for process 0
  • 47. Creating a new u area
  • 48. Initializing slot 0 in the process table
  • 49. Making root the current directory of process 0Explanation of start Algorithm (contd..)When the environment of process 0 is set up, the system is running as process 0.
  • 50. Process 0 forks invoking the fork algorithm directly from the kernel since it is executing in the kernel mode.Explanation of start Algorithm (contd..)New process, process 1, running in kernel mode, creates its user-level context by allocating a data region and attaching it to its address space.
  • 51. Grows the region to its proper size and copies code from the kernel address space to the new region.
  • 52. Sets up the saved user register context, and “returns” from kernel to user mode , and executes the code it had just copied.
  • 53. Process 1 is a user-level process whereas process 0 is a kernel-level process.Explanation of start Algorithm (contd..)The text for process 1 is copied from the kernel consists of
  • 54. a call to exec system call
  • 55. to execute the process /etc/init
  • 56. Process 1 calls exec and executes the program in the normal fashion.
  • 57. Process 1 is called the “init” process, because it is responsible for initialization of new processes.Why is Process 1 in user mode?It could simply invoke an internal version of exec directly from the kernel, right?
  • 58. That would be complicated because
  • 59. exec would have to parse file names in kernel space, not just in user space
  • 60. this generality for exec would be used only by the init process would slow down its performance in more common cases.init Algorithmalgorithm init/* init process, process 1 of the system */input : noneoutput : none{fd=open(“/etc/inittab”,O_RDONLY);while(line_read(fd,buffer)){/* read every line of file */if(invoked state!=buffer state)continue; /*loop back to while *//* state matched */if(fork()==0){execl(“process specified in buffer”);exit();}/* init process does not wait *//* loop back to while */}
  • 61. init Algorithmwhile((id= wait((int *) 0)) !=-1){/* check here if a spawned child died * consider spawning it *//* Otherwise, just continue */}
  • 62. Explanation of init AlgorithmInit process is a process dispatcher, spawning processes that allow users to log in to the system among others.
  • 63. init reads the file “/etc/inittab” for instructions about which processes to spawn.
  • 64. The above file contains
  • 65. an “id”, a state identifier(single-user, multi-user etc.,)
  • 67. and a program specificationExplanation of init Algorithm(contd…)Init reads the file and if the state it was invoked matches the state identifier
  • 68. creates a process that executes the given program specificationsFor example, it may launch the getty(get teletype) processes to monitor the terminal lines configured n a system.When a user logs in, it goes through the login procedure and execs a login shell.Meanwhile, init executes a wait system call, monitoring the death of its child processes and the death of processes “orphaned” by exiting parentsSometimes in case of essential processes init may consider to respawn it.
  • 69. Other types of Processes and their characteristicsProcesses in UNIX are either user processes, daemon processes or kernel processes.
  • 70. User Processes:Most processes are user processes associated with users at a terminal
  • 71. Daemon Processes: Not associated with any users, but do system-wide functions, such as administration and control of networks, executing of time-dependent activities, line printer spooling and so on.
  • 72. Init may spawn daemon processes that exist throughout the lifetime of a system, or on occasion users may spawn themKernel Processes:Executes only in kernel mode
  • 73. Process 0 spawns kernel processes
  • 74. Similar to daemon processes but have greater control over their execution priorities.
  • 75. Extremely powerful since it can access kernel algorithms and data structures directly without the use of system calls.
  • 76. Not as flexible as daemon processes since kernel needs to be recompiled to change them.THANK YOUContact Me:Facebook : www.facebook.com/arvind.krishnaaTwitter: @TheAkjE-Mail: [email protected]