Operating Systems
2
2
Agenda
3
4 CPU Scheduling
1 Introduction
2 Functions of Operating Systems
Process Management
5 File management & Trace utilities
6 Signals & Resource Limits
7 Introduction to IPC
3
Introduction
Module 1
4
4
 Resource allocator
– manages and allocates resources
 Control program
– controls the execution of user programs and operations of I/O devices
 Kernel
– the one program running at all times (all else being application programs)
Functions of Operating Systems
5
5
 General Purpose Operating System (GPOS)
– Desktop System
 Real-Time Operating System (RTOS)
– Time sharing Operating Systems
Types of OS
6
6
 Hard real-time
– Secondary storage maybe absent or limited, data stored in short term
memory, or read-only memory (ROM)
– Conflicts with time-sharing systems, and not supported by general-
purpose operating systems
 Soft real-time
– Limited utility in industrial control of robotics
– Useful in applications (multimedia, virtual reality) requiring advanced
operating-system features
Real-Time Systems (Contd.).
7
Functions of Operating System
Module 2
8
8
 An operating system performs large number of functions. Each
function is carried out by a component of the operating system.
 The components of an operating system are:
 Process management sub system
 CPU Scheduling
 File management sub system
 Signals & Resource Limits
 Introduction to IPC
Operating System Functionalities
9
9
 The main functionalities of File management system are:
– The creation and deletion of files
– The creation and deletion of directories
– The support of primitives for manipulating files and directories
– The mapping of files onto secondary storage
– The back up of files on permanent storage media
File Management
10
10
 Program to be executed, it need to be in primary memory.
 Major task of OS
– keep track of which part of memory are currently being used and by
which program
– decide which process are loaded into memory when memory space
becomes available
– Allocate and reallocated memory space as needed
Main-Memory Management
11
11
 A process is a program in execution. A process needs certain
resources, including CPU time, memory, files, and I/O devices, to
accomplish its task
 The operating system is responsible for the following activities in
connection with process management
– Process creation and deletion
– Process continuation and suspension
– Provision of mechanisms for:
– process synchronization
– process communication
Process Management
12
12
 Each program needs an input and generates output.
 User desires that the I/O has been performed without any details.
 User looks for convenience to run programs.
 Hides the user the details of underlying H/W for the I/O.
I/ O Management - Operations
13
CPU Scheduling
Module 4
14
14
 First-Come, First-Served (FCFS) Scheduling
 Shortest-Job-First (SJF) Scheduling
 Priority Scheduling
 Round Robin (RR) Scheduling
 Real-Time Scheduling
Scheduling Algorithm
15
15
Process Burst Time
PI 24.0
PII 3.0
PIII 3.0
Suppose that processes appear in the order: P1 , PII , PIII
The Gantt Chart for the schedule is:
Waiting time for PI = 0.0; PII = 24.0; PIII = 27.0
Average waiting time: (0.0 + 24 .0+ 27.0)/3 = 17.0
First-Come, First-Served (FCFS)
Scheduling
PI PII PIII
24 27 30
0
16
16
Suppose that processes appear in the order PII , PIII , P1
The Gantt chart for the schedule is:
Waiting time for PI = 6.0; PII = 0.0; PIII = 3.0
Average waiting time: (6.0 + 0.0 + 3.0)/3 = 3.0
Much better than previous case
FCFS Scheduling (Contd.).
PI
PIII
PII
6
3 30
0
17
17
 Associate with each process the length of its next CPU burst. Use
these lengths to schedule the process with the shortest time
 Two schemes:
– Non-preemptive
– preemptive
 SJF is optimal
Shortest-Job-First (SJF) Scheduling
18
18
 Each process associates with priority.
 The maximum priority process will be allocated by the CPU.
– Pre-emptive
– Non-pre-emptive
 SJF is a unique of priority scheduling with priorities associated
according to the no. of CPU burst necessary by the processes.
 Problem =Starvation – low priority processes will not get a chance to
execute
 Solution =Aging – as time progresses increase the priority of the
process
Priority Scheduling
19
19
 On the principle that CPU must be shared between each ready
process.
 CPU time is divided into time-quantum or time-slice.
 The ready processes are queued up in a circular queue.
 Context switching takes place whenever either the running process
exhausts its allocated time-quantum or completes its execution.
Round Robin (RR) Scheduling
20
20
In this module, we discussed:
 CPU Scheduling
 Scheduling Criteria
 Range of Scheduling Algorithms
Summary
Thank You

