Unix Internals Unix Internals: Introduction To Kernel Introduction To Kernel
Unix Internals Unix Internals: Introduction To Kernel Introduction To Kernel
INTRODUCTION TO KERNEL
1. The student shall be able to “draw & brief” UNIX Kernel Architecture
2. The student shall be able to list the CHARACTERS of File & Process Sub-
system
3. The student shall be able to brief the File Sub System - Buffering
mechanism
4. The student shall be able to narrate on Programs, Libraries & System calls
& its interaction
1. The student shall be able to explain the working of File Sub-system &
inodes
2. The student shall be able to list the CHARACTERS of File & Process Sub-
system
3. The student shall be able to “draw & brief” File Sub-system Layout & its
entities
5. The student shall be able to “draw & brief” Kernel & User Stacks..
6. The student shall be able to list & explain Process states & its transitions
During Compilation,
what happens to System calls & Libraries ?
1. Manages files
2. Allocating file space
3. Administering free space
4. Controlling access to files
5. Retrieving data for users
Buffering Mechanism
Regulates data flow between the kernel and secondary storage devices.
Interacts with block I/O device drivers to initiate data transfer to and
from the kernel.
http://unix.stackexchange.com/questions/60034/what-are-
character-special-and-block-special-files-in-a-unix-system
1. Process Synchronization
2. Inter Process Communication
3. Memory Management
4. Process Scheduling.
Processes interact with the file subsystem via a specific set of system
calls;
open
close
Read
write
stat
chown
chmod
If system does not have enough physical memory for all processes, the
kernel moves them between main memory and secondary memory
called as swapping
Remember !!!
swap device -- swapping system -- paging system
Student Copy – JUNE 2015
UNIX Kernel Architecture –
THE PROCESS CONTROL SUBSYSTEM
SCHEDULER
INTER-PROCESS COMMUNICATION
Inter-process communication, ranging from asynchronous signaling of
events to synchronous transmission of messages between processes
Introduction To Kernel
Interaction <--> File Sub System & Process Control Sub System
The Process Control Sub System - IPC, Scheduler & Memory Mgmt
1. The student shall be able to explain the working of File Sub-system &
inodes
2. The student shall be able to list the CHARACTERS of File & Process Sub-
system
3. The student shall be able to “draw & brief” File Sub-system Layout & its
entities
5. The student shall be able to “draw & brief” Kernel & User Stacks..
6. The student shall be able to list & explain Process states & its transitions
2. PROCESSES
INTERNAL REPRESENTATION ?
About inode :
But it(file) may have several names, all of which map into
the inode, Each name is called a link .
1.File Table
2.User File Descriptor Table
FILE TABLE
It keeps track of the Byte Offset in the file
(where the user's next read or write will start)
The kernel returns a file descriptor for the open and creat
system calls, which is an index into the user file
descriptor table.
boot block typically the first sector, and may contain the
bootstrap code
inode list is a list of inodes, One inode is the root inode of the
file system
2. PROCESSES
1. Structure of a process
2. Process data structures used for memory management.
Every process has one parent process, but a process can have
many child processes.
1. Text Regions
2. Data Regions
3. Stack Regions
The text and data regions correspond to the text and data-bss
sections of the executable file.
Eg:
• Function parameters/arguments
• Local variables
What's a REGION?
The process table entry and the u area contain control and
status information about the process.
1. Context of a process
2. Process states
3. State transitions
CONTEXT OF A PROCESS
• Text
• Values of its global user variables and data structures
• Contents of its user and kernel stacks.
• Values stored in its process table slot and u area
• Values of machine registers it uses
CONTEXT OF A PROCESS
When executing a process, the system is said to be
executing in the context of the process
1. Context of a process
2. Process states
3. State transitions
PROCESS STATES
1. Context of a process
2. Process states
3. State transitions
STATE TRANSITIONS
STATE TRANSITIONS
1. Context of a process
2. Process states
3. State transitions
That’s it.
1. The student shall be able to “draw & brief” UNIX Kernel Architecture
2. The student shall be able to list the CHARACTERS of File & Process Sub-
system
3. The student shall be able to brief the File Sub System - Buffering
mechanism
4. The student shall be able to narrate on Programs, Libraries & System calls
& its interaction
1. The student shall be able to explain the working of File Sub-system &
inodes
2. The student shall be able to list the CHARACTERS of File & Process Sub-
system
3. The student shall be able to “draw & brief” File Sub-system Layout & its
entities
5. The student shall be able to “draw & brief” Kernel & User Stacks..
6. The student shall be able to list & explain Process states & its transitions