0% found this document useful (0 votes)
6 views28 pages

Lecture 29

The document covers Chapter 8 of a course on Computer Organization and Architecture, focusing on Operating System (OS) support, including its overview, scheduling, and memory management. It discusses the key functions of an OS, the evolution from early systems to modern ones, and various scheduling techniques. Additionally, it highlights the OS's role as a user interface and resource manager, detailing services provided and types of operating systems.

Uploaded by

Amaresh Swain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views28 pages

Lecture 29

The document covers Chapter 8 of a course on Computer Organization and Architecture, focusing on Operating System (OS) support, including its overview, scheduling, and memory management. It discusses the key functions of an OS, the evolution from early systems to modern ones, and various scheduling techniques. Additionally, it highlights the OS's role as a user interface and resource manager, detailing services provided and types of operating systems.

Uploaded by

Amaresh Swain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

COMPUTER ORGANIZATION AND

ARCHITECTURE (COA)
EET- 2211

EET 2211
4TH SEMESTER – CSE & CSIT
CHAPTER 8, LECTURE 29
CHAPTER 8 – OPERATING SYSTEM
SUPPORT
TOPICS TO BE COVERED
Ø Operating System Overview
Ø Scheduling
Ø Memory Management

LEARNING OBJECTIVES
Ø Summarize the key functions of the OS.
Ø Discuss the evolution of the OS form early simple batch systems to modern complex
systems.
Ø Explain the different types of scheduling .
Ø Understand the reason for memory partitioning and explain the various techniques
that are used.
Ø Assess the relative advantages of paging and segmentation.
Ø Define Virtual memory.

2 LECTURE 29 7/10/2021
OPERATING SYSTEM OVERVIEW
 An OS is a program that controls the execution of application
programs and acts as an interface between applications and the
computer hardware.
 Popular OS include LINUX OS, WINDOWS OS, VMS, OS/400,
Z/OS etc.
 OBJECTIVES:(i)Convenience (an OS makes a computer
more convenient to use)
(ii) Efficiency (an OS allows the computer
system resources to be used in an efficient
manner)
 ASPECTS OF OS: (i) the OS as a user/computer interface
(ii) the OS as a resource manager.

3 LECTURE 29 7/10/2021
THE OS AS A USER/COMPUTER
INTERFACE
üThe end user is not concerned
with the computer’s architecture.
üThe application is expressed in a
programming language.
üP r o g r a m s a r e r e f e r r e d a s
UTILITES.
üThe most impor tant system
program is the OS.
üOS masks the details of the
hardware from the programmer.
üOS provides the programmer a
convenient interface for using the
Fig.1: Computer Hardware and Software
system. Structure [Source: Computer Organization
LECTURE 29
and Architecture by William Stallings]
4 7/10/2021
Contd.
vThe OS provides SERVICES in the following fields:

1. Program creation
2. Program execution
3. Access to I/O devices
4. Controlled access to files
5. System access
6. Error detection and response
7. Accounting

5 LECTURE 29 7/10/2021
Contd.
Ø PROGRAM CREATION : The OS provides a variety of facilities
and services such as editors and debuggers to assist the programmer
in creating programs. These programs in the form of utility
programs that are not actually part of the OS but are accessible
through the OS.

Ø PROGRAM EXECUTION : A number of steps need to be


performed to execute a program. Instructions and adapt must be
loaded into main memory, I/O devices and files must be initialized
and other resources must be prepared.

Ø ACCESS TO I/O DEVICES : Each I/O device requires its own


specific set of instructions or control signals for operation. The OS
takes care of the details so that the programmer can think in terms
of simple reads and writes.

6 LECTURE 29 7/10/2021
Ø CONTROLLED ACCESS TO FILES : OS takes care about the details of the
control that includes the nature of I/O devices (disk drive, tape drive) and also the
file format on the storage medium. With multiple simultaneous users the OS can
provide protection mechanisms to control access to the files.

Ø SYSTEM ACCESS : In case of a shared or public system, the OS controls access to


the system as a whole and to specific system resources. The access function must
provide protection of resources and data from unauthorized users and must resolve
conflicts for resource contention.

Ø ERROR DETECTION AND RESPONSE : A variety of errors can occur while a


computer system is running. These include internal and external hardware errors,
such as memory error or a device malfunction or failure, and various software
errors such as arithmetic overflow, attempt to access forbidden memory location
and inability of the OS to grant the request of an application. The response may
range from ending the program that caused the error, retrying the operation and
simply reporting the error to the application.

