Project 5 Grading Criteria

  1. File Operations using pcinqtest.c

    pcinqtest.c tests the following functionality.

    Functionality Behavior Weightage
    Format formats the IDE drive 1 to support GOSFS 3
    Mount mounts IDE drive 1 to /d 1
    Open-Inexistent file Tries to open an inexsitent file. Open should return -1 if file does not exist 2
    Creat Opens and Closes a new file. File descriptor returned by Open and return value of Close should be non-negative 3
    Creat-Long Filename Opens and Closes a file with a long name (~33 bytes). File descriptor returned by OPen and return value of Close should be non-negative 3
    Creat-Inexistent Path Tries to Open a non-existent path in a non-existent directory. Open must return -1 in this case 3
    Basic Read/Write Opens a file, Writes to it, Close it and then Openss it again, Reads from the file and finally Closes the file. Return values of successful Read and Writes should be non-negative 5
    Read from WriteOnly Creates and writes to a file and then attempts to Read in a file Opened with only O_WRITE set. Read must return -1 if file is opened in write only mode. 3
    Write to ReadOnly Creates and writes to a file and then attempts to Write in a file Opened with only O_READ set. Write must return -1 if file is opened in read only mode. 3
    Close Twice Opens a file, Closes it and then calls Close on the same file again. The final Close should return -1 in this case 3
    Close Illegal FD Calls Close on an invalid file descriptor. In this case, Close should return -1 2
    Basic Delete Creates a file and calls Delete on it. A successful Delete should return a non-negative number. 3
    Delete-Inexistent File Attempts to Delete a non-existent file. Delete on non-existent files must return -1 2
    Basic Create Directory Creates a single directory ("/d/dir1d"). Upon success, the return value of CreateDirectory should be non-negative 3
    Recursively Create Directory Creates nested directories ("/d/dir2d/dir3d"). Both directories should be created and return value for CreateDirectory must be non-negative. 5
    Create File in Recursively Created Directory Opens and Closes a file in the last directory created above. File descriptor returned by Open must be non-negative 3
    Basic Seek Opens a new file, Writes to it and calls Seek for two locations. Successful Seeks must return a non-negative number 2
    Seek w/ Reread Opens a new file, Writes to it, calls Seek for two locations and checks the data at those locations. 5
    Basic Stat Creates a new file and calls Stat on it. Succeful completion of a Stat call must return a non-negative number 2
    Stat-File Opens a file, Writes some data to it and calls Stat. Return value of Stat should be non-negative and the fileStat structure filled by Stat should have correct size. 2
    Stat-Directory Creates a directory and calls Stat on it. Return value of Stat should be non-negative and the fileStat structure filled by Stat should have the isDirectory field set 2
    Delete Empty Directory Calls CreateDirectory and then tries to Delete the directory created. Successful completion of Delete must return a non-negative value 3
    Delete Non-Empty Directory Calls CreateDirectory, creates a file in this directory and then tries to Delete that directory. Calling Delete on non-empty directories must fail and return -1. 2
    10k Write/Reread Opens a file, Writes 10KB of data into it, Reads back the data and performs data check. 10
    5 MB Write Opens and Writes 5MB of data into a file. This tests the implementation of the double indirect block. Successful Writes should return a non negative number 10
    TOTAL 85


    Executing pcinqtest.c will run through each of these. The ouput will be lines with the functionality listed in the first column, the output (PASSED/FAILED) and the score of the particular test. Correct implementation is worth 85 points.

  2. File Persistence using write.c and cat.c
    At the shell prompt, typing:

     /c/write.exe 
    should output
    Formatting...
    Mounting...
    Mounted file system on drive 1 of type gosfs onto /d
    Writing...
    Wrote file /d/testWrite
    
    Then shutting down bochs, then running it again and typing:

     /c/mount.exe 1 /d gosfs
     /c/cat.exe /d/testWrite 
    should output
    Mounted file system on drive 1 of type gosfs onto /d
    Hello.  If you see this your write works.
    
    Correct implementation is worth 15 points.


    Obviously, when grading, we will use the above programs but change names for files/directories (pcinqtest.c) and test string (write.c/cat.c)

    If you can not get some tests working you have the option of not testing them. With your submission include a TESTING file that says the last test in pcinqtest.exe to run. We will run it up to that point and stop tests. The second test using write.exe/cat.exe will still be performed.


    Updated (04/21)

    We'll test the 5MB read/write by performing a full write and a few random reads. Your write (first half of tFiveMegs()) has to complete in 5 minutes.