The disk driver code (disk.[hc]) sends a disk interrupt after a read/wite request is processed. The disk interrupt is processed by the disk handler that receives an argument of disk_interrupt_arg_t type. The disk handler is installed using install_disk_handler function. Before sending requests to a disk, the disk should be created using disk_create function. A simple example of using a disk by the minithread system is given in disk_test.c
A minithread asks a write/read block operation using disk_read_block/disk_write_block functions. The disk operation request is assigned an I/O structure. The I/O structure is used in the disk handler to wake up the blocked minithread that waits for the result of the request.
Yes, this is an unnecessary restriction. Your directories should accomodate any number of entries.
This is a design question, and by project 6, these types of questions are up to you.
But let me reiterate the design principles to keep in mind:
- You will want to design a system whose implementation is not overly complex. If it isn't working by the deadline, it might as well not exist.
- You will want to store the inodes in a place where you can readily find them.
- You will want to avoid wasting space.
So, if I were you, I would initially place each inode on a separate block. This wastes space, but calculating the location of an inode is a breeze. Once this works, you can modify the filesystem to pack N inodes into a single disk block.