1. Give an example of a block device

  2. Give an example of a character device

  3. What is the difference between block and character devices?

  4. Name the five I/O software layers found in UNIX systems.

  5. Why is I/O organized into layers, e.g. what is the advantage of this approach?

  6. Name the two components of device controllers

  7. Name two types of registers that typically come with hardware devices.

  8. Name two approaches for communicating with devices from the OS.

  9. What is an I/O port?

  10. What is an I/O space?

  11. What is the advantage of using memory-mapped I/O over supporting separate spaces for memory and devices?

  12. What are some challenges/disadvantages of using memory-mapped I/O?

  13. How does the OS communicate with devices when using a separate space for memory and devices?

  14. How does the OS communicate with devices when using memory-mapped I/O?

  15. What is the purpose of Direct Memory Access (DMA)?

  16. On early computers, every byte of data read or written was handled by the CPU (i.e., there was no DMA). What implications does this have for multiprogramming?

  17. In the following diagram, show how the CPU can use a DMA controller to read data from disk storage. (Answer: Fig 5-4 in Tanenbaum)

    DMA
  18. List four steps that happen when an interrupt occurs due to a device event.

  19. List three approaches to I/O handling

  20. Suppose we want to read N bytes from a device. Briefly describe how the following code accomplishes this. What approach is the code taking to event handling?

for (i=0; i<N; i++) {
  while (*status != READY) ;
  *data = buffer[i];
}
  1. What is a device driver?

  2. What is the goal of the device-independent software layer?

  3. Name three different techniques that enable different devices to be accessed in a similar way.

  4. What is buffering? How does buffering relate to I/O?

  5. What is spooling? Give an example of a device that performs spooling.

  6. Consider the five layers of the I/O system. What is the primary functions of the

    • user process layer?

    • device-independent software layer?

    • device drivers?

    • interrupt handlers?

    • hardware?

  7. Why is device independence an important principle of I/O programming?

  8. Why is handling errors as close to the hardware as possible a principle of I/O Programming?

  9. Give an example of how hardware can handle errors without notifying the user.

  10. Give an example of a hardware error that requires reporting an error to the user.

  11. Give an example of how names are used to provide device-independence on UNIX systems.

  12. What is the difference between synchronous and asynchronous transfers of data.

  13. What is the difference between sharable and dedicated devices? Give an example of each.

  14. Give five examples of user-triggered events that are common in graphical user interfaces.

  15. Give five examples of widgets that are common in graphical user interfaces.