SlideShare a Scribd company logo
Introduction to Kernel
Topics
– Kernel Architecture
– File System
– Process
Reference:
The Design of the UNIX Operating System
by Maurice J. Bach
kernel Architecture (UNIX)
Library
hardware
File Subsystem
character block
Hardware control
Buffer Cache
system call interface
Device driver
Inter process
communication
Scheduler
Memory
Managemen
t
Process Control
Subsystem
User program
User level
kernel level
User level
kernel level
File System
• A file system is consists of a sequence of logical blocks
(512/1024 byte etc.)
• A file system has the following structure:
Boot Block Super Block Inode List Data Blocks
File System: Boot Block
• The beginning of the file system
• Contains bootstrap code to load the operating
system
• Initialize the operating system
• Typically occupies the first sector of the disk
File System: Super Block
• Describes the state of a file system
• Describes the size of the file system
– How many files it can store
• Where to find free space on the file system
• Other information
File System: Inode List
• Inodes are used to access disk files.
• Inodes maps the disk files
• For each file there is an inode entry in the inode
list block
• Inode list also keeps track of directory structure
File System: Data Block
• Starts at the end of the inode list
• Contains disk files
• An allocated data block can belong to one and
only one file in the file system
Processes(1)
• A process is the execution of a program
• A process is consists of text (machine code), data and stack
• Many process can run simultaneously as kernel schedules
them for execution
• Several processes may be instances of one program
• A process reads and writes its data and stack sections, but it
cannot read or write the data and stack of other processes
• A process communicates with other processes and the rest
of the world via system calls
Processes(2)
• Kernel has a process table that keeps tract of all
active processes
• Each entry in the process table contains pointers to
the text, data, stack and the U Area of a process.
• All processes in UNIX system, except the very first
process (process 0) which is created by the system
boot code, are created by the fork system call
Kernel Support for Process
Text
Stack
DataFile Descriptor Table
Per Process Region Table
Kernel Process
Table
Kernel Region
TableA Process
U Area
Process: Region Table
• Region table entries describes the attributes of
the region, such as whether it contains text or
data, whether it is shared or private
• The extra level from the per process region table
to kernel region table allows independent
processes to share regions.
Process: U Area
• U Area is the extension of process table entry.
• Fields of process table entry:
– State field
– User ID (UID)
• Fields of U Area
– Pointer to process table entry
– File descriptors of all open files
– Current directory and current root
– I/O parameters
– Process and file size limit
• Kernel can directly access fields of the U Area of the
executing process but not of the U Area of other processes
Process Context
• The context of a process is its state:
– Text, data( variable), register
– Process region table, U Area,
– User stack and kernel stack
• When executing a process, the system is said to
be executing in the context of the process.
Context Switch
• When the kernel decides that it should execute
another process, it does a context switch, so that
the system executes in the context of the other
process
• When doing a context switch, the kernel saves
enough information so that it can later switch
back to the first process and resume its
execution.
Mode of Process Execution(1)
• The UNIX process runs in two modes:
– User mode
• Can access its own instructions and data, but not kernel
instruction and data
– Kernel mode
• Can access kernel and user instructions and data
• When a process executes a system call, the
execution mode of the process changes from
user mode to kernel mode
Mode of Process Execution(2)
• When moving from user to kernel mode, the
kernel saves enough information so that it can
later return to user mode and continue execution
from where it left off.
• Mode change is not a context switch, just
change in mode.
Process States
Process states are:
– The process is running in user mode
– The process is running in kernel mode
– The process is not executing, but it is ready to run as
soon as the scheduler chooses it
– The process is sleeping
• Such as waiting for I/O to complete
Process State Transition(1)
2
4
1
3asleep
user running
kernel running
ready to run
system call
or interrupt
Interrupt return
schedule processsleep
wakeup
return
context switch
permissible
Process State Transition(2)
• The kernel allows a context switch only when a
process moves from the state kernel running to
the state asleep
• Process running in kernel mode cannot be
preempted by other processes.
Fork System Call(1)
• When a process is created by fork, it contains
duplicate copies of the text, data and stack
segments of its parent
• Also it has a File Descriptor Table (FDT) that
contains references to the same opened files as
its parent, such that they both share the same
file pointer to each opened file
Fork System Call(2)
U Area
U Area
stack
data
text
stack
data
Kernel File
Table
Kernel Region
Table
Parent
Child
Region
table
Region
table

More Related Content

What's hot

Modules and modularization criteria
Modules and modularization criteriaModules and modularization criteria
Modules and modularization criteria
Umaselvi_R
 
