INTRODUCTION

TO

OPERATING SYSTEMS

Lecture 5: Input and Output

CHRIS STAFF
Dept. of Computer Science and Artificial Intelligence
University of Malta

Next Lecture: Resource Allocation (1)


Lecture Outline

Aims and Objectives
Terminology
Device Independence - Uniform Treatment of all Devices
Controlling Input and Output (From Lister & Eager)
Device Handlers
Buffering
File Devices
Spooling
Summary


Aims and Objectives


Terminology

Differences between devices

So


Device Independence - Uniform Treatment of all Devices

Advantages

Device Handlers


Controlling Input and Output (From Lister & Eager)

I/O procedure of the following form can be used

DOIO(stream, mode, amount, destination, semaphore)

where:

DOIO name of an I/O procedure
stream number of the stream I/O will occur
mode required operation
amount amount of data to be transferred
destination address into which data is to be input
(source address from which data is to be output)
semaphore address of semaphore request serviced which is to be
signalled when I/O operation completes.

Functions & Characteristics of the I/O procedure.

procedure DOIO(stream, mode, amount, destination, semaphore);
begin lookup device in process descriptor;
check parameters against device characteristics;
if error then error exit;
assemble IORB;
add IORB to device request queue;
signal(request pending)
end;


Device Handlers

The interaction between the modules described above is summarised in the diagram below

Disadvantage of the operation described above

Restructuring the operation


Buffering

Other Advantages


File Devices


Spooling

Advantages and Disadvantages

+ can reduce, but not remove, risks of deadlock

+ can produce multiple copies of output without rerunning the job

- need large amounts of disk space

- increases disk traffic

- not practical for real-time environment, because results are produced at a later time.


Summary


Next Lecture...

Resource Allocation (1)