Frequently Asked Questions for Lab 4
Sample Input file
The layout of your 128 KB disk is as follows
char name[8]; //file name int size; // file size (in number of blocks) int blockPointers[8]; // direct block pointers int used; // 0 => inode is free; 1 => in use
Note that each inode is 48 bytes in size; Since you have 16 of these, the total size of occupied by the inodes is 768 bytes. The free/used block information (mentioned above) is 128 byes. So the total space used in the super block is 896 bytes. The remaining bytes are unused.
You need to implement the following operations for your file system.
/courses/cs300/cs377/cs377/lab4/create_fs disk0
This will create a file with the name
disk0in your current directory. The program also "formats" your file system---this is done by initializing all blocks in the super block to be free and marking all 16 inodes to be free.
If you work on this assignment on your home PC, you can find the source code for the create_fs program here . The program should compile on any UNIX platform (use the command gcc create_fs.c -o create_fs). It is your responsibility to port it to a windows platform is you use a Windows PC.
You program should take input from a input file and perform actions specified in the file, while printing out the result of each action. The format of the input file is as follows.
diskName // name of the file that emulates the disk C fileName Size //create a file of this size D fileNAme // delete this file L // list all files on disk and their sizes R fileName blockNum // read this block from this file W fileName blockNum // write to this block in the file (use a dummy 1KB buffer)An sample input file looks like this:
disk0 C file1 3 W file1 0 W file1 1 C lab.java 7 L C file2 4 R file1 1 D lab.java LA sample input file is available. Be sure to print out what your program does after reading each line from this file. It'd also be helpful if you printed out the disk addresses of any block that you allocate, deallocate, read or write.
10 percent of your lab grade will come from your participation in this project as a member of your two person group.
What you need to turn in (each person individually):
Turn in a hard copy of your assessment of the division of labor in the group in the format shown below. If you give yourself a 50% and your partner gives you a 50%, you will get the whole 10 points. If you give your partner a 40% and your partner gives himself or herself a 40%, he or she will get 8 points. And so on...