0% found this document useful (0 votes)
130 views

CS2106 Tutorial 09

This document contains 4 questions related to I/O device controllers and strategies: 1. Placing error checking in a device controller rather than the kernel has advantages of offloading work from the kernel but disadvantages of increased device complexity. 2. A hybrid I/O strategy combines polling, sleeping, and interrupts - polling is best for fast I/O, interrupts for slow I/O, and sleeping avoids wasting CPU cycles during longer operations. 3. Splitting interrupt handling code into pieces that execute immediately and later can benefit throughput by scheduling remaining work instead of completing it immediately. 4. Supporting virtual addresses in a DMA controller would complicate its design since DMA controllers do not have access

Uploaded by

weitsang
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
130 views

CS2106 Tutorial 09

This document contains 4 questions related to I/O device controllers and strategies: 1. Placing error checking in a device controller rather than the kernel has advantages of offloading work from the kernel but disadvantages of increased device complexity. 2. A hybrid I/O strategy combines polling, sleeping, and interrupts - polling is best for fast I/O, interrupts for slow I/O, and sleeping avoids wasting CPU cycles during longer operations. 3. Splitting interrupt handling code into pieces that execute immediately and later can benefit throughput by scheduling remaining work instead of completing it immediately. 4. Supporting virtual addresses in a DMA controller would complicate its design since DMA controllers do not have access

Uploaded by

weitsang
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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