Middleware Technologies ppt
Middleware Technologies pptMiddleware Technologies ppt
Middleware Technologies ppt
OECLIB Odisha Electronics Control Library
 
Hld lld
Hld lldHld lld
Hld lld
yprajapati
 
IO buffering
IO bufferingIO buffering
IO buffering
Gunjan Mandaliya
 
Operating System: Deadlock
Operating System: DeadlockOperating System: Deadlock
Operating System: Deadlock
InteX Research Lab
 
Language and Processors for Requirements Specification
Language and Processors for Requirements SpecificationLanguage and Processors for Requirements Specification
Language and Processors for Requirements Specification
kirupasuchi1996
 
Software Engineering Overview
Software Engineering OverviewSoftware Engineering Overview
Software Engineering Overview
Prachi Sasankar
 
Evaluation of morden computer & system attributes in ACA
Evaluation of morden computer &  system attributes in ACAEvaluation of morden computer &  system attributes in ACA
Evaluation of morden computer & system attributes in ACA
Pankaj Kumar Jain
 
Software requirement and specification
Software requirement and specificationSoftware requirement and specification
Software requirement and specification
Aman Adhikari
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Ravindra Raju Kolahalam
 
Planning the development process
Planning the development processPlanning the development process
Planning the development process
Siva Priya
 
Distributed Operating System_1
Distributed Operating System_1Distributed Operating System_1
Distributed Operating System_1
Dr Sandeep Kumar Poonia
 
Operating System Process Synchronization
Operating System Process SynchronizationOperating System Process Synchronization
Operating System Process Synchronization
Haziq Naeem
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
Prakhar Maurya
 
business analysis-Data warehousing
business analysis-Data warehousingbusiness analysis-Data warehousing
business analysis-Data warehousing
Dhilsath Fathima
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)
Mukesh Chinta
 
Operating systems system structures
Operating systems   system structuresOperating systems   system structures
Operating systems system structures
Mukesh Chinta
 

What's hot (20)

Modules and modularization criteria
Modules and modularization criteriaModules and modularization criteria
Modules and modularization criteria
 
operating system structure
operating system structureoperating system structure
operating system structure
 
Middleware Technologies ppt
Middleware Technologies pptMiddleware Technologies ppt
Middleware Technologies ppt
 
Hld lld
Hld lldHld lld
Hld lld
 
IO buffering
IO bufferingIO buffering
IO buffering
 
Operating System: Deadlock
Operating System: DeadlockOperating System: Deadlock
Operating System: Deadlock
 
Language and Processors for Requirements Specification
Language and Processors for Requirements SpecificationLanguage and Processors for Requirements Specification
Language and Processors for Requirements Specification
 
Software Engineering Overview
Software Engineering OverviewSoftware Engineering Overview
Software Engineering Overview
 
Evaluation of morden computer & system attributes in ACA
Evaluation of morden computer &  system attributes in ACAEvaluation of morden computer &  system attributes in ACA
Evaluation of morden computer & system attributes in ACA
 
Software requirement and specification
Software requirement and specificationSoftware requirement and specification
Software requirement and specification
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
 
Planning the development process
Planning the development processPlanning the development process
Planning the development process
 
message passing
 message passing message passing
message passing
 
Distributed Operating System_1
Distributed Operating System_1Distributed Operating System_1
Distributed Operating System_1
 
Characteristics of cloud computing
Characteristics of cloud computingCharacteristics of cloud computing
Characteristics of cloud computing
 
Operating System Process Synchronization
Operating System Process SynchronizationOperating System Process Synchronization
Operating System Process Synchronization
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 
business analysis-Data warehousing
business analysis-Data warehousingbusiness analysis-Data warehousing
business analysis-Data warehousing
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)
 
Operating systems system structures
Operating systems   system structuresOperating systems   system structures
Operating systems system structures
 

Viewers also liked

What is a Kernel? : Introduction And Architecture
What is a Kernel? : Introduction And ArchitectureWhat is a Kernel? : Introduction And Architecture
What is a Kernel? : Introduction And Architecture
pec2013
 
Ch2
Ch2Ch2
Operating system kernal
Operating system kernalOperating system kernal
Operating system kernal
Sumit Rajpal
 
What is Kernel, basic idea of kernel
What is Kernel, basic idea of kernelWhat is Kernel, basic idea of kernel
What is Kernel, basic idea of kernel
Neel Parikh
 
Kernel (OS)
Kernel (OS)Kernel (OS)
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernel
Dominique Cimafranca
 
