Kernel Architecture: UNIX Kernel: P.C.P Bhatt OS/M14/V1/2004 1
Kernel Architecture: UNIX Kernel: P.C.P Bhatt OS/M14/V1/2004 1
Kernel Architecture: UNIX Kernel: P.C.P Bhatt OS/M14/V1/2004 1
It is responsible for scheduling running of user and other processes. It is responsible for allocating memory. It is responsible for managing the swapping between memory and disk. It is responsible for moving data to and from the peripherals. It receives service requests from the processes and honours them.
P.C.P Bhatt OS/M14/V1/2004 1
P.C.P Bhatt
OS/M14/V1/2004
10
P.C.P Bhatt
OS/M14/V1/2004
13
Scheduler - 1
Most Unix schedulers follow the rules given below for scheduling: 1. Usually a scheduler reevaluates the process priorities at 1 second interval. The system maintains queues for each priority level. 2. Every tenth of a second the scheduler selects the topmost process in the runnable queue with the highest priority. 3. If a process is runnable at the end of its allocated time, it joins the tail of the queue maintained for its priority level. 4. If a process is put to sleep awaiting an event, then the scheduler allocates the processor to another process. 5. If a process awaiting an event returns from a system call within its allocated time interval but there is a runnable process with a higher priority then the process is interrupted and higher priority, process is allocated the CPU.
P.C.P Bhatt OS/M14/V1/2004 14
Scheduler - 2
6. Periodic clock interrupts occur at the rate of 100 interruptions per second. The clock is updated for a tick and process priority of a running process is decremented after a count of 4 ticks. The priority is calculated as follows: priority = (CPU quantum used recently)/(a constant) + (base priority) + (the nice setting). Usually the priority diminishes as the CPU quantum rises during the window of time allocated. As a consequence compute intensive processes are penalised and processes with I/O intensive activity enjoy higher priorities.
P.C.P Bhatt OS/M14/V1/2004 15
P.C.P Bhatt
OS/M14/V1/2004
17
P.C.P Bhatt
OS/M14/V1/2004
18
/usr/src/include/linux/
and
OS/M14/V1/2004
19
/usr/src/include/linux/
and
P.C.P Bhatt
OS/M14/V1/2004
20
P.C.P Bhatt
OS/M14/V1/2004
21
Many of these subsystems specially VFS and NET require the help of device drivers to talk to the underlying hardware. The code for this is present in (/usr/src/linux/drivers)
P.C.P Bhatt OS/M14/V1/2004 22
* Note: We will study the IPC in Module 7 in detail. Also we shall study more about Linux in Module 19.
P.C.P Bhatt OS/M14/V1/2004 23
P.C.P Bhatt
OS/M14/V1/2004
24
P.C.P Bhatt
OS/M14/V1/2004
25
P.C.P Bhatt
OS/M14/V1/2004
26
P.C.P Bhatt
OS/M14/V1/2004
27