SlideShare a Scribd company logo
Kernel
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
What Is An Inode?
• An inode (index node) is a control structure that contains key
information needed by theOSto accessaparticular file.
• Several file names may be associated with a single inode, but each file
iscontrolled by exactly ONE inode.
• On the disk, there is an inode table that contains the inodes of all the
filesin thefilesystem.
• When a file is opened, its inode is brought into main memory and
stored in amemory-resident inodetable.
3
Data Structure for File Handling
• InodeTable
• List of all I-nodes
• Global Filetable.
• global to the kernel e.g. the byte offset in the file where the user's next read/write
will start
• theaccessrightsallowed to theopening process. 
• ProcessFileDescriptor table.
• local to every process
• containsinformation liketheidentifiersof thefilesopened by theprocess.
• Whenever, a process creates a file, it gets an index from this table primarily known
as FileDescriptor. 
Interaction Between Tables With An Example
• ExamplE:
• procEss a:
fd1 = opEn("/var/filE1", o_rdonlY);
fd2 = opEn("/var/filE2", o_rdWr);
fd3 = opEn("/var/filE1", o_WronlY);
•
• procEss B:
fd1 = opEn("/var/filE1", o_rdonlY);
fd2 = opEn("/var/filE3", o_rdonlY);
File Descriptors, File Table and Inode table
Explanation Of Figure
•Each o pe n() returns a file descriptor to the process, and
the corresponding entry in the user file descriptor
table points to a unique entry in the global file table even
though a file(/var/file1) is opened more then once. 
•These global file table entries map to the in-core inode
table entry. Every opened file has a unique entry in the
global file table and the user file descriptor table but
kernel keeps only single entry per file in the in-core
inode table.
•Separate entries are created in user file descriptor and
global file table, but only the reference count is
increased in the inode table.
File System
•A file system is consists of a sequence of logical blocks
(512/1024 byteetc.)
•A filesystem hasthefollowing 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
•Inodesareused to accessdisk files.
•Inodesmapsthedisk files
•For each filethereisan inodeentry in theinodelist
block
•Inodelist also keepstrack 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
•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
Processes
• Kernel hasaprocesstablethat keepstract of all activeprocesses
• Each entry in the process table contains pointers to the text, data,
stack and theU Areaof aprocess.
• 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
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
• The UNIX process runs in two modes:
• Usermode
• 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
• 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
Processstatesare-
•Theprocessisrunning in user mode
•Theprocessisrunning in kernel mode
•Theprocessisnot executing, but it isready to run
assoon asthescheduler choosesit
•Theprocessissleeping
• Such aswaiting for I/O to complete
Process State Transition
2
4
1
3asleep
user running
kernel running
ready to run
system call
or interrupt
Interrupt return
schedule processsleep
wakeup
return
context switch permissible
Fork System Call
• When a process is created by fork, it contains duplicate copies of the
text, dataand stack segmentsof itsparent
• 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
Parent
Child
U Area
U Area
stack
data
text
stack
data
Kernel File
Table
Kernel Region
Table
Region
table
Region
table
Kernal

More Related Content

What's hot

Building Embedded Linux Systems Introduction
Building Embedded Linux Systems IntroductionBuilding Embedded Linux Systems Introduction
Building Embedded Linux Systems Introduction
Sherif Mousa
 
Linux architecture
Linux architectureLinux architecture
Linux architecturemcganesh
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in Linux
Henry Osborne
 
Chapter 13 file systems
Chapter 13   file systemsChapter 13   file systems
Chapter 13 file systems
Alvin Chin
 
NTFS and Inode
NTFS and InodeNTFS and Inode
NTFS and Inode
Amit Seal Ami
 
Process Scheduling
Process SchedulingProcess Scheduling
Process Scheduling
vampugani
 
Chapter 8 Operating Systems silberschatz : deadlocks
Chapter 8 Operating Systems silberschatz : deadlocksChapter 8 Operating Systems silberschatz : deadlocks
Chapter 8 Operating Systems silberschatz : deadlocks
GiulianoRanauro
 
Unix files
Unix filesUnix files
Unix files
Sunil Rm
 
OS Unit 5 - Memory Management
OS Unit 5 - Memory ManagementOS Unit 5 - Memory Management
OS Unit 5 - Memory Management
Gyanmanjari Institute Of Technology
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual Memory
Wayne Jones Jnr
 
Os structure
Os structureOs structure
Os structureMohd Arif
 
File system Os
File system OsFile system Os
File system Os
Nehal Naik
 
