You are on page 1of 2

Operating System (Lecture 11)

1. List and briefly define THREE techniques for performing I/O.


a. Programmed I/O
i. The processor issues an I/O command, on behalf of a process, to an I/O module;
ii. That processor then busy-waits (CPU checks status bit periodically) for the
operation to be completed before proceeding
b. Interrupt-driven I/O
i. The processor issues an I/O command on behalf of a process, continues to
execute subsequent instructions, and is interrupted by the I/O module when its
completed
ii. The subsequent instructions may be in the same process, if it is not necessary
for that process to wait for the completion of the I/O
iii. Otherwise, the process is suspended pending the interrupt and other work is
performed
iv. The difference between programmed I/O and interrupt driven I/O :

c. Direct memory access (DMA)


i. A DMA module controls the exchange of data between main memory and an I/O
module
ii. The processor sends a request for the transfer of a block of data to the DMA
module and is interrupted only after the entire block has been transferred
2. What is the difference between block-oriented and stream-oriented devices?
a. Block-oriented devices stores information in blocks that are usually of fixed size, and
transfers are made one block at a time. Generally, it is possible to reference data by its
block number
b. Disks and tapes are examples of block-oriented devices

c. Stream-oriented devices transfer data in and out as a stream of byte, with no block
structure
d. Terminals, printers, communications port, mouse and other pointing devices and most
other devices that are not secondary storage are stream oriented

3. State some utilities of buffering


a. Buffering smoothens out peaks in I/O demand
b. It alleviates the differences in coordination that may crop up due to a disparity in the
speed of the producer and the consumer of the data stream
i. For example, a file received by a modem is to be stored on a hard disk, which is
a thousand times faster than a modem
ii. A buffer created in the main memory receives the bytes from the modem and
when an entire buffer filled, it is written onto the disk
c. Buffering adapts devices that have different data-transfer sizes to transfer data among
themselves
d. It helps in copying semantics for application I/O
i. Update kernel buffer with application data before writing to disk
ii. The version of the data written to disk is guaranteed to be the version at the
time of the application system call
iii. Don’t have to worry application data has changed at the time of system call

You might also like