KERNAL ARCHITECTURE
KERNAL ARCHITECTUREKERNAL ARCHITECTURE
KERNAL ARCHITECTURE
lakshmipanat
 
Unit 8
Unit 8Unit 8
Unit 8siddr
 
NTFS and Inode
NTFS and InodeNTFS and Inode
NTFS and Inode
Amit Seal Ami
 
Unix processes
Unix processesUnix processes
Unix processes
Sunil Rm
 
Chapter 1: Introduction to Unix / Linux Kernel
Chapter 1: Introduction to Unix / Linux KernelChapter 1: Introduction to Unix / Linux Kernel
Chapter 1: Introduction to Unix / Linux Kernel
Dr.Ashvini Chaudhari Bhongade
 
Api pour les nuls
Api pour les nulsApi pour les nuls
Api pour les nuls
Patrick Bouillaud
 
Unit 1
Unit 1Unit 1
Unit 1siddr
 
Linux files
Linux filesLinux files
Linux files
Geeta Vinnakota
 
RTOS
RTOSRTOS
The linux file system structure
The linux file system structureThe linux file system structure
The linux file system structureTeja Bheemanapally
 

Viewers also liked (20)

What is a Kernel? : Introduction And Architecture
What is a Kernel? : Introduction And ArchitectureWhat is a Kernel? : Introduction And Architecture
What is a Kernel? : Introduction And Architecture
 
Ch2
Ch2Ch2
Ch2
 
Unix kernal
Unix kernalUnix kernal
Unix kernal
 
Operating system kernal
Operating system kernalOperating system kernal
Operating system kernal
 
What is Kernel, basic idea of kernel
What is Kernel, basic idea of kernelWhat is Kernel, basic idea of kernel
What is Kernel, basic idea of kernel
 
Kernel (OS)
Kernel (OS)Kernel (OS)
Kernel (OS)
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernel
 
KERNAL ARCHITECTURE
KERNAL ARCHITECTUREKERNAL ARCHITECTURE
KERNAL ARCHITECTURE
 
Kernel (computing)
Kernel (computing)Kernel (computing)
Kernel (computing)
 
Linux kernel architecture
Linux kernel architectureLinux kernel architecture
Linux kernel architecture
 
Unit 8
Unit 8Unit 8
Unit 8
 
NTFS and Inode
NTFS and InodeNTFS and Inode
NTFS and Inode
 
Unix processes
Unix processesUnix processes
Unix processes
 
Chapter 1: Introduction to Unix / Linux Kernel
Chapter 1: Introduction to Unix / Linux KernelChapter 1: Introduction to Unix / Linux Kernel
Chapter 1: Introduction to Unix / Linux Kernel
 
Api pour les nuls
Api pour les nulsApi pour les nuls
Api pour les nuls
 
Unit 1
Unit 1Unit 1
Unit 1
 
Linux files
Linux filesLinux files
Linux files
 
RTOS
RTOSRTOS
RTOS
 
Unix ch03-03(2)
Unix ch03-03(2)Unix ch03-03(2)
Unix ch03-03(2)
 
The linux file system structure
The linux file system structureThe linux file system structure
The linux file system structure
 

Similar to Kernal

Kernal
KernalKernal
Structure of processes ppt
Structure of processes pptStructure of processes ppt
Structure of processes ppt
Yojana Nanaware
 
Chap1_Part2.pptx
Chap1_Part2.pptxChap1_Part2.pptx
Chap1_Part2.pptx
NMohd3
 
Os
OsOs
Unix operating system
Unix operating systemUnix operating system
Unix operating system
ABhay Panchal
 
unixoperatingsystem-130327073532-phpapp01.pdf
unixoperatingsystem-130327073532-phpapp01.pdfunixoperatingsystem-130327073532-phpapp01.pdf
unixoperatingsystem-130327073532-phpapp01.pdf
IxtiyorTeshaboyev
 
UNIT I.pptx
UNIT I.pptxUNIT I.pptx
UNIT I.pptx
YogapriyaJ1
 
Unix Operaring System
Unix Operaring SystemUnix Operaring System
Unix Operaring System
Mahnoor Shaukat
 
The structure of process
The structure of processThe structure of process
The structure of process
Abhaysinh Surve
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
ICI Bucharest - roTLD
 
Chap3.ppt
Chap3.pptChap3.ppt
Chap3.ppt
amerdawood2
 
UNIX Operating System
UNIX Operating SystemUNIX Operating System
UNIX Operating System
Fatima Qayyum
 
