Operating System Structure
1. Multi programming and multitasking are 2 types
2. Simple structure
3. Monolithic structure
4. Layered Structure
5. Micro kernels
6. Modules
Ms.C.Nithiya
Computer Science and Engineering
KIT-Kalaignarkarunanidhi Institute Of Technology
Simple Structure -- MS-DOS
 Very old and it has Microsoft Disk os
 Base is hardware, device drivers has access to
hardware.
 Hardware can be accessed by all the above so
the interfaces are not well separated.
 Application program can directly read and write
to hardware.
 When user program fails causes entire system to
crash.
 Not well protected, well structured and not good
structure.
 Ms DOS was written on Intel 8088 does not
provide dual mode(security and protection) or
hardware protection.
MONOLITHIC STRUCTURE
 Used by earlier UNIX OS
 Kernel and system programs grouped,
below system call and above
hardware is kernel.
 Everything packed in one level, too
many functions to maintain.
 If there is a change need to modify
entire kernel(debug).
 System difficult to maintain and
implement.
Layered Approach
 Zero is hardware, Layer 1 to n is
user interface.
 Broken down function into several
layers
 Easy to implement and debug.
 One layer has problem, if
Scheduling layer gives problem,
look at that layer and debug.
 Which is top and which layer below
is main criteria.
 Backing store is performed (disk ,
space used by VM) should be below
memory management layer.
 Not very efficient compared to
other structures.
Microkernel System Structure
Application
Program
File
System
Device
Driver
Interprocess
Communication
memory
managment
CPU
scheduling
messages
messages
microkernel
hardware
user
mode
kernel
mode
Microkernel System Structure
 Micro kernel is present instead of entire kernel system.
 Remove all non essential components from kernel and implement as
system and user level programs.
 Micro kernel provide core functionalities of kernel above to which
device drivers, file services, process service, virtual memory are
placed under user level.
 Micro kernel provide communication between client program and
these services .
 Client request for any service micro kernel gives access through
message passing, runs in user mode.
 As function runs in User mode entire system does not get crashed.
 Performance decrease as there is system overhead while passing
message all time.
Solaris Modular Approach
Modules
 Object oriented techniques to create kernel.
 Other function should be loaded to the kernel either at boot
time or run time
 Kernel section has defined and protected interfaces , protect
from things don’t need to access.
 More flexible than a layered system.
 They are loaded dynamically directly into kernel.
CPU Scheduling
 Assign time for doing a task
 Switching CPU among process OS can make
computer productive.
 Introduce CPU scheduling – Multi programmed
 Which algorithm work better? Difference of
algorithm need to be known
 In single processor one process run at time.
 Any other must wait and rescheduled.
CPU SCHEDULING
 A process is executed until it must wait
completion of I/o operation.
 CPU sets idle when processor inside CPU uses I/o
operation and sits inside CPU unit.
 CPU does no useful work so productivity gets
reduced.
 CPU and I/o Burst cycles – Process execution
has CPU execution and I/o execution.
CPU Scheduling
 When process is under CPU execution for some time it is CPU
Burst
 CPU waits for I/o operation to complete is i/o burst
Process execution–
 CPU burst
 I/o Burst
 CPU Burst…..
 At final CPU burst system request to terminate execution.
ALTERNATE SEQUENCE
PRE-EMPTIVE AND NON-PREEMPTIVE
SCHEDULING
 Ways in which scheduling takes place.
 CPU SCHEDULER – When CPU is idle , os select
