Chapter: Chapter 13

Multiple Choice

1.  The ____ register of an I/O port can be written by the host to start a command or to change the mode of a device.
A)  status
B)  control
C)  data-in
D)  transfer

Ans:  B
Section: 13.2
Difficulty: Medium

2.  An interrupt priority scheme can be used to ____.
A)  allow the most urgent work to be finished first
B)  make it possible for high-priority interrupts to preempt the execution of a low priority interrupt
C)  defer the handling of low-priority interrupt without masking off all interrupts
D)  All of the above

Ans:  D
Section: 13.2.2
Difficulty: Difficult

3.  DMA controllers ____.
A)  do not utilize an additional, special purpose, processor
B)  are a nonstandard component in PCs of today
C)  can steal memory access cycles from the main CPU
D)  can access main memory at the same time as the main CPU

Ans:  C
Section: 13.2.3
Difficulty: Medium

4.  A character-stream device ____.
A)  transfers data in blocks of bytes
B)  transfers data a byte at a time
C)  is a device such as a disk drive
D)  is similar to a random access device

Ans:  B
Section: 13.3
Difficulty: Easy

5.  ____ I/O accesses a block device as a simple array of blocks.
A)  Raw
B)  Stream
C)  Indirect
D)  Cooked

Ans:  A
Section: 13.3.1
Difficulty: Medium

6.  Which of the following is true of a blocking system call?
A)  The application continues to execute its code when the call is issued.  
B)  The call returns immediately without waiting for the I/O to complete.
C)  The execution of the application is suspended when the call is issued.
D)  Blocking application code is harder to understand than nonblocking application code

Ans:  C
Section: 13.3.4
Difficulty: Difficult

7.  A(n) ____ is a buffer that holds output for a device that cannot accept interleaved data streams.
A)  escape
B)  block device
C)  cache
D)  spool

Ans:  D
Section: 13.4.4
Difficulty: Medium

8.  A sense key reports on the failure of a SCSI device by ____. 
A)  stating the general category of failure
B)  stating the general nature of the failure
C)  giving detailed information about the exact cause of failure
D)  maintaining internal pages of error-log information

Ans:  B
Section: 13.4.5
Difficulty: Medium

9.  A(n) ____ is a front-end processor that multiplexes the traffic from hundreds of remote terminals into one port on a large computer. 
A)  terminal concentrator
B)  network daemon
C)  I/O channel
D)  context switch coordinator

Ans:  A
Section: 13.7
Difficulty: Medium

10.  Which of the following is a principle that can improve the efficiency of I/O? 
A)  Increase the number of context switches.
B)  Use small data transfers
C)  Move processing primitives into hardware
D)  Decrease concurrency using DMA controllers

Ans:  C
Section: 13.7
Difficulty: Difficult

Essay

11.  Explain the concept of  a bus and daisy chain. Indicate how they are related.

Ans:  A bus is merely a set of wires and a rigidly defined protocol that specifies a set of messages that can be sent on the wires. The messages are conveyed by patterns of electrical voltages applied to the wires with defined timings. A daisy chain is a device configuration where one device has a cable that connects another device which has a cable that connects another device, and so on. A daisy chain usually operates as a bus.
Section: 13.2
Difficulty: Medium

12.  Explain the difference between a serial-port controller and a SCSI bus controller.

Ans:  A serial-port controller is a simple device controller with a single chip (or portion of a chip) that controls the signals on the wires of a serial port.  By contrast, a SCSI bus controller is not simple.  Because the SCSI protocol is complex, the SCSI bus controller is often implemented as a separate circuit board that plugs into the computer.
Section: 13.2
Difficulty: Medium

13.  Explain the concept of polling between a host and a controller. 

Ans:  When a host tries to access the controller, it constantly reads the status of a "busy register" and waits for the register to clear. This repetitive checking is termed polling. 
Section: 13.2.1
Difficulty: Medium

14.  What is interrupt chaining?

Ans:  Interrupt chaining is a technique in which each element in the interrupt vector points to the head of a list of interrupt handlers.  When an interrupt is raised, the handlers on the corresponding list are called one by one, until one is found that can service the request.  This is a compromise between the overhead of a huge interrupt table and the inefficiency of dispatching to a single interrupt handler.
Section: 13.2.2
Difficulty: Medium

15.  Why is DMA used for devices that execute large transfers?

Ans:  Without DMA, programmed I/O must be used. This involves using the CPU to watch status bits and feed data into a controller register one byte at a time.  Therefore, DMA was developed to lessen the burden on the CPU.  DMA uses a special-purpose processor called a DMA controller and copies data in chunks.
Section: 13.2.3
Difficulty: Medium

16.  What is the purpose of a programmable interval timer?

Ans:  The programmable interval timer is hardware used to measure elapsed time and to trigger operations. The scheduler uses this mechanism to generate an interrupt that will preempt a process at the end of its time slice.
Section: 13.3.3
Difficulty: Medium

17.  Give an example of when an application may need a nonblocking I/O system call.

Ans:  If the user is viewing a web browser, then the application should allow keyboard and mouse input while it is displaying information to the screen. If nonblocking is not used, then the user would have to wait for the application to finish displaying the information on the screen before allowing any kind of user interaction.
Section: 13.3.4
Difficulty: Medium

18.  What are the three reasons that buffering is performed?

Ans:  A buffer is a memory area that stores data while they are transferred between two devices or between a device and an application. One reason for buffering is handle data when speed mismatches between the producer and consumer of a data stream exist. The second reason is to adapt between devices that have different data-transfer sizes. The third reason is to support copy semantics for application I/O.
Section: 13.4.2
Difficulty: Medium

19.  What is the purpose of a UNIX mount table?

Ans:  The UNIX mount table associates prefixes of path names with specific device names.  To resolve a path name, UNIX looks up the name in the mount table to find the longest matching prefix; the corresponding entry gives the device name. 
Section: 13.5
Difficulty: Medium

20.  UNIX System V implements a mechanism called STREAMS. What is this mechanism? 
Ans:  STREAMS enables an application to assemble pipelines of driver code dynamically.  A stream is a full-duplex connection between a device driver and a user-level process.  It consists of a stream head that interfaces with the user process and a driver end that controls the device. It may also include stream modules between them.
Section: 13.6
Difficulty: Difficult

True/False

21.  An expansion bus is used to connect relatively high speed devices to the main bus.

Ans:  False
Section: 13.2
Difficulty: Medium

22.  A maskable interrupt can never be disabled.

Ans:  False
Section: 13.2.2
Difficulty: Medium

23.  A dedicated device cannot be used concurrently by several processes or threads.

Ans:  True
Section: 13.3 
Difficulty: Easy

24.  Although caching and buffering are distinct functions, sometimes a region of memory can be used for both purposes.

Ans:  True
Section: 13.4
Difficulty: Medium

25.  STREAMS I/O is asynchronous except when the user process communicates with the stream head.

Ans:  True
Section: 13.6
Difficulty: Medium

26. Vectored IO allows one system call to perform multiple IO operations involving involving a single location.

Ans: False
Section: 13.3.5
Difficulty: Medium