Page Cache in Linux 2.6.pdf
Page Cache in Linux 2.6.pdfPage Cache in Linux 2.6.pdf
Page Cache in Linux 2.6.pdf
ycelgemici1
 
Linux file system
Linux file systemLinux file system
Linux file system
Md. Tanvir Hossain
 
The Anatomy Of The Google Architecture Fina Lv1.1
The Anatomy Of The Google Architecture Fina Lv1.1The Anatomy Of The Google Architecture Fina Lv1.1
The Anatomy Of The Google Architecture Fina Lv1.1
Hassy Veldstra
 
Storage Management in Linux OS.ppt
Storage Management in Linux OS.pptStorage Management in Linux OS.ppt
Storage Management in Linux OS.ppt
Rakesh Kadu
 
Linux Kernel and Driver Development Training
Linux Kernel and Driver Development TrainingLinux Kernel and Driver Development Training
Linux Kernel and Driver Development Training
Stephan Cadene
 
Course 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsCourse 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and Permissions
Ahmed El-Arabawy
 
1 introduction to windows server 2016
1  introduction to windows server 20161  introduction to windows server 2016
1 introduction to windows server 2016
Hameda Hurmat
 
NTFS file system
NTFS file systemNTFS file system
NTFS file system
Ravi Yasas
 

What's hot (20)

Building Embedded Linux Systems Introduction
Building Embedded Linux Systems IntroductionBuilding Embedded Linux Systems Introduction
Building Embedded Linux Systems Introduction
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in Linux
 
Chapter 13 file systems
Chapter 13   file systemsChapter 13   file systems
Chapter 13 file systems
 
NTFS and Inode
NTFS and InodeNTFS and Inode
NTFS and Inode
 
Process Scheduling
Process SchedulingProcess Scheduling
Process Scheduling
 
Chapter 8 Operating Systems silberschatz : deadlocks
Chapter 8 Operating Systems silberschatz : deadlocksChapter 8 Operating Systems silberschatz : deadlocks
Chapter 8 Operating Systems silberschatz : deadlocks
 
Unix files
Unix filesUnix files
Unix files
 
OS Unit 5 - Memory Management
OS Unit 5 - Memory ManagementOS Unit 5 - Memory Management
OS Unit 5 - Memory Management
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual Memory
 
Os structure
Os structureOs structure
Os structure
 
File system Os
File system OsFile system Os
File system Os
 
Page Cache in Linux 2.6.pdf
Page Cache in Linux 2.6.pdfPage Cache in Linux 2.6.pdf
Page Cache in Linux 2.6.pdf
 
Linux file system
Linux file systemLinux file system
Linux file system
 
The Anatomy Of The Google Architecture Fina Lv1.1
The Anatomy Of The Google Architecture Fina Lv1.1The Anatomy Of The Google Architecture Fina Lv1.1
The Anatomy Of The Google Architecture Fina Lv1.1
 
Storage Management in Linux OS.ppt
Storage Management in Linux OS.pptStorage Management in Linux OS.ppt
Storage Management in Linux OS.ppt
 
Linux Kernel and Driver Development Training
Linux Kernel and Driver Development TrainingLinux Kernel and Driver Development Training
Linux Kernel and Driver Development Training
 
Course 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsCourse 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and Permissions
 
1 introduction to windows server 2016
1  introduction to windows server 20161  introduction to windows server 2016
1 introduction to windows server 2016
 
NTFS file system
NTFS file systemNTFS file system
NTFS file system
 

Similar to Kernal

Kernal
KernalKernal
Kernal
Ramasubbu .P
 
Os
OsOs
Structure of processes ppt
Structure of processes pptStructure of processes ppt
Structure of processes ppt
Yojana Nanaware
 
UNIT I.pptx
UNIT I.pptxUNIT I.pptx
UNIT I.pptx
YogapriyaJ1
 
Operating systems (For CBSE School Students)
Operating systems (For CBSE School Students)Operating systems (For CBSE School Students)
Operating systems (For CBSE School Students)
Gaurav Aggarwal
 
OS Internals and Portable Executable File Format
OS Internals and Portable Executable File FormatOS Internals and Portable Executable File Format
OS Internals and Portable Executable File Format
Aitezaz Mohsin
 
Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)
Ahmed El-Arabawy
 
Operating Systems & Applications
Operating Systems & ApplicationsOperating Systems & Applications
Operating Systems & Applications
Maulen Bale
 
File system and Deadlocks
File system and DeadlocksFile system and Deadlocks
File system and Deadlocks
Rohit Jain
 
