SlideShare una empresa de Scribd logo
1 de 73
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
PROPRIETARY MATERIAL. © 2007 The McGraw-Hill Companies, Inc. All rights reserved. No part of this PowerPoint slide may be displayed, reproduced or
distributed in any form or by any means, without the prior written permission of the publisher, or used beyond the limited distribution to teachers and educators
permitted by McGraw-Hill for their individual course preparation. If you are a student using this PowerPoint slide, you are using it without permission.
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Overview of operating systems
• A modern OS contains a very large number of features
– Many of these features were first introduced in different classes
of operating systems, namely
* Batch Processing operating systems
* Multiprogramming operating systems
* Time sharing operating systems
* Real time operating systems
* Distributed operating systems
– These features are used in a modern OS as well
* We study these features in the context of the relevant OS
* Study their influence on system performance and user service
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Recap from Chapter 1
• The fundamental goals of an operating system
– Obtain
* High system performance
* Good user service
within a computing environment
– A computing environment consists of a computer system, its
interfaces with other systems, and user computations
* Measures of system performance and user service depend on the
computing environment
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Recap from Chapter 1
• Fundamental tasks of an OS
– Management of Programs
* Organize their execution by sharing the CPU
* Ensure good user service
– Management of Resources
* Fast allocation and de-allocation without constraining user programs
* Efficient use of resources
– Security and Protection
* Ensure absence of interference with programs and resources by
entities within and outside the OS
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Introduction
In this chapter, we shall first study:
• Fundamentals of OS operation
– Features of a computer that are important for an OS
– How the OS controls execution of programs
– How a program interacts with an OS
• Efficiency, system performance and user convenience
– Measures of system performance
– User service as a measure of user convenience
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
OS and the Computer System
• In this module, we study
– Fundamental features of computer systems that are important to
an OS
* Memory hierarchy
* Interrupt structure
* I/O organization
– How an OS uses these features to control operation of an OS
– Fundamentals of how a program interacts with an OS
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Memory utilization during operation of an OS
• The kernel is the core of the OS; it is memory resident at all times
• Non-kernel programs are loaded in the transient area when needed
• Rest of the memory is shared between user programs
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Model of a computer system
• The CPU and the I/O subsystem have independent paths to memory
• The memory management unit plays a part in implementing virtual memory
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
The program status word (PSW)
• The CPU contains two kinds of registers
– User accessible registers
* Used for arithmetic or logical operations, addressing, indexing, etc.
These are called general purpose registers, or simply, CPU
registers
– Control registers
* Condition code register (also called the flags register), program
counter, etc.
* Their contents govern operation of the CPU
• Control registers are collectively called the program
status word (PSW)
– Individual control registers are considered as fields of the PSW
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Fields of the Program Status Word (PSW)
• The ‘privileged mode’ field indicates whether the CPU is in the privileged
mode, which is used by the OS, or user mode
* Some instructions can be executed only when CPU is in the privileged mode
• Condition code and Program counter registers were mentioned before
• Other registers are discussed later
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Privileged mode of CPU
• The CPU can operate in two modes. The privileged
mode (P) field of PSW controls the CPU mode
– Privileged mode (`P’ field contains 1)
* Certain sensitive instructions can be executed only when the CPU is
in this mode
 For example, initiation of an I/O operation, setting protection
information for a program
 These instructions are called privileged instructions
– User mode
* Privileged instructions cannot be executed when the CPU is in this
mode
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
State of the CPU
• The state of the CPU consists of
– The PSW and contents of the general purpose registers of the
CPU
– It indicates
* What the CPU is engaged in doing at any moment
* What the CPU can do, in terms of privileges to perform certain
operations
– The OS keeps track of the state of the CPU to know what the
program currently executing on the CPU is doing
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
State of the CPU
(a) An assembly language program
(b) CPU state of the program after executing the COMPARE instruction
– 0 in the P field indicates that the CPU is in the user mode
– 150 in the PC field indicates that the CPU is about to execute the
instruction with address 150
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Memory hierarchy
• The memory hierarchy is a cost-effective method of
obtaining a large and fast memory
– It is an arrangement of several memories with different access
speeds and sizes
* The CPU accesses only the fastest memory; i.e., the cache
* If a required byte is not present in the memory being accessed, it is
loaded there from a slower memory
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Memory hierarchy
• Cache memory is the fastest and disk the slowest in the hierarchy
• The CPU accesses only the cache memory
• If required data or instruction is not present in the cache, it is loaded there
from memory (if not present in memory, it is first loaded from disk)
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Memory hierarchy
• Cache memory
– Organization
* A cache block or cache line is loaded from memory when some
byte in it is referenced
* A ‘write-through’ arrangement is typically used to update memory
– The cache hit ratio (h) indicates what percentage of accessed
bytes were already present in cache
* The cache hit ratio has high values because of
 Temporal locality
 Spatial locality
* Effective memory access time =
h x access time of cache memory +
(1 – h) x (time to load a cache block + access time of cache memory)
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Memory hierarchy
• Main memory
– Memory protection prevents access to memory by an
unauthorized program
* Memory bound registers indicate bounds of the memory allocated to
a program (see next slide)
• Virtual memory
– The part of memory hierarchy consisting of the main memory
and a disk is called virtual memory
* A program and its data are stored on the disk
* Required portions of the program and its data are loaded in memory
when accessed
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Memory protection using bound registers
• The lower bound register (LBR) and upper bound register (UBR) contain
addresses of first and last bytes allocated to the program
• LBR, UBR are stored in the memory prot info (MPI) field of the PSW
• The CPU raises an interrupt if an address is outside the LBR–UBR range
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Input / Output organization
• An I/O operation slows down a program’s execution due
to mismatch of CPU and I/O speeds
– Involvement of the CPU in I/O operations should be the minimum
possible
* CPU should be free to execute instructions while I/O operations are
in progress
– Different I/O modes
* Programmed I/O
* Interrupt I/O
* Direct memory access (DMA)
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Input / Output modes
• Details of the Input/output modes
– Programmed I/O
* Data transfer between memory and an I/O device takes place
through the CPU
 CPU cannot perform any other operation until I/O completes
– Interrupt I/O
* An I/O instruction starts an I/O operation and frees the CPU to
execute other instructions
 An interrupt is raised every time a unit of data is to be
transferred between memory and the I/O device
 An interrupt processing program in the kernel actually transfers
the data
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Input / Output modes
• Details of the Input/output modes (contd)
– Direct memory access (DMA)
* An I/O instruction indicates the operation to be performed and the
number of bytes of data to be transferred. Its execution starts the
I/O operation
 Data transfer is coordinated by the DMA controller; it does not
involve the CPU
 When the I/O operation completes, the DMA controller raises
an I/O interrupt to indicate its completion (interrupts are
discussed later)
 CPU is free to execute other instructions while an I/O operation
is in progress
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Interrupts
• An interrupt signals the occurrence of an event to the
CPU
– An event is a situation that requires OS intervention
– At an interrupt, the interrupt action in the hardware diverts the
CPU to execution of an interrupt processing routine (IPR)
* The IPR is a routine in the OS kernel
* It handles the situation that caused the interrupt
* After the IPR, kernel switches the CPU to execution of a user
program
– Different classes of interrupts convey occurrences of different
kinds of events
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Classes of interrupts
• Three important classes of interrupts are
– Program interrupt
* Caused by conditions within the CPU during execution of an
instruction; e.g.,
 Occurrence of an arithmetic overflow, addressing exception, or
memory protection exception
 Execution of the software interrupt instruction
– I/O interrupt
* Indicates completion of an I/O operation
– Timer interrupt
* Indicates that a specified time interval has elapsed
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
The interrupt action
1. The interrupt code is formed depending on the cause of the interrupt;
it is stored in the interrupt code (IC) field of the PSW
2. The PSW is saved in a memory location (or in the stack)
3. Contents of an appropriate interrupt vector are loaded in the PSW;
new contents of the PSW now control CPU operation
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Steps in interrupt action
• The interrupt action consists of three steps
1. Set interrupt code in the PSW
* The code describes the situation that caused the interrupt
* It is stored in the interrupt code field of the PSW
2. Save the PSW
* PSW is saved in a memory location
* Interrupt code gets saved as a part of the PSW
3. Load interrupt vector
* Interrupt vector of the occurred interrupt is chosen
 It contains address of the interrupt processing routine (IPR)
* It is loaded in the PSW
 Control is transferred to the IPR
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Interrupt driven operation of a kernel
• At the occurrence of an interrupt, the CPU is diverted to the interrupt
processing routine (IPR), which is a part of the kernel
• The IPR handles the interrupt by performing appropriate actions
• The IPR passes control to the scheduler, which selects a program
for execution
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Servicing of an I/O
interrupt and return to
the same user
program
User program
→ IPR for I/O interrupt
→ Scheduler
→ User program
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Nested interrupts
• An interrupt may occur while a previous interrupt is being
processed
– The interrupt action would divert the CPU to handle the new
interrupt. On completion of its processing, processing of the
previous interrupt would be resumed
* It may delay processing of the previous interrupt
– The interrupt mask (IM) indicates whether a new interrupt should
be allowed to occur while a previous interrupt is being serviced
* Each bit in the mask controls masking of one class of interrupts
 If an interrupt is masked off: it remains pending
 If an interrupt is enabled: it can occur
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Simple and nested interrupt processing
(a) A single interrupt occurs and is serviced
(b) A nested interrupt occurs. Processing of the previous interrupt
is suspended until the new interrupt gets handled
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
System Call
• A computer has a special instruction called a ‘software
interrupt’ instruction
– Its sole purpose is to cause a program interrupt
– Its operand becomes the interrupt code
* A program uses the software interrupt instruction to make a request
to the system
 The operand of the instruction indicates what kind of request is
being made
 Association between interrupt code and kind of request is
OS-specific
* This method of making a request is known as a system call
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Types of system calls
• System calls are used to make diverse kinds of requests
– Resource related
* Resource request or release, checking resource availability
– Program related
* Execute or terminate a program, set or await timer interrupt
– File related
* Open or close a file, read or write a record
– Information related
* Get time and date, get resource information
– Communication related
* Send or receive message, setup or terminate connection
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Efficiency, system performance and user
convenience
• The nature of a computing environment determines
– The nature of user computations
* Non-interactive computing environment
 Back-office applications
* Interactive computing environment
 Online applications
* Real time computing environment
 Time-critical applications
– Notions of efficiency, system performance and user service
* e.g., user service is
 Response time for interactive computing
 Deadline for real time computing
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Computations in an OS
• We discuss four kinds of computations in an OS
– Program
* A set of functions or modules, including those from libraries
– Job
* A sequence of job steps
 Each job step is an execution of a program
 It is executed only if previous job steps executed successfully
– Process
* A process is an execution of a program
– Subrequest
* A subrequest is a computational requirement presented by a user to
a process. It produces a single response comprising of results or
actions
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Measures of efficiency and user convenience
• We use the following measures
– Efficiency of use
* CPU efficiency
 Percent utilization of CPU
– System performance
* Throughput
 Amount of work done per unit of time
– User service
* Turn-around time
 Time between submission and completion of a job or process
* Response time
 Time between issuing and completion of a subrequest
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Efficiency and user convenience in different
OS classes
• Service is a user-centric consideration
• Efficiency is a system-centric consideration
• Different OSs trade them off differently
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Efficiency and user convenience in different
OS classes
• Explanation of the previous chart:
– A multiprogramming OS provides better efficiency than a batch
processing OS because it services many processes in an
overlapped manner
* However, user convenience does not change
– A time sharing system provides better response times than a
multiprogrammed system
* Hence it provides the better user convenience
– A real time OS does not provide as much efficiency as a time
sharing OS because it may reserve some resources for
exclusive use of a process
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Batch processing system
In early operating systems, the computer operator had to
manually set-up execution of every job
• Aim of batch processing:
– To reduce operator’s intervention in processing of user jobs
* A batch is a sequence of jobs
* The operator sets up processing of a batch, rather than processing
of individual jobs
 It saves valuable time spent in human actions
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Batch processing system
• The operator forms a batch of jobs and inserts ‘start of batch’ and
‘end of batch’ cards
• Operator initiates processing of a batch
• The batch monitor, which is a primitive OS, performs transition
between individual jobs
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Turn-around time in a batch processing system
• ‘Turn-around time’ of a job is the time between the submission of a job
and obtaining of its results
• If results are printed after entire batch is processed, turn-around time
depends on execution time of all jobs in the batch
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Batch processing
• Control statements are used to facilitate batch
processing
– Users insert control statements in their jobs to specify
* Start and end of a job, end of program or data
* Requirements concerning execution of a program
– The batch monitor processes the control statements to take
appropriate actions
* Initiate or terminate processing of a batch
* Initiate or terminate processing of a job
* Protect adjoining programs in the batch against interference
 If a program tries to read more data than provided, the end-of-
data card alerts the batch monitor
 Batch monitor terminates the program (see next slide)
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Control statements in IBM 360/370 systems
• The // JOB and /& statements are start-of-job and end-of-job statements
• The // EXEC statement indicates which program is to be executed
• The /* card indicates end of the program or end of its data
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Multiprogramming Systems
In a batch processing system, the CPU remained idle while
a program performed I/O operations
• Aim of multiprogramming:
– Achieve efficient use of the computer system through overlapped
execution of several programs
* While a program is performing I/O operations, the OS schedules
another program
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Operation of a multiprogramming system
(a) Program 1 performs I/O and Program 2 executes on the CPU
(b) Program 2 initiates I/O, so OS switches the CPU to Program 3
(c) Program 1’s I/O operation completes, so OS switches CPU to its
execution
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Architectural support for multiprogramming
• The computer’s architecture must contain following
features to support multiprogramming
– DMA
* To provide parallel operation of the CPU and I/O
– Interrupt hardware
* To implement the interrupt action, which passes control to the OS
– Memory protection
* To prevent corruption or disruption of a program by other programs
– Privileged mode of CPU
* CPU must be in privileged mode to execute sensitive instructions
* It is in the user mode, i.e., non-privileged mode, while executing
user programs
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Functions of a multiprogramming kernel
• The kernel of a multiprogramming OS performs the
following functions
– Resource allocation and protection
* It uses memory protection to avoid interference between programs
– Keeping track of start and end of I/O operations through interrupt
processing, so that it can
* Initiate I/O operations
* Perform scheduling
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Concepts and techniques of multiprogramming
• Three key concepts are
– Use a suitable program mix of CPU-bound and I/O-bound
programs
* A CPU-bound program performs computations most of the time, and
I/O operations seldom
* An I/O bound program performs I/O operations frequently
– Assign suitable priorities to programs
* Decide which program should be favoured for execution on the
CPU—an I/O-bound program or a CPU-bound program?
– Use a suitably high degree of multiprogramming
* Degree of multiprogramming = No of programs in memory
* Facilitates parallel operation of CPU and I/O system
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Priority in a multiprogramming OS
• Priority is a tie-breaking rule used when more than one
program is ready for execution
– At any moment, the highest priority program that is not waiting
for an I/O operation to complete is chosen for execution
– Preemptive priority
* Definition: Preemption is forcible removal of a program from the
CPU
* A low priority program executing on the CPU is preempted when a
high priority program becomes ready for execution
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Program priority in Multiprogramming OSs
The priority assignment rule for achieving better performance:
“I/O bound programs should have higher priorities than
CPU bound programs”
We shall discuss different priority assignments to I/O-bound and CPU-
bound programs, study their influence on performance, and conclude
accordingly
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Timing chart when a CPU-bound program has
higher priority
• At time 0, the CPU-bound program is selected for execution
• It starts an I/O operation at t11, hence progiob is selected for execution
• progcb is scheduled at t13 when its I/O operation completes
progiob: I/O-bound
program
progcb : CPU-bound
program
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
A CPU-bound program has higher priority
• Observations
– CPU utilization is reasonable
– I/O utilization is poor
– Periods of concurrent CPU and I/O activities are rare
Q: Can I/O utilization be improved?
A: No! Adding an I/O-bound program does not help much because it
has a low priority
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Timing chart when an I/O bound program has
higher priority
• progiob is selected at time 0
• It starts an I/O operation at t21, hence progcb is scheduled
• progcb is preempted when progiob’s I/O operation is completed
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
An I/O-bound program has higher priority
• Observations:
– CPU utilization is reasonable
– I/O utilization is reasonable
– Periods of concurrent CPU and I/O activities are frequent
Q: Can CPU and I/O utilization be improved?
A: Yes
* Addition of a CPU-bound program improves CPU utilization
* Addition of an I/O-bound program improves I/O utilization
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Performance and user service in
multiprogramming
– Performance is measured as throughput
* Throughput is the number of programs serviced by the system in a
unit of time
* For high throughput, I/O-bound programs should have higher
priorities than CPU-bound programs
– User service is measured as turn-around time of a job
* Turn-around time of a job is the elapsed time between submission
of a job and its completion
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Improving throughput in a multiprogramming
system
• How to improve throughput?
– Add a CPU-bound program, give it the lowest priority
* It uses the CPU when it would have been idle, e.g., the interval
t26-t27
* Its presence does not affect progress made by other programs
– Add an I/O-bound program, give it a high priority
* Its presence improves I/O utilization
* It may affect progress of the CPU-bound program marginally
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Variation of throughput with degree of
multiprogramming
Q: Why does the throughput stagnate at high values of m?
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Time sharing systems
• In interactive computing, users desire good response
times to their subrequests
– Response time to a subrequest is the time since the subrequest
is made to the time its results are obtained
– A time sharing system provides good response times to
subrequests through
* Round-robin processing of programs
* Using a time slice (δ) to prevent a program from using too much
CPU time in one go
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
A schematic of round-robin scheduling
with time slicing
• The OS maintains a list of programs that wish to execute on the CPU
• The scheduler selects the first program in the list
• If the time slice elapses before the scheduled program completes its
operation, it is preempted and put back into the scheduling list
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Operation of a time slicing scheduler
(a) The program is preempted when the time slice elapses; i.e.,
after it has consumed δ seconds
(b) The program gives up the CPU when it starts an I/O operation;
i.e., before it has consumed δ seconds; another program is now
scheduled
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Time sharing systems
• Relation between time slice and response time
– Choice of the time slice depends on two factors
* Response time to programs
* Overhead of switching between programs (σ)
– If every program consumes δ CPU seconds before producing a
response,
* response time is = na x (δ + σ), where na is the number of active
programs
* CPU efficiency is = δ / (δ+σ)
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Choice of δ
• Influence of δ on response time
– If δ is very small
* A program may need more CPU time than δ to satisfy a request
 Hence a program may have to be scheduled several times
before a response can be obtained
* Efficiency is low if δ and σ are comparable
* Cache performance may be poor
– If δ is large
* Response time would be better than na x ( δ+σ )
* Efficiency would be better than δ / (δ+σ) because programs may
not use the complete time slice
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Swapping
• Swapping is the technique of moving inactive programs
out of the memory temporarily
– It increases the number of programs that can be processed by
the time sharing system
Q: What are the conditions under which swapping is most effective?
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
A schematic of swapping
• The OS swaps out a program that is not likely to be executed immediately
in future; it frees the memory occupied by the program
• It swaps in a new program in the newly freed memory
• The swapped-out program is loaded back before its turn for execution
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Real time Operating system
• A real time OS is used to service time critical
applications
– A time critical application is one that malfunctions if it does not
receive a ‘timely response’
* Timeliness of the response depends on the nature of the application
* A real time OS focuses on providing a timely response to an
application
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Real time Operating system
• Two kinds of real time operating systems
– Hard real time system: Meets the response requirement of an
application under all conditions (including error recovery actions,
if any)
* Used in command and control applications
* A computer system may have to be dedicated to an application
– Soft real time system: Meets the response requirement of an
application in a probabilistic manner
* Used in applications such as multimedia and reservation systems
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Real time operating systems
• Features of a real time OS
– Permits creation of multiple processes within an application
* Overlapped operation of processes speeds up the application
– Permits priorities to be assigned to processes
– Permits a programmer to define interrupts in an application’s
domain and provide interrupt processing routines
* Enables the application to respond readily to events
– Uses priority driven or deadline oriented scheduling
* Helps in meeting the application’s time constraints
– Provides fault tolerance and graceful degradation
* Such that essential services can be performed in a timely manner
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
A satellite data logging application
• A satellite sends data to an earth station periodically
– A computer application in the earth station receives the data
* The computer stores the data in the signal in a file
* Storing of data should be completed before the next signal arrives
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Tasks in the satellite data logging application
• Process 1 copies the data
• Process 2 writes the data into a file
• Process 3 performs statistical analysis on the data
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Distributed operating system
• Definition: a distributed computer system
– A distributed computer system consists of a number of computer
systems, each having its own memory and performing some of
the control functions of the OS, interacting through the network
– Each computer system is called a host or node, and the place
where it is located is called a site
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
A distributed system
• A WAN connects geographically distant nodes
• A LAN connects nodes within an office, laboratory or building
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Distributed systems
• Benefits of a distributed system
– Resource sharing
* An application can use resources located in other computers
– Reliability
* Provides availability of resources despite faults
– Computation speed-up
* Parts of a computation can be executed simultaneously in different
computers
– Communication
* Users in different computer systems can communicate
– Incremental growth
* Cost of enhancing capabilities of a system is proportional to the
desired enhancement
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Features of Distributed Operating Systems
• Parts of a distributed operating system execute in
different nodes of a distributed system. Its salient
features are:
– The OS provides support for distributed computations
* Remote procedure call (RPC)
* Distributed file systems
– The OS uses distributed control techniques because
* Several computers participate in a decision
* Control data may be distributed across nodes in the system
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Classical OS concepts in Modern OSs
• A modern OS supports different kinds of users, hence it
has to fulfill diverse requirements
– It uses many (most?) of the classical concepts discussed so far
to meet different requirements
* We will see details of these in the next slide
– It uses adaptive techniques so that it can select the techniques
that best suit a specific program
* This way it can handle diverse workloads effectively
Chapter 2: Overview of
Operating Systems
Dhamdhere: Operating Systems—
A Concept-Based Approach , 2 ed
Slide No: ‹#›
Copyright © 2008
Classical OS concepts in Modern OSs
• A modern OS uses the following classical concepts
– Batch processing concepts
* Database queries and back-office processing are batched
– Priority-based preemptive scheduling
* To provide better service to high priority applications
* To obtain efficient use of resources
– Time slicing
* To provide good response times
– Swapping
* To increase the number of processes serviced
– Creating multiple processes in an application
* To provide timely response to real time applications
– Resource sharing across boundaries of computers

Más contenido relacionado

Similar a Module 1b OS.pptx

Operating system by uttam
Operating system by uttamOperating system by uttam
Operating system by uttamSunil Kumar
 
OPERATING SYSTEM - SHORT NOTES
OPERATING SYSTEM - SHORT NOTESOPERATING SYSTEM - SHORT NOTES
OPERATING SYSTEM - SHORT NOTESsuthi
 
Operating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfOperating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfFahanaAbdulVahab
 
Introduction to Operating System
Introduction to Operating SystemIntroduction to Operating System
Introduction to Operating SystemRashmi Bhat
 
3330701_unit-1_operating-system-concepts.pdf
3330701_unit-1_operating-system-concepts.pdf3330701_unit-1_operating-system-concepts.pdf
3330701_unit-1_operating-system-concepts.pdfrohitbaweja26
 
Chapter 1 Introduction to Operating System Concepts
Chapter 1 Introduction to Operating System ConceptsChapter 1 Introduction to Operating System Concepts
Chapter 1 Introduction to Operating System ConceptsMeenalJabde
 
Lecture1423726024
Lecture1423726024Lecture1423726024
Lecture1423726024deepakjeetu
 
Introduction and Types of Operating System.pptx
Introduction and Types of Operating System.pptxIntroduction and Types of Operating System.pptx
Introduction and Types of Operating System.pptxaparna14patil
 
Module 1 Introduction.ppt
Module 1 Introduction.pptModule 1 Introduction.ppt
Module 1 Introduction.pptshreesha16
 
OSLecture1.ppt
OSLecture1.pptOSLecture1.ppt
OSLecture1.pptAkkiiDerp
 
os assignment -individual presenation.pptx
os assignment -individual presenation.pptxos assignment -individual presenation.pptx
os assignment -individual presenation.pptxEngrAliSarfrazSiddiq
 
EC 308 Embedded Systems Module 1 Notes APJKTU
EC 308 Embedded Systems Module 1 Notes APJKTUEC 308 Embedded Systems Module 1 Notes APJKTU
EC 308 Embedded Systems Module 1 Notes APJKTUAgi George
 
MK Sistem Operasi.pdf
MK Sistem Operasi.pdfMK Sistem Operasi.pdf
MK Sistem Operasi.pdfwisard1
 
OS M1.1.pptx
OS M1.1.pptxOS M1.1.pptx
OS M1.1.pptxbleh23
 

Similar a Module 1b OS.pptx (20)

Operating system by uttam
Operating system by uttamOperating system by uttam
Operating system by uttam
 
Arduino
Arduino Arduino
Arduino
 
OPERATING SYSTEM - SHORT NOTES
OPERATING SYSTEM - SHORT NOTESOPERATING SYSTEM - SHORT NOTES
OPERATING SYSTEM - SHORT NOTES
 
Operating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfOperating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdf
 
Introduction to Operating System
Introduction to Operating SystemIntroduction to Operating System
Introduction to Operating System
 
EE8691 – EMBEDDED SYSTEMS.pptx
EE8691 – EMBEDDED SYSTEMS.pptxEE8691 – EMBEDDED SYSTEMS.pptx
EE8691 – EMBEDDED SYSTEMS.pptx
 
Operating system Chapter One
Operating system Chapter OneOperating system Chapter One
Operating system Chapter One
 
3330701_unit-1_operating-system-concepts.pdf
3330701_unit-1_operating-system-concepts.pdf3330701_unit-1_operating-system-concepts.pdf
3330701_unit-1_operating-system-concepts.pdf
 
Lec 3
Lec 3 Lec 3
Lec 3
 
Chapter 1 Introduction to Operating System Concepts
Chapter 1 Introduction to Operating System ConceptsChapter 1 Introduction to Operating System Concepts
Chapter 1 Introduction to Operating System Concepts
 
Lecture1423726024
Lecture1423726024Lecture1423726024
Lecture1423726024
 
Introduction and Types of Operating System.pptx
Introduction and Types of Operating System.pptxIntroduction and Types of Operating System.pptx
Introduction and Types of Operating System.pptx
 
Module 1 Introduction.ppt
Module 1 Introduction.pptModule 1 Introduction.ppt
Module 1 Introduction.ppt
 
OSLecture1.ppt
OSLecture1.pptOSLecture1.ppt
OSLecture1.ppt
 
os assignment -individual presenation.pptx
os assignment -individual presenation.pptxos assignment -individual presenation.pptx
os assignment -individual presenation.pptx
 
PROJECT 3.pptx
PROJECT 3.pptxPROJECT 3.pptx
PROJECT 3.pptx
 
EC 308 Embedded Systems Module 1 Notes APJKTU
EC 308 Embedded Systems Module 1 Notes APJKTUEC 308 Embedded Systems Module 1 Notes APJKTU
EC 308 Embedded Systems Module 1 Notes APJKTU
 
System design
System designSystem design
System design
 
MK Sistem Operasi.pdf
MK Sistem Operasi.pdfMK Sistem Operasi.pdf
MK Sistem Operasi.pdf
 
OS M1.1.pptx
OS M1.1.pptxOS M1.1.pptx
OS M1.1.pptx
 

Último

HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 

Último (20)

HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 

Module 1b OS.pptx

  • 1. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 PROPRIETARY MATERIAL. © 2007 The McGraw-Hill Companies, Inc. All rights reserved. No part of this PowerPoint slide may be displayed, reproduced or distributed in any form or by any means, without the prior written permission of the publisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual course preparation. If you are a student using this PowerPoint slide, you are using it without permission.
  • 2. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Overview of operating systems • A modern OS contains a very large number of features – Many of these features were first introduced in different classes of operating systems, namely * Batch Processing operating systems * Multiprogramming operating systems * Time sharing operating systems * Real time operating systems * Distributed operating systems – These features are used in a modern OS as well * We study these features in the context of the relevant OS * Study their influence on system performance and user service
  • 3. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Recap from Chapter 1 • The fundamental goals of an operating system – Obtain * High system performance * Good user service within a computing environment – A computing environment consists of a computer system, its interfaces with other systems, and user computations * Measures of system performance and user service depend on the computing environment
  • 4. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Recap from Chapter 1 • Fundamental tasks of an OS – Management of Programs * Organize their execution by sharing the CPU * Ensure good user service – Management of Resources * Fast allocation and de-allocation without constraining user programs * Efficient use of resources – Security and Protection * Ensure absence of interference with programs and resources by entities within and outside the OS
  • 5. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Introduction In this chapter, we shall first study: • Fundamentals of OS operation – Features of a computer that are important for an OS – How the OS controls execution of programs – How a program interacts with an OS • Efficiency, system performance and user convenience – Measures of system performance – User service as a measure of user convenience
  • 6. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 OS and the Computer System • In this module, we study – Fundamental features of computer systems that are important to an OS * Memory hierarchy * Interrupt structure * I/O organization – How an OS uses these features to control operation of an OS – Fundamentals of how a program interacts with an OS
  • 7. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Memory utilization during operation of an OS • The kernel is the core of the OS; it is memory resident at all times • Non-kernel programs are loaded in the transient area when needed • Rest of the memory is shared between user programs
  • 8. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Model of a computer system • The CPU and the I/O subsystem have independent paths to memory • The memory management unit plays a part in implementing virtual memory
  • 9. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 The program status word (PSW) • The CPU contains two kinds of registers – User accessible registers * Used for arithmetic or logical operations, addressing, indexing, etc. These are called general purpose registers, or simply, CPU registers – Control registers * Condition code register (also called the flags register), program counter, etc. * Their contents govern operation of the CPU • Control registers are collectively called the program status word (PSW) – Individual control registers are considered as fields of the PSW
  • 10. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Fields of the Program Status Word (PSW) • The ‘privileged mode’ field indicates whether the CPU is in the privileged mode, which is used by the OS, or user mode * Some instructions can be executed only when CPU is in the privileged mode • Condition code and Program counter registers were mentioned before • Other registers are discussed later
  • 11. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Privileged mode of CPU • The CPU can operate in two modes. The privileged mode (P) field of PSW controls the CPU mode – Privileged mode (`P’ field contains 1) * Certain sensitive instructions can be executed only when the CPU is in this mode  For example, initiation of an I/O operation, setting protection information for a program  These instructions are called privileged instructions – User mode * Privileged instructions cannot be executed when the CPU is in this mode
  • 12. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 State of the CPU • The state of the CPU consists of – The PSW and contents of the general purpose registers of the CPU – It indicates * What the CPU is engaged in doing at any moment * What the CPU can do, in terms of privileges to perform certain operations – The OS keeps track of the state of the CPU to know what the program currently executing on the CPU is doing
  • 13. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 State of the CPU (a) An assembly language program (b) CPU state of the program after executing the COMPARE instruction – 0 in the P field indicates that the CPU is in the user mode – 150 in the PC field indicates that the CPU is about to execute the instruction with address 150
  • 14. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Memory hierarchy • The memory hierarchy is a cost-effective method of obtaining a large and fast memory – It is an arrangement of several memories with different access speeds and sizes * The CPU accesses only the fastest memory; i.e., the cache * If a required byte is not present in the memory being accessed, it is loaded there from a slower memory
  • 15. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Memory hierarchy • Cache memory is the fastest and disk the slowest in the hierarchy • The CPU accesses only the cache memory • If required data or instruction is not present in the cache, it is loaded there from memory (if not present in memory, it is first loaded from disk)
  • 16. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Memory hierarchy • Cache memory – Organization * A cache block or cache line is loaded from memory when some byte in it is referenced * A ‘write-through’ arrangement is typically used to update memory – The cache hit ratio (h) indicates what percentage of accessed bytes were already present in cache * The cache hit ratio has high values because of  Temporal locality  Spatial locality * Effective memory access time = h x access time of cache memory + (1 – h) x (time to load a cache block + access time of cache memory)
  • 17. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Memory hierarchy • Main memory – Memory protection prevents access to memory by an unauthorized program * Memory bound registers indicate bounds of the memory allocated to a program (see next slide) • Virtual memory – The part of memory hierarchy consisting of the main memory and a disk is called virtual memory * A program and its data are stored on the disk * Required portions of the program and its data are loaded in memory when accessed
  • 18. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Memory protection using bound registers • The lower bound register (LBR) and upper bound register (UBR) contain addresses of first and last bytes allocated to the program • LBR, UBR are stored in the memory prot info (MPI) field of the PSW • The CPU raises an interrupt if an address is outside the LBR–UBR range
  • 19. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Input / Output organization • An I/O operation slows down a program’s execution due to mismatch of CPU and I/O speeds – Involvement of the CPU in I/O operations should be the minimum possible * CPU should be free to execute instructions while I/O operations are in progress – Different I/O modes * Programmed I/O * Interrupt I/O * Direct memory access (DMA)
  • 20. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Input / Output modes • Details of the Input/output modes – Programmed I/O * Data transfer between memory and an I/O device takes place through the CPU  CPU cannot perform any other operation until I/O completes – Interrupt I/O * An I/O instruction starts an I/O operation and frees the CPU to execute other instructions  An interrupt is raised every time a unit of data is to be transferred between memory and the I/O device  An interrupt processing program in the kernel actually transfers the data
  • 21. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Input / Output modes • Details of the Input/output modes (contd) – Direct memory access (DMA) * An I/O instruction indicates the operation to be performed and the number of bytes of data to be transferred. Its execution starts the I/O operation  Data transfer is coordinated by the DMA controller; it does not involve the CPU  When the I/O operation completes, the DMA controller raises an I/O interrupt to indicate its completion (interrupts are discussed later)  CPU is free to execute other instructions while an I/O operation is in progress
  • 22. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Interrupts • An interrupt signals the occurrence of an event to the CPU – An event is a situation that requires OS intervention – At an interrupt, the interrupt action in the hardware diverts the CPU to execution of an interrupt processing routine (IPR) * The IPR is a routine in the OS kernel * It handles the situation that caused the interrupt * After the IPR, kernel switches the CPU to execution of a user program – Different classes of interrupts convey occurrences of different kinds of events
  • 23. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Classes of interrupts • Three important classes of interrupts are – Program interrupt * Caused by conditions within the CPU during execution of an instruction; e.g.,  Occurrence of an arithmetic overflow, addressing exception, or memory protection exception  Execution of the software interrupt instruction – I/O interrupt * Indicates completion of an I/O operation – Timer interrupt * Indicates that a specified time interval has elapsed
  • 24. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 The interrupt action 1. The interrupt code is formed depending on the cause of the interrupt; it is stored in the interrupt code (IC) field of the PSW 2. The PSW is saved in a memory location (or in the stack) 3. Contents of an appropriate interrupt vector are loaded in the PSW; new contents of the PSW now control CPU operation
  • 25. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Steps in interrupt action • The interrupt action consists of three steps 1. Set interrupt code in the PSW * The code describes the situation that caused the interrupt * It is stored in the interrupt code field of the PSW 2. Save the PSW * PSW is saved in a memory location * Interrupt code gets saved as a part of the PSW 3. Load interrupt vector * Interrupt vector of the occurred interrupt is chosen  It contains address of the interrupt processing routine (IPR) * It is loaded in the PSW  Control is transferred to the IPR
  • 26. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Interrupt driven operation of a kernel • At the occurrence of an interrupt, the CPU is diverted to the interrupt processing routine (IPR), which is a part of the kernel • The IPR handles the interrupt by performing appropriate actions • The IPR passes control to the scheduler, which selects a program for execution
  • 27. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Servicing of an I/O interrupt and return to the same user program User program → IPR for I/O interrupt → Scheduler → User program
  • 28. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Nested interrupts • An interrupt may occur while a previous interrupt is being processed – The interrupt action would divert the CPU to handle the new interrupt. On completion of its processing, processing of the previous interrupt would be resumed * It may delay processing of the previous interrupt – The interrupt mask (IM) indicates whether a new interrupt should be allowed to occur while a previous interrupt is being serviced * Each bit in the mask controls masking of one class of interrupts  If an interrupt is masked off: it remains pending  If an interrupt is enabled: it can occur
  • 29. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Simple and nested interrupt processing (a) A single interrupt occurs and is serviced (b) A nested interrupt occurs. Processing of the previous interrupt is suspended until the new interrupt gets handled
  • 30. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 System Call • A computer has a special instruction called a ‘software interrupt’ instruction – Its sole purpose is to cause a program interrupt – Its operand becomes the interrupt code * A program uses the software interrupt instruction to make a request to the system  The operand of the instruction indicates what kind of request is being made  Association between interrupt code and kind of request is OS-specific * This method of making a request is known as a system call
  • 31. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Types of system calls • System calls are used to make diverse kinds of requests – Resource related * Resource request or release, checking resource availability – Program related * Execute or terminate a program, set or await timer interrupt – File related * Open or close a file, read or write a record – Information related * Get time and date, get resource information – Communication related * Send or receive message, setup or terminate connection
  • 32. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Efficiency, system performance and user convenience • The nature of a computing environment determines – The nature of user computations * Non-interactive computing environment  Back-office applications * Interactive computing environment  Online applications * Real time computing environment  Time-critical applications – Notions of efficiency, system performance and user service * e.g., user service is  Response time for interactive computing  Deadline for real time computing
  • 33. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Computations in an OS • We discuss four kinds of computations in an OS – Program * A set of functions or modules, including those from libraries – Job * A sequence of job steps  Each job step is an execution of a program  It is executed only if previous job steps executed successfully – Process * A process is an execution of a program – Subrequest * A subrequest is a computational requirement presented by a user to a process. It produces a single response comprising of results or actions
  • 34. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Measures of efficiency and user convenience • We use the following measures – Efficiency of use * CPU efficiency  Percent utilization of CPU – System performance * Throughput  Amount of work done per unit of time – User service * Turn-around time  Time between submission and completion of a job or process * Response time  Time between issuing and completion of a subrequest
  • 35. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Efficiency and user convenience in different OS classes • Service is a user-centric consideration • Efficiency is a system-centric consideration • Different OSs trade them off differently
  • 36. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Efficiency and user convenience in different OS classes • Explanation of the previous chart: – A multiprogramming OS provides better efficiency than a batch processing OS because it services many processes in an overlapped manner * However, user convenience does not change – A time sharing system provides better response times than a multiprogrammed system * Hence it provides the better user convenience – A real time OS does not provide as much efficiency as a time sharing OS because it may reserve some resources for exclusive use of a process
  • 37. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Batch processing system In early operating systems, the computer operator had to manually set-up execution of every job • Aim of batch processing: – To reduce operator’s intervention in processing of user jobs * A batch is a sequence of jobs * The operator sets up processing of a batch, rather than processing of individual jobs  It saves valuable time spent in human actions
  • 38. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Batch processing system • The operator forms a batch of jobs and inserts ‘start of batch’ and ‘end of batch’ cards • Operator initiates processing of a batch • The batch monitor, which is a primitive OS, performs transition between individual jobs
  • 39. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Turn-around time in a batch processing system • ‘Turn-around time’ of a job is the time between the submission of a job and obtaining of its results • If results are printed after entire batch is processed, turn-around time depends on execution time of all jobs in the batch
  • 40. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Batch processing • Control statements are used to facilitate batch processing – Users insert control statements in their jobs to specify * Start and end of a job, end of program or data * Requirements concerning execution of a program – The batch monitor processes the control statements to take appropriate actions * Initiate or terminate processing of a batch * Initiate or terminate processing of a job * Protect adjoining programs in the batch against interference  If a program tries to read more data than provided, the end-of- data card alerts the batch monitor  Batch monitor terminates the program (see next slide)
  • 41. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Control statements in IBM 360/370 systems • The // JOB and /& statements are start-of-job and end-of-job statements • The // EXEC statement indicates which program is to be executed • The /* card indicates end of the program or end of its data
  • 42. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Multiprogramming Systems In a batch processing system, the CPU remained idle while a program performed I/O operations • Aim of multiprogramming: – Achieve efficient use of the computer system through overlapped execution of several programs * While a program is performing I/O operations, the OS schedules another program
  • 43. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Operation of a multiprogramming system (a) Program 1 performs I/O and Program 2 executes on the CPU (b) Program 2 initiates I/O, so OS switches the CPU to Program 3 (c) Program 1’s I/O operation completes, so OS switches CPU to its execution
  • 44. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Architectural support for multiprogramming • The computer’s architecture must contain following features to support multiprogramming – DMA * To provide parallel operation of the CPU and I/O – Interrupt hardware * To implement the interrupt action, which passes control to the OS – Memory protection * To prevent corruption or disruption of a program by other programs – Privileged mode of CPU * CPU must be in privileged mode to execute sensitive instructions * It is in the user mode, i.e., non-privileged mode, while executing user programs
  • 45. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Functions of a multiprogramming kernel • The kernel of a multiprogramming OS performs the following functions – Resource allocation and protection * It uses memory protection to avoid interference between programs – Keeping track of start and end of I/O operations through interrupt processing, so that it can * Initiate I/O operations * Perform scheduling
  • 46. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Concepts and techniques of multiprogramming • Three key concepts are – Use a suitable program mix of CPU-bound and I/O-bound programs * A CPU-bound program performs computations most of the time, and I/O operations seldom * An I/O bound program performs I/O operations frequently – Assign suitable priorities to programs * Decide which program should be favoured for execution on the CPU—an I/O-bound program or a CPU-bound program? – Use a suitably high degree of multiprogramming * Degree of multiprogramming = No of programs in memory * Facilitates parallel operation of CPU and I/O system
  • 47. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Priority in a multiprogramming OS • Priority is a tie-breaking rule used when more than one program is ready for execution – At any moment, the highest priority program that is not waiting for an I/O operation to complete is chosen for execution – Preemptive priority * Definition: Preemption is forcible removal of a program from the CPU * A low priority program executing on the CPU is preempted when a high priority program becomes ready for execution
  • 48. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Program priority in Multiprogramming OSs The priority assignment rule for achieving better performance: “I/O bound programs should have higher priorities than CPU bound programs” We shall discuss different priority assignments to I/O-bound and CPU- bound programs, study their influence on performance, and conclude accordingly
  • 49. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Timing chart when a CPU-bound program has higher priority • At time 0, the CPU-bound program is selected for execution • It starts an I/O operation at t11, hence progiob is selected for execution • progcb is scheduled at t13 when its I/O operation completes progiob: I/O-bound program progcb : CPU-bound program
  • 50. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 A CPU-bound program has higher priority • Observations – CPU utilization is reasonable – I/O utilization is poor – Periods of concurrent CPU and I/O activities are rare Q: Can I/O utilization be improved? A: No! Adding an I/O-bound program does not help much because it has a low priority
  • 51. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Timing chart when an I/O bound program has higher priority • progiob is selected at time 0 • It starts an I/O operation at t21, hence progcb is scheduled • progcb is preempted when progiob’s I/O operation is completed
  • 52. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 An I/O-bound program has higher priority • Observations: – CPU utilization is reasonable – I/O utilization is reasonable – Periods of concurrent CPU and I/O activities are frequent Q: Can CPU and I/O utilization be improved? A: Yes * Addition of a CPU-bound program improves CPU utilization * Addition of an I/O-bound program improves I/O utilization
  • 53. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Performance and user service in multiprogramming – Performance is measured as throughput * Throughput is the number of programs serviced by the system in a unit of time * For high throughput, I/O-bound programs should have higher priorities than CPU-bound programs – User service is measured as turn-around time of a job * Turn-around time of a job is the elapsed time between submission of a job and its completion
  • 54. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Improving throughput in a multiprogramming system • How to improve throughput? – Add a CPU-bound program, give it the lowest priority * It uses the CPU when it would have been idle, e.g., the interval t26-t27 * Its presence does not affect progress made by other programs – Add an I/O-bound program, give it a high priority * Its presence improves I/O utilization * It may affect progress of the CPU-bound program marginally
  • 55. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Variation of throughput with degree of multiprogramming Q: Why does the throughput stagnate at high values of m?
  • 56. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Time sharing systems • In interactive computing, users desire good response times to their subrequests – Response time to a subrequest is the time since the subrequest is made to the time its results are obtained – A time sharing system provides good response times to subrequests through * Round-robin processing of programs * Using a time slice (δ) to prevent a program from using too much CPU time in one go
  • 57. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 A schematic of round-robin scheduling with time slicing • The OS maintains a list of programs that wish to execute on the CPU • The scheduler selects the first program in the list • If the time slice elapses before the scheduled program completes its operation, it is preempted and put back into the scheduling list
  • 58. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Operation of a time slicing scheduler (a) The program is preempted when the time slice elapses; i.e., after it has consumed δ seconds (b) The program gives up the CPU when it starts an I/O operation; i.e., before it has consumed δ seconds; another program is now scheduled
  • 59. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Time sharing systems • Relation between time slice and response time – Choice of the time slice depends on two factors * Response time to programs * Overhead of switching between programs (σ) – If every program consumes δ CPU seconds before producing a response, * response time is = na x (δ + σ), where na is the number of active programs * CPU efficiency is = δ / (δ+σ)
  • 60. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Choice of δ • Influence of δ on response time – If δ is very small * A program may need more CPU time than δ to satisfy a request  Hence a program may have to be scheduled several times before a response can be obtained * Efficiency is low if δ and σ are comparable * Cache performance may be poor – If δ is large * Response time would be better than na x ( δ+σ ) * Efficiency would be better than δ / (δ+σ) because programs may not use the complete time slice
  • 61. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Swapping • Swapping is the technique of moving inactive programs out of the memory temporarily – It increases the number of programs that can be processed by the time sharing system Q: What are the conditions under which swapping is most effective?
  • 62. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 A schematic of swapping • The OS swaps out a program that is not likely to be executed immediately in future; it frees the memory occupied by the program • It swaps in a new program in the newly freed memory • The swapped-out program is loaded back before its turn for execution
  • 63. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Real time Operating system • A real time OS is used to service time critical applications – A time critical application is one that malfunctions if it does not receive a ‘timely response’ * Timeliness of the response depends on the nature of the application * A real time OS focuses on providing a timely response to an application
  • 64. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Real time Operating system • Two kinds of real time operating systems – Hard real time system: Meets the response requirement of an application under all conditions (including error recovery actions, if any) * Used in command and control applications * A computer system may have to be dedicated to an application – Soft real time system: Meets the response requirement of an application in a probabilistic manner * Used in applications such as multimedia and reservation systems
  • 65. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Real time operating systems • Features of a real time OS – Permits creation of multiple processes within an application * Overlapped operation of processes speeds up the application – Permits priorities to be assigned to processes – Permits a programmer to define interrupts in an application’s domain and provide interrupt processing routines * Enables the application to respond readily to events – Uses priority driven or deadline oriented scheduling * Helps in meeting the application’s time constraints – Provides fault tolerance and graceful degradation * Such that essential services can be performed in a timely manner
  • 66. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 A satellite data logging application • A satellite sends data to an earth station periodically – A computer application in the earth station receives the data * The computer stores the data in the signal in a file * Storing of data should be completed before the next signal arrives
  • 67. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Tasks in the satellite data logging application • Process 1 copies the data • Process 2 writes the data into a file • Process 3 performs statistical analysis on the data
  • 68. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Distributed operating system • Definition: a distributed computer system – A distributed computer system consists of a number of computer systems, each having its own memory and performing some of the control functions of the OS, interacting through the network – Each computer system is called a host or node, and the place where it is located is called a site
  • 69. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 A distributed system • A WAN connects geographically distant nodes • A LAN connects nodes within an office, laboratory or building
  • 70. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Distributed systems • Benefits of a distributed system – Resource sharing * An application can use resources located in other computers – Reliability * Provides availability of resources despite faults – Computation speed-up * Parts of a computation can be executed simultaneously in different computers – Communication * Users in different computer systems can communicate – Incremental growth * Cost of enhancing capabilities of a system is proportional to the desired enhancement
  • 71. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Features of Distributed Operating Systems • Parts of a distributed operating system execute in different nodes of a distributed system. Its salient features are: – The OS provides support for distributed computations * Remote procedure call (RPC) * Distributed file systems – The OS uses distributed control techniques because * Several computers participate in a decision * Control data may be distributed across nodes in the system
  • 72. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Classical OS concepts in Modern OSs • A modern OS supports different kinds of users, hence it has to fulfill diverse requirements – It uses many (most?) of the classical concepts discussed so far to meet different requirements * We will see details of these in the next slide – It uses adaptive techniques so that it can select the techniques that best suit a specific program * This way it can handle diverse workloads effectively
  • 73. Chapter 2: Overview of Operating Systems Dhamdhere: Operating Systems— A Concept-Based Approach , 2 ed Slide No: ‹#› Copyright © 2008 Classical OS concepts in Modern OSs • A modern OS uses the following classical concepts – Batch processing concepts * Database queries and back-office processing are batched – Priority-based preemptive scheduling * To provide better service to high priority applications * To obtain efficient use of resources – Time slicing * To provide good response times – Swapping * To increase the number of processes serviced – Creating multiple processes in an application * To provide timely response to real time applications – Resource sharing across boundaries of computers