Advanced Operating Systems......Process Management
Advanced Operating Systems......Process ManagementAdvanced Operating Systems......Process Management
Advanced Operating Systems......Process Management
Veejeya Kumbhar
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System Calls
Vandana Salve
 
Operating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfOperating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdf
FahanaAbdulVahab
 
Bsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systemsBsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systems
Rai University
 

Similar to Kernal (20)

Kernal
KernalKernal
Kernal
 
Structure of processes ppt
Structure of processes pptStructure of processes ppt
Structure of processes ppt
 
Chap1_Part2.pptx
Chap1_Part2.pptxChap1_Part2.pptx
Chap1_Part2.pptx
 
Os
OsOs
Os
 
Unix operating system
Unix operating systemUnix operating system
Unix operating system
 
unixoperatingsystem-130327073532-phpapp01.pdf
unixoperatingsystem-130327073532-phpapp01.pdfunixoperatingsystem-130327073532-phpapp01.pdf
unixoperatingsystem-130327073532-phpapp01.pdf
 
Os concepts
Os conceptsOs concepts
Os concepts
 
UNIT I.pptx
UNIT I.pptxUNIT I.pptx
UNIT I.pptx
 
Unix Operaring System
Unix Operaring SystemUnix Operaring System
Unix Operaring System
 
Os
OsOs
Os
 
The structure of process
The structure of processThe structure of process
The structure of process
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
 
Chap3.ppt
Chap3.pptChap3.ppt
Chap3.ppt
 
Os1
Os1Os1
Os1
 
UNIX Operating System
UNIX Operating SystemUNIX Operating System
UNIX Operating System
 
Advanced Operating Systems......Process Management
Advanced Operating Systems......Process ManagementAdvanced Operating Systems......Process Management
Advanced Operating Systems......Process Management
 
Advanced_OS_Unit 1 & 2.ppt
Advanced_OS_Unit 1 & 2.pptAdvanced_OS_Unit 1 & 2.ppt
Advanced_OS_Unit 1 & 2.ppt
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System Calls
 
Operating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfOperating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdf
 
Bsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systemsBsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systems
 

More from Ramasubbu .P

radar
radarradar
Press
PressPress
Milling 2
Milling 2Milling 2
Milling 2
Ramasubbu .P
 
MIlling 1
MIlling 1MIlling 1
MIlling 1
Ramasubbu .P
 
Drillings
DrillingsDrillings
Drillings
Ramasubbu .P
 
Holding
HoldingHolding
Holding
Ramasubbu .P
 
Saftey
SafteySaftey
Saftey
Ramasubbu .P
 
Harvesting
HarvestingHarvesting
Harvesting
Ramasubbu .P
 
Plough
PloughPlough
Plough
Ramasubbu .P
 
Tractor PTO
Tractor PTOTractor PTO
Tractor PTO
Ramasubbu .P
 
Tractor Components
Tractor ComponentsTractor Components
Tractor Components
Ramasubbu .P
 
MSAT
MSATMSAT
GPS
GPSGPS
Virus
VirusVirus
Hacker
HackerHacker
Hacker
Ramasubbu .P
 
RAID CONCEPT
RAID CONCEPTRAID CONCEPT
RAID CONCEPT
Ramasubbu .P
 
Network Security
Network SecurityNetwork Security
Network Security
Ramasubbu .P
 
Timer
TimerTimer
Sequential Logic Circuit
Sequential Logic CircuitSequential Logic Circuit
Sequential Logic Circuit
Ramasubbu .P
 

More from Ramasubbu .P (20)

radar
radarradar
radar
 
Press
PressPress
Press
 
Milling 2
Milling 2Milling 2
Milling 2
 
MIlling 1
MIlling 1MIlling 1
MIlling 1
 
Drillings
DrillingsDrillings
Drillings
 
Holding
HoldingHolding
Holding
 
Saftey
SafteySaftey
Saftey
 
Harvesting
HarvestingHarvesting
Harvesting
 
Plough
PloughPlough
Plough
 
Tractor PTO
Tractor PTOTractor PTO
Tractor PTO
 
Tractor Components
Tractor ComponentsTractor Components
Tractor Components
 
MSAT
MSATMSAT
MSAT
 
GPS
GPSGPS
GPS
 
Virus
VirusVirus
Virus
 
Hacker
HackerHacker
Hacker
 
Denail of Service
Denail of ServiceDenail of Service
Denail of Service
 
RAID CONCEPT
RAID CONCEPTRAID CONCEPT
RAID CONCEPT
 