Ø ACCOUNTING : A good OS collects usage statistics for various resources and


monitors performance such as response time.

7 LECTURE 29 7/10/2021
Contd.

v Interfaces in a typical
computer system
1. I n s t r u c t i o n s e t
architecture (ISA)
2. A p p l i c a t i o n b i n a r y
interface (ABI)
3. A p p l i c a t i o n
programming interface
(API)

8 LECTURE 29 7/10/2021
THE OS AS A RESOURCE MANAGER
üOS is responsible for managing the
resources for the movement, storage and
processing of data.
üOS provides instr uctions for the
processor.
üOS directs the processor in the use of
other system resources.
üA portion of the OS is in the main
memory which includes
KERNEL/NUCLEUS.
üThe rest of the main memory contains
the user programs and data.
üOS decides when an I/O device can be
Fig.2: OS as Resource Manager [Source:
used by a program in execution. Computer Organization and Architecture by
William Stallings]
9 LECTURE 29 7/10/2021
TYPES OF OS
v TYPES OF OS
1. Interactive and batch systems
2. Mulitprogramming and uniprogramming systems

v INTERACTIVE SYSTEM: The user/programmer interacts directly with


the computer, usually through a keyboard/display terminal, to request the
execution of a job or to perform a transaction.
v BATCH SYSTEM : The user’s program is batched together with programs
from other users and submitted by a computer operator.
v MULTIPROGRAMMING SYSTEM : The processor works on more
than one program at a time. The processor is kept as busy as possible.
Several programs are loaded into memory and the processor switches
rapidly among them.
v UNIPROGRAMMING SYSTEM : It works on only one program at a
time.

10 LECTURE 29 7/10/2021
Contd.

v EARLY SYSTEMS
ü No OS.
ü The programmer interacted directly with the system.
ü Processors were run from a console (consisting of display light,
toggle switches, input devices and printer).
ü Programs in the processor code were loaded through the input
devices.
ü Error condition was indicated through lights.
ü The programmer checks the registers and main memory to
determine the cause of error.
ü Normal completion of the program appeared on the printer.
11 LECTURE 29 7/10/2021
Contd.
ü The Early systems presented two main problems:
1. Scheduling
2. Setup time

ü SCHEDULING : Most installations used a sign-up sheet to reserve


processor time. A user could sign up for a block of time in multiples of half
hour. A user might sign up for an hour and finish in 45 minutes resulting in
computer idle time. Similarly the user might run into problems, not able to
finish in the allotted time, and be forced to stop before resolving the
problem.

ü SET UP TIME : A single program called a job involves loading the


compiler plus the HLL program (source program) into memory, saving the
compiled program (object program), and loading and linking together the
object program and common functions. If an error occurs then the user
goes back to the beginning of the setup sequence. Thus a considerable
amount of time was spent just in setting up the program to run.

12 LECTURE 29 7/10/2021
Contd.
v SIMPLE BATCH SYSTEMS
ü Early processors were expensive and hence we need to
maximize the processor utilization. So
ü Simple batch systems were developed to improve processor
utilization.
ü Also known as MONITOR.
ü The user has no direct access to the processor.
ü The user submits the job on cards or tape to a computer
operator, who batches the jobs together sequentially and places
the entire batch on an input device for use by the monitor.

13 LECTURE 29 7/10/2021
Contd.

RESIDENT MONITOR
ü The portion of monitor always present in the
main memory and available for execution is
known as resident monitor.
ü The monitor reads in jobs one at a time from
the input device.
ü Now the current job is placed in the user
program area and the control is passed to this.
ü After completion of the job the control is
returned to the monitor which reads the next Fig.3: Memory Layout
job. for a Resident Monitor
[Source: Co m p u t e r
ü The result of each job are printed out for Organization and
delivery to the user. Architecture by
William Stallings]

14 LECTURE 29 7/10/2021
Contd.

ü The monitor handles the scheduling problem as well as the job


setup time.
ü Each job instruction is included in a JCL(job control language)
– a special type of programming language used to provide
instructions to the monitor.
ü Other desirable hardware features
1. Memory protection
2. Timer
3. Privileged instruction
4. Interrupts
ü Processor time alternates between execution of user
programs and execution of the monitor.

15 LECTURE 29 7/10/2021
Contd.

v MULTIPROGRAMMED BATCH SYSTEMS


