Project 3 - File System COP 4600 Fall 2014 Due: Dec 12, 2014 Description: Modify the Minix file system to group directory i-nodes separately from file i-nodes. i-nodes are normally allocated by searching from the start of the i-node table until the first unused i-node is found. This results in directory i-nodes and file i-nodes being interspersed. There are many more files than directories, so most of the i-nodes are for regular files, and a block containing a directory i-node is likely to have few other directory i-nodes. However, directories are accessed more frequently than files, since they are used in path searches for files, so it may improve performance to allocate directory i-nodes near each other so that the i-node for a directory is more likely to be in a block in the block cache. You must also conduct some research to determine the actual numbers in a real system, and devise tests to determine what is happening. First, on your unmodified Minix system, determine the number of directories and the number of ordinary files. Report these. Then select another system with at least 2000 files and repeat. Second, modify Minix to record the number of times a directory is opened vs. the number of times an ordinary file is opened (this may be done in the path search process using static variables). Provide a way to read and to reset these two values (number of directory opens and number of ordinary file opens). Third, in your Minix3 system, walk through the inode table and determine which inodes hold directories and which hold ordinary files, and for a block size of 4KB, what the distribution of number of directory i-nodes per block is. Fourth, modify the block cache system to record the number of hits and the number of misses for directories and for ordinary files (4 variables). Provide a means to read and to reset these values. In the modified system, create a directory with a copy of the rest of the file system under it (be careful NOT to try to copy the directory that you are populating!). It is OK to make empty files for all the ordinary files, but you must replicate the directory structure. Repeat step 3 and record. We will provide a program that randomly opens files and directories from a starting directory. Run this program on the original file system and record the block cache hit and miss values for files and for directories and for ordinary files. Then run it on the subtree created using the modified i-node allocation mechanism, and record the results. Include all results and discussion in your report. Deliverables: You will 1) Submit modified code, including makefiles if necessary 2) Demonstrate and explain the modified system to a TA or grader 3) Submit a project report describing your changes, reflecting on what you learned, and documenting the way you tested the modified system. Report MUST be in PDF format; other formats will result in deduction of points. 4) Submit any programs/scripts used to test your modified system Submit modified code and report on Sakai as a tarfile or the equivalent. Comments in the code itself (1) are required as well as explanation to the TA (2) and in the report (3). Code comments MUST include the following line above every modified code block; failure to do so will result in point deductions. /* PROJECT 3 MODIFICATION */ This allows the grader to find modification easily. Modified code (1) includes exactly the Minix3 source files you modified (i.e., all of them and none you did not modify), as well as any modified makefiles. You will explain how the programs/scripts (4) allow you to test your changes, and will include this in the report (3). Use tar(1) to create a tarfile with the required files to submit, and upload this on Sakai. The TAs will provide a Doodle poll for you to sign up for a demonstration slot - the location will be CSE-309 unless otherwise noted. Be there early for your demo. Documentation: In addition to the modified source code and makefile(s), you will provide the following documents: 1) Experiment Report (in PDF format) - this document will explain the experiments and results, and will discuss your findings. 2) Project Report (in PDF format) - this document will explain how you modified the existing code base to produce the required changes, including what changes were made to which files and why each change was made. Files will first be referenced by their full path names, but local names may be used after that providing they are not ambiguous. It will include description of how testing was performed along with any known bugs. The report will also include a section reflecting on what you learned from this project, what challenged you the most, and how you dealt with the challenge(s). Note that the report is not intended to be more than a few pages long, and it can include pictures/screen captures/etc. as appropriate. The key is to convey how this part of the system works and how you modified it to work differently. There are many free converters that can produce PDF documents from various other formats - if you can't produce PDF with the applications you have, then use one of these web-based converters. Submission: You will tar all modified source code files from Minix3, along with the documentation, new source code files for the program and its makefile, using the tar facility. The tarball will unpack in the current directory. Demonstration: You will sign up to demonstrate your code the the TA online in a doodle poll provided via announcement later. You will have 10 minutes to demo and to answer questions, so be prepared by bringing your laptop with the demonstration ready. Do not be late for your demo. Missed demo appointments will deduct 5 points from your score for each missed appointment (defined as 5 or more minutes late). Helpful resources: The Minix3.org website has many helpful documents, and we will add documents to the class website of a more specific nature.