Lab 3 - A Simple File Manager
COP4610/CGS5765, Introduction to Operating Systems, Fall 2003
Department of Computer Science, Florida State University
Points: 100 points.
Due: Week 15, December 3, 2003 at the demonstration time (Note:
NOT late submission will be accepted for this project. See below).
Maximum team size: Two (2).
Purpose
Design and implement a simple file manager.
Programming assignment
Implement the API functions given in Part A and Part B
on pages 561--567 in the textbook with the following exceptions: Your program
must be able to handle files upto 10,000 bytes with
a total of 4,000,000 bytes of virtual disk space
(by changing BLOCK_SIZE and NUM_BLOCK)
and the reliability
is assumed to 1.0 (In other words,
comment out the statement "if rand() > threshold) return ERROR;" on page
566).
Then using the API functions and other system calls,
write an interactive shell program (based on your lab 1), which supports
the following additional internal commands:
- mycopyto myfile realfile
mycopyfrom realfile myfile
These two commands will copy a file from your file system
to the real system or copy a file in the real system
to your file system.
Here "myfile" is the file name in your file system and
"realfile" is the file name in the real system.
- mycat myfile
This shows the file on your file system to the standard output.
- myls
It lists all the files with the attributes (such as size and types (a file or
a subdirectory))
under your current working
directory in your file system.
- mycd1
It changes the current working directory of your file system.
- mypwd1
It shows the current working directory of your file system.
- myseek myfile pos
It shows the value of the byte at the position given by pos
in file given by myfile in your file system. You must use
fSeek to implement this.
Submission
The submission procedure for this lab is different from the previous ones.
You need to submit the following items in hardcopy
at the demonstration time on the due date.
Each group only needs to submit one report.
Special note on late submission:
As this lab is due in the last week of classes, which can be
a very busy period for you. To give you time to prepare for your
final exams, late submission of this lab will NOT be accepted
unless medical and other serious conditions prevent you from
finishing this assignment on or before the given due date.
- Report - You should turn in a report explaining how you
have implemented your simple file system, especially
the layout of your file system and the data
structures used by your file manager.
- Running results -
You need to include your running results from your test cases.
You need to design your test cases carefully to convincingly demonstrate
that you have implemented the API functions and internal commands correctly.
- Source code - You need to attach all the source programs
you have developed
for this lab. You need to make sure that the copy you turned in is
exactly the same as the one you compiled and generated your results
and the one that will be used for demonstration.
ANY INCONSISTENCY IN THESE PROGRAMS WILL BE TREATED AS CHEATING.
Extra credit
Please state clearly in your report if you
have achieved the following requirement for extra credits:
- Transparent File System
In the basic requirements, the end user is aware of
the existence of two file systems: your virtual file system and
the file system on the host machine.
Here you need to provide transpariencies for end users.
To do this, assuming that
the root of your file system corresponds to /virtual
on the host file system (In other words, as if your file system was
mounted at /virtual),
rewrite the following internal commands
- mycopyto
- mycat
- myls
- mypwd1
- mycd1
- myseek
so that they will work properly regardless whether the file specified is
either a file on your system
(starting with /virtual or other files on the host system).
In other words, the end user does not need to know the difference
between your virtual file system and the real file system on the host machine.
Grading
- Report -- 20 points.
It must include file system layout and
data structures used.
- Correct execution -- 80 points.
You have to design your test cases so that you can convince the TA,
the public (others in this class) and the instructor that you have implemented
all the API functions and the commands correctly.
Standard test cases will NOT be provided.
- Penalty for failing to implement each of the API functions correctly
or failing to convince so is 15
points.
- Penalty for failing to implement each of the internal commands specified
in this assignment
or failing to convince so is 10 points.
- Penalty for failing to finish (such as segmentation fault) is 20 points
for each occurrence.
- Transparent File System -- 15 points.
Demonstration
On December 3, 2003 during your recitation session,
you/your group need to demonstrate
your program in class. At the demonstration time, you need to turn in your
report first (with source code and results attached) and then you
run your program before class.
Everyone including the TA, others in the class,
and the instructor is allowed to ask questions.
You need to demonstrate your file manager program on machine "program".