You are on page 1of 1

National University of Singapore

School of Computing
CS2106 Tutorial 9 Semester 1 10/11

1. What are some advantages and disadvantages of placing functionalities such as error check-
ing in a device controller, rather than in the kernel?

2. Polling for an I/O completion can waste CPU cycles if the processor busy-waits before the
I/O completes. On the other hand, when the I/O device is ready for service, polling can be
much more efficient, compared to handling an interrupt. Describe a hybrid strategy that
combines polling, sleeping, and interrupts for I/O device service. For each of these three
strategies (pure polling, pure interrupts, hybrid), describe the characteristics of the I/O
operations in which the strategy is more efficient than the others.

3. A single interrupt is typically raised after completion of I/O and handled by the CPU. In
certain OS implementations, however, the code that is to be executed at the completion
of the I/O is split into two pieces. The first pieces executes immediately after the I/O
completes. This piece of code then schedules the remaining pieces of code to be executed
later.
How can this strategy be beneficial?

4. Consider a DMA controller that supports virtual addresses (instead of physical addresses)
as the targets of I/O operations. How would this complicates the design of the DMA
controllers? (Note that MMU is typically placed on the path between CPU and memory,
and is not accessible by DMA controllers).

You might also like