CS 33211 Operating Systems Project #3 Due via subversion by 11:59 on Tuesday, November 27th IMPLEMENTING INDEXED FILE SYSTEM Write a program that implements a rudimentary 2-level indexed file system. Your program should create a file named DISK and simulate disk operations on this file. The disk blocks are to be exactly 10 bytes. The disk has a single track (all blocks are stored sequentially). The track size is 100 blocks. In communication with the disk you should use random access read and write functions. In Linux, check the corresponding man-pages for their operation. man -S 3p write Specifically, you should consider operations pread()/pwrite() and lseek(). In Windows, use fread()/frite()/fseek() Also, use open()/close() functions for opening/closing the file The only allowed block size that you can read from or write to the disk is 10 bytes. Your filesystem is to have a single unnamed file. Its i-node will be stored in the first block of the disk. The i-node has two types of information. In the first byte - file size is stored. The remaining bytes are used to store references (block numbers) to the blocks where file data is stored. Use byte-size integers to store block numbers. Notice that the i-node can store 9 references. The first 7 references are directly to the data blocks. The 8-th reference is to the single indirect index block. This index block should contain additional 10 references to data blocks. The last 9-th reference is to the double indirect index block. This block contains references to the blocks that, in turn, contain references to data blocks. If the block is not allocated it should contain 0. Notice that a block can be partially filled and the program should use the file size to determine where the file data ends. Your program should be able to accept information from the standard input and write it to the simulated file. Assume that all the information is alphanumberic. The input is accepted until keyword ENDFILE is entered. All the information should be written to the file except the keyword ENDFILE. The program should gracefully handle files that are too large to fit in the disk (print an error message and quit). After writing the file your program should read the file data back and print it to the standard output. You are not allowed to store the data in your program memory between writing to the disk and reading it back. Submitting Your Project and Grading The programming project is worth 50 points. Late projects are accepted. Late policies are outlined in the syllabus. The grading will be such that the working program submitted a few days late will receive a higher grade that the program that does not work but is submitted. If your program still does not work, submit a text file specifying how the program fails (does not compile, fails test examples, etc.), what you think the reason is and how it can be fixed. You may be given partial credit.