One of processes in ready queue , in a process p1,p2,p3,p4 …p3
is selected from set to place in ready queue to run.
 Selection of process is done by Short-term scheduler(ready
queue to CPU through i/o operation.
 DISPATCHER– CPU control is given to selected process.
PRE-EMPTIVE AND NON-PREEMPTIVE SCHEDULING
 Time taken for dispatcher to stop one process and start another
running is Dispatch Latency
 CPU scheduling decisions takes place under 4 categories.
 Process state switches from Running (Already using CPU)to
Waiting state (I/o operation)
 Interrupt occurs, Running ( Process hault, goes back to ready
to get CPU to complete) to Ready state
PRE-EMPTIVE AND NON-PREEMPTIVE
SCHEDULING
 Waiting state(has any i/o request) to ready state(continue its
execution) when i/o operation occur.
 When process terminates CPU assigns to another process.
 Based on CPU Allocation, 1 & 4 considered as no choice
(CPU should be assigned )
 2 & 3 there is a choice process gets hault, CPU assigned to
new process or old one .
 Scheduling under 1 &4 is Non preemptive.
 Pre emptive , CPU can be taken away from process before it
completes its execution .
 When higher priority process enters switching from non
preemptive to pre emptive occurs.
SCHEDULING CRITERIA
 CPU utilization, Through put, Turn around time , waiting time,
Response time are 5 criteria need to be known before
scheduling.
 CPU utilization – We need to keep the CPU as busy as
possible. CPU should not be idle.
 Through put – One measure of work is calc as number of
processes that are completed per time unit
 Turn around time – Sum of the periods spent waiting to get
into memory, waiting in ready queue, executing on CPU and
doing I/o. From submission to completion.
 Waiting time – Sum of the period spent waiting in ready
queue. It does not depend on scheduling process but the length
of process is taken into account .
SCHEDULING CRITERIA
 Response time – Time from the submission of
request until the first response is produced.
 Time it takes to start responding not the time it
takes to output the response.
 Turn around time is generally limited by the speed
of output time in fast system. So we go for
response time.
 Video output – first it start processing and takes
time to give output.

Operating System.ppt

  • 1.
    Operating System Structure 1.Multi programming and multitasking are 2 types 2. Simple structure 3. Monolithic structure 4. Layered Structure 5. Micro kernels 6. Modules Ms.C.Nithiya Computer Science and Engineering KIT-Kalaignarkarunanidhi Institute Of Technology
  • 2.
    Simple Structure --MS-DOS  Very old and it has Microsoft Disk os  Base is hardware, device drivers has access to hardware.  Hardware can be accessed by all the above so the interfaces are not well separated.  Application program can directly read and write to hardware.  When user program fails causes entire system to crash.  Not well protected, well structured and not good structure.  Ms DOS was written on Intel 8088 does not provide dual mode(security and protection) or hardware protection.
  • 3.
    MONOLITHIC STRUCTURE  Usedby earlier UNIX OS  Kernel and system programs grouped, below system call and above hardware is kernel.  Everything packed in one level, too many functions to maintain.  If there is a change need to modify entire kernel(debug).  System difficult to maintain and implement.
  • 4.
    Layered Approach  Zerois hardware, Layer 1 to n is user interface.  Broken down function into several layers  Easy to implement and debug.  One layer has problem, if Scheduling layer gives problem, look at that layer and debug.  Which is top and which layer below is main criteria.  Backing store is performed (disk , space used by VM) should be below memory management layer.  Not very efficient compared to other structures.
  • 5.
  • 6.
    Microkernel System Structure Micro kernel is present instead of entire kernel system.  Remove all non essential components from kernel and implement as system and user level programs.  Micro kernel provide core functionalities of kernel above to which device drivers, file services, process service, virtual memory are placed under user level.  Micro kernel provide communication between client program and these services .  Client request for any service micro kernel gives access through message passing, runs in user mode.  As function runs in User mode entire system does not get crashed.  Performance decrease as there is system overhead while passing message all time.
  • 7.
  • 8.
    Modules  Object orientedtechniques to create kernel.  Other function should be loaded to the kernel either at boot time or run time  Kernel section has defined and protected interfaces , protect from things don’t need to access.  More flexible than a layered system.  They are loaded dynamically directly into kernel.
  • 9.
    CPU Scheduling  Assigntime for doing a task  Switching CPU among process OS can make computer productive.  Introduce CPU scheduling – Multi programmed  Which algorithm work better? Difference of algorithm need to be known  In single processor one process run at time.  Any other must wait and rescheduled.
  • 10.
    CPU SCHEDULING  Aprocess is executed until it must wait completion of I/o operation.  CPU sets idle when processor inside CPU uses I/o operation and sits inside CPU unit.  CPU does no useful work so productivity gets reduced.  CPU and I/o Burst cycles – Process execution has CPU execution and I/o execution.
  • 11.
    CPU Scheduling  Whenprocess is under CPU execution for some time it is CPU Burst  CPU waits for I/o operation to complete is i/o burst Process execution–  CPU burst  I/o Burst  CPU Burst…..  At final CPU burst system request to terminate execution.
  • 12.
  • 13.
    PRE-EMPTIVE AND NON-PREEMPTIVE SCHEDULING Ways in which scheduling takes place.  CPU SCHEDULER – When CPU is idle , os select One of processes in ready queue , in a process p1,p2,p3,p4 …p3 is selected from set to place in ready queue to run.  Selection of process is done by Short-term scheduler(ready queue to CPU through i/o operation.  DISPATCHER– CPU control is given to selected process.
  • 14.
    PRE-EMPTIVE AND NON-PREEMPTIVESCHEDULING  Time taken for dispatcher to stop one process and start another running is Dispatch Latency  CPU scheduling decisions takes place under 4 categories.  Process state switches from Running (Already using CPU)to Waiting state (I/o operation)  Interrupt occurs, Running ( Process hault, goes back to ready to get CPU to complete) to Ready state
  • 15.
    PRE-EMPTIVE AND NON-PREEMPTIVE SCHEDULING Waiting state(has any i/o request) to ready state(continue its execution) when i/o operation occur.  When process terminates CPU assigns to another process.  Based on CPU Allocation, 1 & 4 considered as no choice (CPU should be assigned )  2 & 3 there is a choice process gets hault, CPU assigned to new process or old one .  Scheduling under 1 &4 is Non preemptive.  Pre emptive , CPU can be taken away from process before it completes its execution .  When higher priority process enters switching from non preemptive to pre emptive occurs.
  • 16.
    SCHEDULING CRITERIA  CPUutilization, Through put, Turn around time , waiting time, Response time are 5 criteria need to be known before scheduling.  CPU utilization – We need to keep the CPU as busy as possible. CPU should not be idle.  Through put – One measure of work is calc as number of processes that are completed per time unit  Turn around time – Sum of the periods spent waiting to get into memory, waiting in ready queue, executing on CPU and doing I/o. From submission to completion.  Waiting time – Sum of the period spent waiting in ready queue. It does not depend on scheduling process but the length of process is taken into account .
  • 17.
    SCHEDULING CRITERIA  Responsetime – Time from the submission of request until the first response is produced.  Time it takes to start responding not the time it takes to output the response.  Turn around time is generally limited by the speed of output time in fast system. So we go for response time.  Video output – first it start processing and takes time to give output.