X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=doc%2Fuserprog.texi;h=72e8d8177a07b4641b3762e275b6e71e740b0a40;hb=518557d2cc0935612575d808b7d1e6ffda1a596e;hp=78ef78d8bfc8d9ba3e41a5b67407f7a1390e01e7;hpb=5669c5eba155f6a0f8ca45cdc4aa8d4412036f13;p=pintos-anon diff --git a/doc/userprog.texi b/doc/userprog.texi index 78ef78d..72e8d81 100644 --- a/doc/userprog.texi +++ b/doc/userprog.texi @@ -125,7 +125,48 @@ interfaces to understand how to use the file system, and especially its many limitations. @strong{You should not modify the file system code for this project}. Proper use of the file system routines now will make life much easier for project 4, when you improve the file -system implementation. +system implementation. Until then, you will have to put up with the +following limitations: + +@itemize @bullet +@item +No synchronization. Concurrent accesses will interfere with one +another, so external synchronization is needed. @xref{Synchronizing +File Access}, for more details. + +@item +File size is fixed at creation time. Because the root directory is +represented as a file, the number of files that may be created is also +limited. + +@item +File data is allocated as a single extent, that is, data in a single +file must occupy a contiguous range of sectors on disk. External +fragmentation can therefore become a serious problem as a file system is +used over time. + +@item +No subdirectories. + +@item +File names are limited to 14 characters. + +@item +A system crash mid-operation may corrupt the disk in a way +that cannot be repaired automatically. No `fsck' tool is +provided in any case. +@end itemize + +However one important feature is included: + +@itemize @bullet +@item +Unix-like semantics for filesys_remove() are implemented. +That is, if a file is open when it is removed, its blocks +are not deallocated and it may still be accessed by the +threads that have it open until the last one closes it. @xref{Removing +an Open File}, for more information. +@end itemize You need to be able to create and format simulated disks. The @command{pintos} program provides this functionality with its @@ -456,6 +497,7 @@ on the user's stack in the user's virtual address space. We recommend writing and testing this code before implementing any other system call functionality. +@anchor{Synchronizing File Access} You must make sure that system calls are properly synchronized so that any number of user processes can make them at once. In particular, it is not safe to call into the filesystem code provided in the @@ -507,14 +549,22 @@ Here are the most common causes: The disk hasn't yet been formatted (with @samp{pintos run -f}). @item -The filename specified is too long. The file system limits file names +The file name specified is too long. The file system limits file names to 14 characters. If you're using a command like @samp{pintos put ../../tests/userprog/echo}, that overflows the limit. Use @samp{pintos put ../../tests/userprog/echo echo} to put the file under the name @file{echo} instead. @item -The file is too big. The file system has a 63 kB limit. +The file system is full. + +@item +The file system already contains 10 files. (There's a 10-file limit for +the base Pintos file system.) + +@item +The file system is so fragmented that there's not enough contiguous +space for your file. @end itemize @item