Ch2
Ch2Ch2
File Management & Access Control
File Management & Access Control File Management & Access Control
File Management & Access Control
YuvrajWadavale
 
Systems Programming - File IO
Systems Programming - File IOSystems Programming - File IO
Systems Programming - File IO
HelpWithAssignment.com
 
Chap1_Part2.pptx
Chap1_Part2.pptxChap1_Part2.pptx
Chap1_Part2.pptx
NMohd3
 
ch1.ppt
ch1.pptch1.ppt
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Ahmed El-Arabawy
 
unixoperatingsystem-130327073532-phpapp01.pdf
unixoperatingsystem-130327073532-phpapp01.pdfunixoperatingsystem-130327073532-phpapp01.pdf
unixoperatingsystem-130327073532-phpapp01.pdf
IxtiyorTeshaboyev
 
Unix operating system
Unix operating systemUnix operating system
Unix operating system
ABhay Panchal
 
2nd unit part 1
2nd unit  part 12nd unit  part 1
2nd unit part 1
Pavan Illa
 
chapter1.ppt
chapter1.pptchapter1.ppt
chapter1.ppt
UsamaKhan987353
 
Unix Operaring System
Unix Operaring SystemUnix Operaring System
Unix Operaring System
Mahnoor Shaukat
 

Similar to Kernal (20)

Kernal
KernalKernal
Kernal
 
Os
OsOs
Os
 
Structure of processes ppt
Structure of processes pptStructure of processes ppt
Structure of processes ppt
 
UNIT I.pptx
UNIT I.pptxUNIT I.pptx
UNIT I.pptx
 
Operating systems (For CBSE School Students)
Operating systems (For CBSE School Students)Operating systems (For CBSE School Students)
Operating systems (For CBSE School Students)
 
OS Internals and Portable Executable File Format
OS Internals and Portable Executable File FormatOS Internals and Portable Executable File Format
OS Internals and Portable Executable File Format
 
Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)
 
Operating Systems & Applications
Operating Systems & ApplicationsOperating Systems & Applications
Operating Systems & Applications
 
File system and Deadlocks
File system and DeadlocksFile system and Deadlocks
File system and Deadlocks
 
Ch2
Ch2Ch2
Ch2
 
File Management & Access Control
File Management & Access Control File Management & Access Control
File Management & Access Control
 
Systems Programming - File IO
Systems Programming - File IOSystems Programming - File IO
Systems Programming - File IO
 
Chap1_Part2.pptx
Chap1_Part2.pptxChap1_Part2.pptx
Chap1_Part2.pptx
 
ch1.ppt
ch1.pptch1.ppt
ch1.ppt
 
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1)
 
unixoperatingsystem-130327073532-phpapp01.pdf
unixoperatingsystem-130327073532-phpapp01.pdfunixoperatingsystem-130327073532-phpapp01.pdf
unixoperatingsystem-130327073532-phpapp01.pdf
 
Unix operating system
Unix operating systemUnix operating system
Unix operating system
 
2nd unit part 1
2nd unit  part 12nd unit  part 1
2nd unit part 1
 
chapter1.ppt
chapter1.pptchapter1.ppt
chapter1.ppt
 
Unix Operaring System
Unix Operaring SystemUnix Operaring System
Unix Operaring System
 

More from Asaduzzaman Kanok

Daffodil International University cover page
Daffodil International University cover pageDaffodil International University cover page
Daffodil International University cover page
Asaduzzaman Kanok
 
market structure in economics
market structure in economicsmarket structure in economics
market structure in economics
Asaduzzaman Kanok
 
Determining Requirements In System Analysis And Dsign
Determining Requirements In System Analysis And DsignDetermining Requirements In System Analysis And Dsign
Determining Requirements In System Analysis And Dsign
Asaduzzaman Kanok
 
Assembly Language In Electronics
Assembly Language In ElectronicsAssembly Language In Electronics
Assembly Language In Electronics
Asaduzzaman Kanok
 
Presentation on Modem working procedures
 Presentation on Modem working procedures Presentation on Modem working procedures
Presentation on Modem working procedures
Asaduzzaman Kanok
 
Ethical hacking
Ethical hackingEthical hacking
Ethical hacking
Asaduzzaman Kanok
 
Correlation Analysis
Correlation AnalysisCorrelation Analysis
Correlation Analysis
Asaduzzaman Kanok
 
Networking slide
Networking slideNetworking slide
Networking slide
Asaduzzaman Kanok
 
Rural Development in bangladesh
Rural Development in bangladeshRural Development in bangladesh
Rural Development in bangladesh
Asaduzzaman Kanok
 

