CS500 Operating System Design

Homework #10

Due Date/Time:

No need to turn it in. Just review them to get prepared for Final.

======

Student ID:

Name:

======

  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

  1. 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

  1. 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

  1. 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

  1. The ____ I/O accesses a block device (e.g., a disk) as a simple array of blocks.

a)Raw

b)Stream

c)Indirect

d)Cooked

  1. 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

  1. 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

  1. Q#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

  1. 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

  1. 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

  1. A ______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 ______is often implemented as a separate circuit board that plugs into the computer.

a)serial-port controller, SCSI bus controller

b)SCSI bus controller, serial-port controller,

  1. Which of the following if false?

a)When accessing the device controller, the host constantly reads the status of a "busy register" and waits for the register to clear. This repetitive checking is termed interrupt-driven I/O.

b)DMA uses a special-purpose processor called a DMA controller and copies data in chunks to lessen the burden on the CPU.

c)The programmable interval timer is hardware used to measure elapsed time and to trigger operations.

d)The CPU scheduler uses the programmable interval timer to generate an interrupt that will preempt a process at the end of its time slice.

  1. A buffer is a memory area that stores data while they are transferred between two devices or between a device and an application. What are the reasons that buffering is performed?

a)to handle data when speed mismatches between the producer and

b)consumer of a data stream exist.

c)to adapt between devices that have different data-transfer sizes.

d)to support copy semantics for application I/O.

e)all of the above

  1. 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.

a)True

b)False

  1. Which of the following is true;

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

b)A maskable interrupt can never be disabled.

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

  1. Although caching and buffering are distinct functions, sometimes a region of memory can be used for both purposes. For example, after a buffer is written to disk, then the copy in memory can be used as a cached copy until that buffer is needed for other purposes.

a)True

b)False

  1. If one or more devices use a common set of wires to communicate with the computer system, the connection is called ______.

a)CPU

b)Monitor

c)wirefull

d)bus

  1. A ____ consists of a set of wires and a rigidly defined protocol that specifies a set of messages that can be sent on the wires.

a)port

b)node

c)bus

d)None of these

  1. When device A has a cable that plugs into device B, and device B has a cable that plugs into device C and device C plugs into a port on the computer, this arrangement is called a ______.

a)port

b)daisy chain

c)bus

d)cable

  1. The ______present a uniform device-access interface to the I/O subsystem, much as system calls provide a standard interface between the application and the operating system.

a)devices

b)buses

c)device drivers

d)I/O systems

  1. A ______is a collection of electronics that can operate a port, a bus, or a device.

a)controller

b)driver

c)host

d)bus

  1. An I/O port typically consists of four registers status, control, ______and ______registers.

a)system in, system out

b)data in, data out

c)flow in, flow out

d)input, output

  1. An I/O controller typically has four registers, among which the ______register is read by the host to get input from I/O controller.

a)flow in

b)flow out

c)data in

d)data out

  1. An I/O controller typically has four registers, among which the ______register is written by the host to send output.

a)status

b)control

c)data in

d)data out

  1. The hardware mechanism that allows a device to notify the CPU is called ______.

a)polling

b)interrupt

c)driver

d)controlling

  1. The CPU hardware has a wire called ______that the CPU senses after executing every instruction.

a)interrupt request line

b)interrupt bus

c)interrupt receive line

d)interrupt sense line

  1. The ______determines the cause of the interrupt, performs the necessary processing and executes a return from the interrupt instruction to return the CPU to the execution state prior to the interrupt.

a)interrupt request line

b)device driver

c)interrupt handler

d)All of these

  1. In general the two interrupt request lines are ______

a)Maskable and nonmaskable interrupts

b)Blocked and non-Blocked interrupt

c)None of these

  1. The ______are reserved for events such as unrecoverable memory errors.

a)nonmaskable interrupts

b)blocked interrupts

c)maskable interrupts

d)None of these

  1. Which of the following is not correct?

a)DMA increases system concurrency by allowing the CPU to perform tasks while the DMA system transfers data via the system and memory buses.

b)Polling for an I/O completion can waste a large number of CPU cyclesif the processor iterates a busy-waiting loop many times before the I/O completes.

c)If the I/O device is ready for service, polling can be much more efficient than is catching and dispatching an interrupt.

d)Interrupt-driven I/O is efficient only when I/O the I/O is frequent and of short duration.

  1. Consider the I/O scenarios of a disk drive containing user files.Which of the following is not correct?

a)Buffering can be used to hold data while in transit from user space to the disk, and visa versa.

b)Caching can be used to hold disk-resident data for improved performance.

c)Spooling is necessary because disks are not shared-access devices.

  1. 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

1