Lecture 12 homework: Unix I/O

Handed out: Saturday, October 16, 2004
Due: Wednesday, October 20, 2004
Read: chapters 15, 16, 17 and related source.

Hand-In Procedure

You are to turn in this homework during lecture. Please write up your answers to the exercises below and hand them in to a 6.828 staff member by the end of the lecture.

I/O Caching

Answer the following questions (a sentence or two is enough). The readings from chapter 17 and the beginning of chapter 15 (15-1) may help you with the following:

Exercise 1. Can a buffer both be on a block device list (bdevsw[dev.d_major].d_tab) and the free list (bfreelist)?

Exercise 2. When a block is released, is it removed from bdevsw[dev.d_major].d_tab?

Exercise 3. When a block is released, where is it inserted in bfreelist?

Exercise 4. What cache replacement policy does bio.c (sheet 45-53) implement?

The RK device

Exercise 5.he RK device (the disk) operates in parallel with the processor, yet they share a number of registers (rkds, rker, rkcs, rkwc, rkba, rkda). Can it happen that the processor and the RK device ever write both to the same register at the same time?

Explain why it cannot happen, or give an example of a register that could be written by both at potentially the same time?

Chapter 16 might be helpful here.

This completes the homework.