More from Asaduzzaman Kanok (9)

Daffodil International University cover page
Daffodil International University cover pageDaffodil International University cover page
Daffodil International University cover page
 
market structure in economics
market structure in economicsmarket structure in economics
market structure in economics
 
Determining Requirements In System Analysis And Dsign
Determining Requirements In System Analysis And DsignDetermining Requirements In System Analysis And Dsign
Determining Requirements In System Analysis And Dsign
 
Assembly Language In Electronics
Assembly Language In ElectronicsAssembly Language In Electronics
Assembly Language In Electronics
 
Presentation on Modem working procedures
 Presentation on Modem working procedures Presentation on Modem working procedures
Presentation on Modem working procedures
 
Ethical hacking
Ethical hackingEthical hacking
Ethical hacking
 
Correlation Analysis
Correlation AnalysisCorrelation Analysis
Correlation Analysis
 
Networking slide
Networking slideNetworking slide
Networking slide
 
Rural Development in bangladesh
Rural Development in bangladeshRural Development in bangladesh
Rural Development in bangladesh
 

Recently uploaded

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
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
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
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
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
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
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
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 

Recently uploaded (20)

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
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
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
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.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
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
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.
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 

Kernal

  • 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. What Is An Inode? • An inode (index node) is a control structure that contains key information needed by theOSto accessaparticular file. • Several file names may be associated with a single inode, but each file iscontrolled by exactly ONE inode. • On the disk, there is an inode table that contains the inodes of all the filesin thefilesystem. • When a file is opened, its inode is brought into main memory and stored in amemory-resident inodetable. 3
  • 4. Data Structure for File Handling • InodeTable • List of all I-nodes • Global Filetable. • global to the kernel e.g. the byte offset in the file where the user's next read/write will start • theaccessrightsallowed to theopening process.  • ProcessFileDescriptor table. • local to every process • containsinformation liketheidentifiersof thefilesopened by theprocess. • Whenever, a process creates a file, it gets an index from this table primarily known as FileDescriptor. 
  • 5. Interaction Between Tables With An Example • ExamplE: • procEss a: fd1 = opEn("/var/filE1", o_rdonlY); fd2 = opEn("/var/filE2", o_rdWr); fd3 = opEn("/var/filE1", o_WronlY); • • procEss B: fd1 = opEn("/var/filE1", o_rdonlY); fd2 = opEn("/var/filE3", o_rdonlY);
  • 6. File Descriptors, File Table and Inode table
  • 7. Explanation Of Figure •Each o pe n() returns a file descriptor to the process, and the corresponding entry in the user file descriptor table points to a unique entry in the global file table even though a file(/var/file1) is opened more then once.  •These global file table entries map to the in-core inode table entry. Every opened file has a unique entry in the global file table and the user file descriptor table but kernel keeps only single entry per file in the in-core inode table. •Separate entries are created in user file descriptor and global file table, but only the reference count is increased in the inode table.
  • 8. File System •A file system is consists of a sequence of logical blocks (512/1024 byteetc.) •A filesystem hasthefollowing structure: Boot Block Super Block Inode List Data Blocks
  • 9. 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
  • 10. 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
  • 11. File System: Inode List •Inodesareused to accessdisk files. •Inodesmapsthedisk files •For each filethereisan inodeentry in theinodelist block •Inodelist also keepstrack of directory structure
  • 12. 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
  • 13. Processes •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
  • 14. Processes • Kernel hasaprocesstablethat keepstract of all activeprocesses • Each entry in the process table contains pointers to the text, data, stack and theU Areaof aprocess. • 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
  • 15. Kernel Support for Process Text Stack DataFile Descriptor Table Per Process Region Table Kernel Process Table Kernel Region TableA Process U Area
  • 16. 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.
  • 17. Mode of Process Execution • The UNIX process runs in two modes: • Usermode • 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 • 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.
  • 18. Process States Processstatesare- •Theprocessisrunning in user mode •Theprocessisrunning in kernel mode •Theprocessisnot executing, but it isready to run assoon asthescheduler choosesit •Theprocessissleeping • Such aswaiting for I/O to complete
  • 19. Process State Transition 2 4 1 3asleep user running kernel running ready to run system call or interrupt Interrupt return schedule processsleep wakeup return context switch permissible
  • 20. Fork System Call • When a process is created by fork, it contains duplicate copies of the text, dataand stack segmentsof itsparent • 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 Parent Child U Area U Area stack data text stack data Kernel File Table Kernel Region Table Region table Region table