Network Security
Network SecurityNetwork Security
Network Security
 
Timer
TimerTimer
Timer
 
Sequential Logic Circuit
Sequential Logic CircuitSequential Logic Circuit
Sequential Logic Circuit
 

Recently uploaded

Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 

Recently uploaded (20)

Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 

Kernal

  • 1. Introduction to Kernel Topics – Kernel Architecture – File System – Process Reference: The Design of the UNIX Operating System by Maurice J. Bach
  • 2. kernel Architecture (UNIX) Library hardware File Subsystem character block Hardware control Buffer Cache system call interface Device driver Inter process communication Scheduler Memory Managemen t Process Control Subsystem User program User level kernel level User level kernel level
  • 3. File System • A file system is consists of a sequence of logical blocks (512/1024 byte etc.) • A file system has the following structure: Boot Block Super Block Inode List Data Blocks
  • 4. File System: Boot Block • The beginning of the file system • Contains bootstrap code to load the operating system • Initialize the operating system • Typically occupies the first sector of the disk
  • 5. File System: Super Block • Describes the state of a file system • Describes the size of the file system – How many files it can store • Where to find free space on the file system • Other information
  • 6. File System: Inode List • Inodes are used to access disk files. • Inodes maps the disk files • For each file there is an inode entry in the inode list block • Inode list also keeps track of directory structure
  • 7. File System: Data Block • Starts at the end of the inode list • Contains disk files • An allocated data block can belong to one and only one file in the file system
  • 8. Processes(1) • A process is the execution of a program • A process is consists of text (machine code), data and stack • Many process can run simultaneously as kernel schedules them for execution • Several processes may be instances of one program • A process reads and writes its data and stack sections, but it cannot read or write the data and stack of other processes • A process communicates with other processes and the rest of the world via system calls
  • 9. Processes(2) • Kernel has a process table that keeps tract of all active processes • Each entry in the process table contains pointers to the text, data, stack and the U Area of a process. • All processes in UNIX system, except the very first process (process 0) which is created by the system boot code, are created by the fork system call
  • 10. Kernel Support for Process Text Stack DataFile Descriptor Table Per Process Region Table Kernel Process Table Kernel Region TableA Process U Area
  • 11. Process: Region Table • Region table entries describes the attributes of the region, such as whether it contains text or data, whether it is shared or private • The extra level from the per process region table to kernel region table allows independent processes to share regions.
  • 12. Process: U Area • U Area is the extension of process table entry. • Fields of process table entry: – State field – User ID (UID) • Fields of U Area – Pointer to process table entry – File descriptors of all open files – Current directory and current root – I/O parameters – Process and file size limit • Kernel can directly access fields of the U Area of the executing process but not of the U Area of other processes
  • 13. Process Context • The context of a process is its state: – Text, data( variable), register – Process region table, U Area, – User stack and kernel stack • When executing a process, the system is said to be executing in the context of the process.
  • 14. Context Switch • When the kernel decides that it should execute another process, it does a context switch, so that the system executes in the context of the other process • When doing a context switch, the kernel saves enough information so that it can later switch back to the first process and resume its execution.
  • 15. Mode of Process Execution(1) • The UNIX process runs in two modes: – User mode • Can access its own instructions and data, but not kernel instruction and data – Kernel mode • Can access kernel and user instructions and data • When a process executes a system call, the execution mode of the process changes from user mode to kernel mode
  • 16. Mode of Process Execution(2) • When moving from user to kernel mode, the kernel saves enough information so that it can later return to user mode and continue execution from where it left off. • Mode change is not a context switch, just change in mode.
  • 17. Process States Process states are: – The process is running in user mode – The process is running in kernel mode – The process is not executing, but it is ready to run as soon as the scheduler chooses it – The process is sleeping • Such as waiting for I/O to complete
  • 18. Process State Transition(1) 2 4 1 3asleep user running kernel running ready to run system call or interrupt Interrupt return schedule processsleep wakeup return context switch permissible
  • 19. Process State Transition(2) • The kernel allows a context switch only when a process moves from the state kernel running to the state asleep • Process running in kernel mode cannot be preempted by other processes.
  • 20. Fork System Call(1) • When a process is created by fork, it contains duplicate copies of the text, data and stack segments of its parent • Also it has a File Descriptor Table (FDT) that contains references to the same opened files as its parent, such that they both share the same file pointer to each opened file
  • 21. Fork System Call(2) U Area U Area stack data text stack data Kernel File Table Kernel Region Table Parent Child Region table Region table