Friday, April 29, 10pm. Pre-submission due on Tuesday, April 19, 10pm. See Deliverables.
See Assignment 11 on Canvas for the Github Classroom link.
This is a pair assignment, but you can work alone, if you so choose.
Submit the contents of your repository via Gradescope. See Deliverables below for what to submit. If you are working with a partner, do not forget to include their name with the submission.
There will be no autograder for this assignment ahead of the deadline. Read the requirements and run tests locally.
Note: Clone and start studying the starter code as soon as possible. This assignment will likely require more programming effort than previous assignments.
In this assignment you will build a FUSE filesystem driver that will let you mount a 1MB disk image (data file) as a filesystem.
For this assignment you will need to use your local Ubuntu VM (or another local modern Linux). You’ll need to install the following packages:
libfuse-dev
libbsd-dev
pkg-config
Running
$ sudo apt-get install libfuse-dev libbsd-dev pkg-config
should do the trick.
Make sure your working directory is a proper Linux filesystem, not a
remote-mounted Windows or Mac directory, i.e., do not use
/vagrant
.
After completing this step, go to Pre-submission and submit the repository as requested.
You should extend the provided starter code so that it lets you do the following:
You will need to extend the functionality in nufs.c
,
which only provides a simulated filesystem to begin with. This will
require that you come up with a structure for how the file system will
store data in it’s 1MB “disk”. See the filesystem
slides and OSTEP,
Chapter 40 for inspiration.
We have provided some helper code in the helpers/
directory. You can use it if you want, but you don’t have to. However,
blocks.{c,h}
and bitmap.{c,h}
might save you
some time as these implement block manipulation over a binary disk
image. Feel free to extend the functionality if needed.
Some additional headers that might be useful are provided in the
hints
directory. These are just some data definitions and
function prototypes to serve as an inspiration. Again, feel free to
implement your own structs and abstractions.
In this step, implement support for arbitrarily nested directories. The filesystem should support the following operations on directories:
mkdir
)rename
)readdir
)rmdir
)Extend the filesystem to support files larger than 4K. The files must fit into the free blocks on disk. This must include proper allocation and deallocation as the file grows or shrinks. You should be able to support files with size of at least 40K.
After doing Step 1, that is, after cloning the repository and installing FUSE,
Execute the command
$ pkg-config --modversion fuse &> fuse_version
Commit the file fuse_version
to your repo
Submit your repository to Gradescope under Assignment 11: Pre-submission
Modify the starter code to implement the requested functionality.
Commit the code to your repository. Do not include any executables,
.o
files, or other binary, temporary, or hidden files
(unless they were part of the starter code). Do not include any disk
images.
Once you are done, remember to submit your solution to Gradescope and do not forget to include your partner.
The provided Makefile should simplify your development cycle. It provides the following targets:
make nufs
- compile the nufs
binary.
This binary can be run manually as follows:
$ ./nufs [FUSE_OPTIONS] mount_point disk_image
make mount
- mount a filesystem (using
data.nufs
as the image) under mnt/
in the
current directory
make unmount
- unmount the filesystem
make test
- run some tests on your implementation.
This is a subset of tests we will run on your submission. It should give
you an idea whether you are on the right path.
make gdb
- same as make mount
, but run
the filesystem in GDB for debugging
make clean
- remove executables and object files, as
well as test logs and the data.nufs
.
The grade is broken down into three categories:
/usr/include/fuse/fuse.h
hello.c
.make mount
) in one terminal
window and try file system operations on the mounted filesystem in
another separate terminal window.-ENOENT
). Some things don’t
work if you don’t return the right error codes.getattr
early and make sure it’s
correct. Nothing works without getattr
. The modes for the
root directory and hello.txt
in the starter code are good
default values for directories and files respectively.dirname
and basename
exist,
but may mutate their argument.