1 / 15

CS 5600 Computer Systems

CS 5600 Computer Systems. Project 4: File System in Pintos. File System in Pintos. Pintos already implements a basic file system Can create fixed size files in a single root directory But this system has limitations No support for nested directories No support for files that grow in size

scudder
Télécharger la présentation

CS 5600 Computer Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 5600Computer Systems Project 4: File System in Pintos

  2. File System in Pintos • Pintos already implements a basic file system • Can create fixed size files in a single root directory • But this system has limitations • No support for nested directories • No support for files that grow in size • No caching or preemptive reading

  3. Your Goals • Implement indexed files • Files should begin life as a single sector and grow dynamically as necessary • Processes should be able to seek and write past the end of a file • Requires heavily modifying Pintos’ inodes • Implement nested directories • You will need to implement new system calls to manipulate directories • chdir(), mkdir(), readdir(), isdir() • Inode management: inumber()  get the inode of a file or directory

  4. Your Goals (cont.) • Implement a buffer cache • Up to 64 sectors of disk data should be buffered in RAM • Implement a write-back cache • Cache must be periodically flushed to disk • How to handle eviction? • Carefully synchronize file operations • Accesses to independent files/directories should not block each other • Concurrent reading/writing of a single file needs to be handled carefully

  5. What Pintos Does For You • Basic disk management • Read/write access to sectors • Basic management of free space • You’ve already implemented file descriptors and most of the file system API ;)

  6. Inodes in Pintos • filesys/inode.c /* On-disk inode. Must be exactly BLOCK_SECTOR_SIZE bytes long. */ structinode_disk { block_sector_t start; /* First data sector. */ off_t length; /* File size in bytes. */ unsigned magic; /* Magic number. */ uint32_t unused[125]; /* Not used. */ };

  7. Directories in Pintos • filesys/directory.c • Implements a single root directory • i.e. no subdirectories • Must be overhauled to allow a directory to contain other directories • e.g. subdirectories

  8. Key Challenges • Choosing the right data structures • How do you encode directory and file information on disk? • How do you keep track of the locations of dynamically allocated file blocks • Properly managing your cache • Implementing performant cache eviction is tricky • Write-back cache must be periodically flushed • Implementing correct and performant synchronization

  9. More Key Challenges • Each process needs to have an associated working directory • Necessary for resolving relative file accesses • E.g. open(“../file.txt”) or open(“./my_thing”) • Used by the pwdprogram

  10. Modified Files • filesys/Make.vars 6 • filesys/cache.c 473 # new file! • filesys/cache.h23 # new file! • filesys/directory.c99 • filesys/directory.h3 • filesys/file.c4 • filesys/filesys.c194 • filesys/filesys.h5 • filesys/free-map.c 45 • filesys/free-map.h4 • filesys/fsutil.c8 • filesys/inode.c444 • filesys/inode.h11 • userprog/process.c 12 • userprog/syscall.c 37 • 15+ files changed, 1368 insertions(+), 286 deletions(-)

  11. This Project Is the Biggest • The reference solution for Project 4 includes way more lines of code than any other project thus far Start early!

  12. Extra Credit! • Project 4 can built on top of Project 2 or Project 3 • If you build on top of Project 3, you get 2 extra credit points! • This requires having a rock-solid VM implementation

  13. Grading • 15 (+2) points total • To receive full credit: • Turn in working, well documented code that compiles successfully and completes all tests (50%) • Turn in a complete, well thought our design document (50%) • If your code doesn’t compile or doesn’t run, you get zero credit • Must run on the CCIS Linux machines! • All code will be scanned by plagiarism detection software

  14. Turning In Your Project • Register yourself for the grading system $ /course/cs5600f14/bin/register-student[NUID] • Register your group • All group members must run the script! $ /course/cs5600f14/bin/register project4 [team name] • Run the turn-in script • Two parameters: project name and code directory $ /course/cs5600f14/bin/turnin project4 ~/pintos/src/

  15. DUE: December 3 11:59:59PM EST Questions?

More Related