Page 167 - DCAP403_Operating System
P. 167
Operating System
Notes as handling different kind of errors. In this unit, we shall discuss how operating system handles
the inputs and outputs.
9.1 I/O Systems
Input/output, or I/O, refers to the communication between an information processing system
(such as a computer), and the outside world – possibly a human, or another information
processing system. Inputs are the signals or data received by the system, and outputs are the
signals or data sent from it. The term can also be used as part of an action; to “perform I/O” is
to perform an input or output operation. I/O devices are used by a person (or other system) to
communicate with a computer. For instance, keyboards and mouses are considered input devices
of a computer, while monitors and printers are considered output devices of a computer. Devices
for communication between computers, such as modems and network cards, typically serve for
both input and output.
Note The designation of a device as either input or output depends on the perspective.
Mouses and keyboards take as input physical movement that the human user outputs and
convert it into signals that a computer can understand. The output from these devices
is input for the computer. Similarly, printers and monitors take as input signals that a
computer outputs. They then convert these signals into representations that human users
can see or read. (For a human user the process of reading or seeing these representations
is receiving input.)
In computer architecture, the combination of the CPU and main memory (i.e. memory that the
CPU can read and write to directly, with individual instructions) is considered the heart of a
computer, and from that point of view any transfer of information from or to that combination,
for example to or from a disk drive, is considered I/O. The CPU and its supporting circuitry
provide I/O methods that are used in low-level computer programming in the implementation
of device drivers.
Higher-level operating system and programming facilities employ separate, more abstract I/O
concepts and primitives. For example, most operating systems provide application programs
with the concept of files. The C and C++ programming languages, and operating systems in the
Unix family, traditionally abstract files and devices as streams, which can be read or written, or
sometimes both. The C standard library provides functions for manipulating streams for input
and output.
Figure 9.1: I/O System
I/O
I/O Layer reply I/O Functions
request
User process Make I/O call; format I/O; spooling
Device-independent Naming, protection, blocking, buffering, allocation
software
Device drivers Setup device registers; check status
Interrupt handler Wakeup driver when I/O completed
hardware Perform I/O operation
160 LOVELY PROFESSIONAL UNIVERSITY