sudo insmod ./hw10fs.ko sudo mount -t hw10fs -o loop test.img mntThe test.img file is identical to the previous test.img, with the exception of a large amount of empty space appended to it, where you should store the contents of new files. turn-in directions: put all your code in the file hw10fs.c. HINT: check your logs in a separate window, using
tail -f var/log/messages
. You will be docked points for kernel warning messages appearing in this file (not your debug output).
touch mnt/mynewfile ls -l mntyou should now see "mynewfile" appear in the listing, with a size of zero. hint: you'll need to add a file pointer to your inode_operations struct.
sync_dirty_buffer
to write this out to disk in an easy way. Double-check your updated disk image with hexdump -C test.img | less
echo my test > mnt/testfile ls -l mnt cat mnt/testfilethe
ls -l
should show the new file with size 8, and the cat
should output "my test".
Make sure that your written output survives an unmount/mount.
hint: you'll need to add several function pointers to your address_space_operations and file_operations. Look at the fat
implementation to get some ideas.
cat hw10fs.c > mnt/testfile
to try with a large file.
Copyright 2016 The Board of Trustees of the University of Illinois.webmaster@cs.uic.edu |
WISEST Helping Women Faculty Advance Funded by NSF | ![]() | ![]() |