PortOS Project 6 FAQ

Frequently asked questions:

  • Disk handler implementation What arguments does the disk handler have ?. How should I install the disk handler ?.

    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

  • Read/Write disk operations How does the minithread system send write/read operations to the disk driver?. How does the minithread that asks a disk operation behave ?.

    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.

  • Size of directory Would limiting the size of a directory to 1 data block limit the size of directories too much?

    Yes, this is an unnecessary restriction. Your directories should accomodate any number of entries.

  • Number of INODEs per data block When storing inodes, do we want to fit as many inodes as possible into a data block, or allocate one inode for each data block?

    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.


    414 Staff, May 2003.