Operating Systems (1).pptx

  • 1.
  • 2.
    2 2 Agenda 3 4 CPU Scheduling 1Introduction 2 Functions of Operating Systems Process Management 5 File management & Trace utilities 6 Signals & Resource Limits 7 Introduction to IPC
  • 3.
  • 4.
    4 4  Resource allocator –manages and allocates resources  Control program – controls the execution of user programs and operations of I/O devices  Kernel – the one program running at all times (all else being application programs) Functions of Operating Systems
  • 5.
    5 5  General PurposeOperating System (GPOS) – Desktop System  Real-Time Operating System (RTOS) – Time sharing Operating Systems Types of OS
  • 6.
    6 6  Hard real-time –Secondary storage maybe absent or limited, data stored in short term memory, or read-only memory (ROM) – Conflicts with time-sharing systems, and not supported by general- purpose operating systems  Soft real-time – Limited utility in industrial control of robotics – Useful in applications (multimedia, virtual reality) requiring advanced operating-system features Real-Time Systems (Contd.).
  • 7.
    7 Functions of OperatingSystem Module 2
  • 8.
    8 8  An operatingsystem performs large number of functions. Each function is carried out by a component of the operating system.  The components of an operating system are:  Process management sub system  CPU Scheduling  File management sub system  Signals & Resource Limits  Introduction to IPC Operating System Functionalities
  • 9.
    9 9  The mainfunctionalities of File management system are: – The creation and deletion of files – The creation and deletion of directories – The support of primitives for manipulating files and directories – The mapping of files onto secondary storage – The back up of files on permanent storage media File Management
  • 10.
    10 10  Program tobe executed, it need to be in primary memory.  Major task of OS – keep track of which part of memory are currently being used and by which program – decide which process are loaded into memory when memory space becomes available – Allocate and reallocated memory space as needed Main-Memory Management
  • 11.
    11 11  A processis a program in execution. A process needs certain resources, including CPU time, memory, files, and I/O devices, to accomplish its task  The operating system is responsible for the following activities in connection with process management – Process creation and deletion – Process continuation and suspension – Provision of mechanisms for: – process synchronization – process communication Process Management
  • 12.
    12 12  Each programneeds an input and generates output.  User desires that the I/O has been performed without any details.  User looks for convenience to run programs.  Hides the user the details of underlying H/W for the I/O. I/ O Management - Operations
  • 13.
  • 14.
    14 14  First-Come, First-Served(FCFS) Scheduling  Shortest-Job-First (SJF) Scheduling  Priority Scheduling  Round Robin (RR) Scheduling  Real-Time Scheduling Scheduling Algorithm
  • 15.
    15 15 Process Burst Time PI24.0 PII 3.0 PIII 3.0 Suppose that processes appear in the order: P1 , PII , PIII The Gantt Chart for the schedule is: Waiting time for PI = 0.0; PII = 24.0; PIII = 27.0 Average waiting time: (0.0 + 24 .0+ 27.0)/3 = 17.0 First-Come, First-Served (FCFS) Scheduling PI PII PIII 24 27 30 0
  • 16.
    16 16 Suppose that processesappear in the order PII , PIII , P1 The Gantt chart for the schedule is: Waiting time for PI = 6.0; PII = 0.0; PIII = 3.0 Average waiting time: (6.0 + 0.0 + 3.0)/3 = 3.0 Much better than previous case FCFS Scheduling (Contd.). PI PIII PII 6 3 30 0
  • 17.
    17 17  Associate witheach process the length of its next CPU burst. Use these lengths to schedule the process with the shortest time  Two schemes: – Non-preemptive – preemptive  SJF is optimal Shortest-Job-First (SJF) Scheduling
  • 18.
    18 18  Each processassociates with priority.  The maximum priority process will be allocated by the CPU. – Pre-emptive – Non-pre-emptive  SJF is a unique of priority scheduling with priorities associated according to the no. of CPU burst necessary by the processes.  Problem =Starvation – low priority processes will not get a chance to execute  Solution =Aging – as time progresses increase the priority of the process Priority Scheduling
  • 19.
    19 19  On theprinciple that CPU must be shared between each ready process.  CPU time is divided into time-quantum or time-slice.  The ready processes are queued up in a circular queue.  Context switching takes place whenever either the running process exhausts its allocated time-quantum or completes its execution. Round Robin (RR) Scheduling
  • 20.
    20 20 In this module,we discussed:  CPU Scheduling  Scheduling Criteria  Range of Scheduling Algorithms Summary
  • 21.