ü The processor utilization time increases.
ü I/O devices are slower than the processor.
ü E.g. A program processes a file of records and executes 100
processor instructions per record. Computer spends over
96% of its time waiting for the I/O devices to finish
transferring data.

Fig.4: System utilization


example [Source: Computer
Organization and
Arc hitecture by William
Stallings]

16 LECTURE 29 7/10/2021
Contd.

Fig.5: Multiprogramming example [Source: Computer Organization


17 LECTURE 29 and Architecture by William Stallings] 7/10/2021
Contd.
EXAMPLE 1: this example illustrates the benefit of multiprogramming. Consider a
computer with 250 Mbytes of available memory (not used by OS), a disk, a terminal,
and a printer. Three programs JOB1, JOB 2, and JOB3 are submitted for execution at
the same time with the attributes listed in table 1. We assume minimal processor
requirements for JOB1 and JOB2 and continuous disk and printer use by JOB3. For a
simple batch environment, these jobs will be executed in sequence. Thus JOB1
completes in 5 minutes. JOB2 must wait until the 5 minutes is over and then
completes 15 minutes after that. JOB3 begins after 20 minutes and completes at 30
minutes form the time it was initially submitted. The average resource utilization,
throughput and response times are given in uniprogramming column of table 2.
device-by-device utilization is illustrated in figure6a. It is evident that there is gross
underutilization for all resources when averaged over the required 30-minute time
period.
Now suppose that the jobs are run concurrently under a multiprogramming OS.
Because there is little resource contention between the jobs, all three can run in nearly
minimum time while coexisting with the others in the computer (assuming that JOB2
and JOB3 are allotted enough processor time to keep their input and output
operations active). JOB1 will still require 5 minutes to complete but at the end of that
time, JOB2 will be one-third finished, and JOB3 will be half finished. All three jobs
will have finished within 15 minutes. The improvement is evident when examining the
multiprogramming column of table 2, obtained form the histogram of figure 6b.

18 LECTURE 29 7/10/2021
Contd.

19 LECTURE 29 7/10/2021
Contd.

Fig.6: Utilization histograms [Source: Computer


Organization and Architecture by William Stallings]
20 LECTURE 29 7/10/2021
Contd.

v TIME-SHARING SYSTEMS
ü Processor’s time is shared among multiple users.
ü Multiple users can simultaneously access the system through
terminals.
ü E.g. if there are n users actively requesting service at one
time, each user will see on the average 1/n of the effective
computer speed.

Table 3: Batch Multiprogramming versus Time Sharing [Source: Computer Organization


and Architecture by William Stallings]
21 LECTURE 29 7/10/2021
SCHEDULING
TYPES OF SCHEDULING
1. Long-term scheduling
2. Medium-term scheduling
3. Short-term scheduling
4. I/O scheduling

LONG-TERM SCHEDULING
ü Scheduler determines the programs that are to be
admitted to the system for processing.
ü It controls the degree of multiprogramming.

22 LECTURE 29 7/10/2021
Contd.

MEDIUM-TERM SCHEDULING
ü It is a part of the swapping function.
ü Swapping-in decision is based on the need to manage the
degree of multiprogramming.

SHORT-TERM SCHEDULING
ü Also known as dispatcher, executes frequently makes the
fine-grained decision of which job to be executed next.

23 LECTURE 29 7/10/2021
Contd.

PROCESS STATES
ü During the life-time of a process its status changes a number
of times.
ü Its status at any point of time is known as a state.

Fig.7: Five-State Process Model [Source: Computer Organization


and Architecture by William Stallings]
24 LECTURE 29 7/10/2021
Contd.
PROCESS CONTROL BLOCK
ü For each process in the system, the
OS must maintain information
indicating the state of the process
and for process execution.
ü Each process is represented in the
OS by a process control block.
ü When the scheduler accepts a new
job for execution it creates a blank
process control block and places
the associated process in the new Fig.8: Process Control Block
[Source: Computer
state. Organization and Architecture
by William Stallings]
25 LECTURE 29 7/10/2021
Contd.
SCHEDULING TECHNIQUES

LECTURE 29
Fig.9: Scheduling Example [Source: Computer Organization and
26 7/10/2021
Architecture by William Stallings]
QUESTIONS
1. What is an operating system?
2. List and briefly define the key services provided by an OS.
3. List and briefly define the major types of OS scheduling.

27 LECTURE 29 7/10/2021

You might also like