Professional Documents
Culture Documents
Introduction
Operating System: a system that manages the resources
of a computer.
ld wc
grep
nroff
Other apps
Three major tasks of kernel:
Process Management
Device Management
File Management
Three additional Services for Kernel:
Virtual Memory
Networking
Network File Systems
User Programs
Libraries
User Level
Kernel System Call Interface
Level
Inter-process
File Subsystem Process communication
control
Scheduler
subsystem
Device drivers
Memory
management
hardware control
hardware
Hardware Level
Unix process state
transition diagram
Note
1. User running state : When a process is executing user
code.
2. Kernel running state : when a process is executing a
system call.
Start in Created go to either:
or
Ready to Run, Swapped (Out) if there isnt room in
memory for the new process.
Ready to Run, in Memory is basically same state as
Preempted (dotted line)
When scheduled, go to either:
User Running (if in user mode)
or
Kernel Running (if in kernel mode)
13
Event descriptor.
Used when the process is in the "sleep" state.
Scheduling parameters.
Allow the kernel to determine the order in
which processes move to the states "kernel
running" and "user running
A signal field.
keeps the signals sent to a process but not
yet handled.
Various timers: process execution time,
resource utilization etc.
14
U area contains :
A pointer to the process table entry
User IDs
various Timer:
Execution time in user mode
Execution Time in kernel mode
An error field: keeps error during system
call
Return value field: result of system call
15
I/O parameters
Amount of data transfer
Address of source and target etc.
The current directory and current root
User file descriptor table records files the
process has opened.
Limit fields
Restrict process size
Restrict size of the file it can write
The control terminal field:
login terminal associated with the process, if one exists
An array indicates how the process wishes to
react to signal
16
The process table contains (or points to) a per process region
table(pregion), whose entries point to entries in a region
table.
A region is a contiguous area of a process's address space,
such as text, data, and stack. Region table entries describe
the attributes of the region, such as whether it contains text
or data, whether it is shared or private, and where the "data"
of the region is located in memory.
The extra level of indirection (from the per process region
table to the region table) allows independent processes to
share regions.
Note:Several processes can share a region. For instance,
several processes may execute the same program, and it is
natural that they share one copy of the text region.
Kernel Process Kernel Region
Table A Process Table
Text
Stack
U Area
18
Note :
Information as to where each processs data,
text and stack segment is stored is in the
kernel region table.
There is only one kernel region table.
Per process region table will have information
as to where in the kernel table the processs
text, data and stack segment are stored.
Process Region
table table
text
data
stack
Active process
text
data