From: Ben Pfaff Date: Wed, 15 Sep 2004 01:13:36 +0000 (+0000) Subject: Work on intro. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40140f51bb6c6bf0191145497a5db115083fe3af;hp=142e3b78061fe9df4ff5fd2fe18d5cf1242e178c;p=pintos-anon Work on intro. --- diff --git a/doc/Makefile b/doc/Makefile index f053ce9..f6a7b7d 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,4 +1,4 @@ -TEXIS = projects.texi threads.texi mlfqs.texi userprog.texi \ +TEXIS = projects.texi intro.texi threads.texi mlfqs.texi userprog.texi \ filesys.texi vm.texi all: projects.html projects.info diff --git a/doc/filesys.texi b/doc/filesys.texi index 7652a84..5ffcb75 100644 --- a/doc/filesys.texi +++ b/doc/filesys.texi @@ -55,7 +55,7 @@ and copy that over whenever you trash your disk beyond a useful state * File System FAQs:: @end menu -@node File System New Code, Problem 4-1 Large Files, Project 4--File Systems, Project 4--File Systems +@node File System New Code @section New Code Here are some files that are probably new to you. These are in the @@ -110,7 +110,7 @@ which you will remove. While most of your work will be in @file{filesys}, you should be prepared for interactions with all previous parts (as usual). -@node Problem 4-1 Large Files, Problem 4-2 File Growth, File System New Code, Project 4--File Systems +@node Problem 4-1 Large Files @section Problem 4-1: Large Files Modify the file system to allow the maximum size of a file to be as @@ -123,7 +123,7 @@ size of a file is limited by the number of pointers that will fit in one disk sector. Increasing the limit to 8 MB will require you to implement doubly-indirect blocks. -@node Problem 4-2 File Growth, Problem 4-3 Subdirectories, Problem 4-1 Large Files, Project 4--File Systems +@node Problem 4-2 File Growth @section Problem 4-2: File Growth Implement extensible files. In the basic file system, the file size @@ -136,7 +136,7 @@ the root directory file to expand beyond its current limit of ten files. Make sure that concurrent accesses to the file header remain properly synchronized. -@node Problem 4-3 Subdirectories, Problem 4-4 Buffer Cache, Problem 4-2 File Growth, Project 4--File Systems +@node Problem 4-3 Subdirectories @section Problem 4-3: Subdirectories Implement a hierarchical name space. In the basic file system, all @@ -179,7 +179,7 @@ is straightforward once the above syscalls are implemented. If Unix, these are programs rather than built-in shell commands, but @command{cd} is a shell command. (Why?) -@node Problem 4-4 Buffer Cache, File System Design Document Requirements, Problem 4-3 Subdirectories, Project 4--File Systems +@node Problem 4-4 Buffer Cache @section Problem 4-4: Buffer Cache Modify the file system to keep a cache of file blocks. When a request @@ -235,7 +235,7 @@ making any read-ahead and write-behind threads halt when Pintos is ``done'' (when the user program has completed, etc), so that Pintos will halt normally and print its various statistics. -@node File System Design Document Requirements, File System FAQs, Problem 4-4 Buffer Cache, Project 4--File Systems +@node File System Design Document Requirements @section Design Document Requirements As always, submit a design document file summarizing your design. Be @@ -254,7 +254,7 @@ in the cache? How did you choose elements to evict from the cache? How and when did you flush the cache? @end itemize -@node File System FAQs, , File System Design Document Requirements, Project 4--File Systems +@node File System FAQs @section FAQ @enumerate 1 diff --git a/doc/mlfqs.texi b/doc/mlfqs.texi index 8d7fc4e..90c22f3 100644 --- a/doc/mlfqs.texi +++ b/doc/mlfqs.texi @@ -1,4 +1,4 @@ -@node Multilevel Feedback Scheduling, , , Project 1--Threads +@node Multilevel Feedback Scheduling, , Threads FAQ, Project 1--Threads @section Multilevel Feedback Scheduling This section gives a brief overview of the behavior of the Solaris 2.6 diff --git a/doc/projects.texi b/doc/projects.texi index bc5cd13..4c1465f 100644 --- a/doc/projects.texi +++ b/doc/projects.texi @@ -1,14 +1,18 @@ -@node Top, Project 1--Threads, (dir), (dir) +@node Top, Introduction, (dir), (dir) @top Pintos Projects @menu +* Introduction:: * Project 1--Threads:: * Project 2--User Programs:: * Project 3--Virtual Memory:: * Project 4--File Systems:: @end menu +@include intro.texi @include threads.texi @include userprog.texi @include vm.texi @include filesys.texi +@c @include devel.texi +@c @include standards.texi diff --git a/doc/threads.texi b/doc/threads.texi index 61396b8..7a048e7 100644 --- a/doc/threads.texi +++ b/doc/threads.texi @@ -1,4 +1,4 @@ -@node Project 1--Threads, Project 2--User Programs, Top, Top +@node Project 1--Threads, Project 2--User Programs, Introduction, Top @chapter Project 1: Threads In this assignment, we give you a minimally functional thread system. @@ -19,11 +19,11 @@ side. Compilation should be done in the @file{threads} directory. * Problem 1-2 Join:: * Problem 1-3 Priority Scheduling:: * Problem 1-4 Advanced Scheduler:: -* Threads FAQ:: +* Threads FAQ:: * Multilevel Feedback Scheduling:: @end menu -@node Understanding Threads, Debugging versus Testing, Project 1--Threads, Project 1--Threads +@node Understanding Threads @section Understanding Threads The first step is to read and understand the initial thread system. @@ -82,7 +82,7 @@ in @file{threads/malloc.c}. Note that the page allocator doles out limit. If you need larger chunks, consider using a linked structure instead. -@node Debugging versus Testing, Tips, Understanding Threads, Project 1--Threads +@node Debugging versus Testing @section Debugging versus Testing When you're debugging code, it's useful to be able to be able to run a @@ -121,7 +121,7 @@ execution will still be reproducible, but timer behavior will change as @var{seed} is varied. Thus, for the highest degree of confidence you should test your code with many seed values. -@node Tips, Problem 1-1 Alarm Clock, Debugging versus Testing, Project 1--Threads +@node Tips @section Tips There should be no busy-waiting in any of your solutions to this @@ -156,7 +156,7 @@ would be a good idea to divide up the work among your team members such that you have Problem 3 fully working before you begin to tackle Problem 4. -@node Problem 1-1 Alarm Clock, Problem 1-2 Join, Tips, Project 1--Threads +@node Problem 1-1 Alarm Clock @section Problem 1-2: Alarm Clock Improve the implementation of the timer device defined in @@ -179,7 +179,7 @@ solution should not busy wait. The argument to @code{timer_sleep()} is expressed in timer ticks, not in milliseconds or some other unit. -@node Problem 1-2 Join, Problem 1-3 Priority Scheduling, Problem 1-1 Alarm Clock, Project 1--Threads +@node Problem 1-2 Join @section Problem 1-2: Join Implement @code{thread_join(struct thread *)} in @@ -220,7 +220,7 @@ join works for. Don't overdo the output volume, please! Be careful to program this function correctly. You will need its functionality for project 2. -@node Problem 1-3 Priority Scheduling, Problem 1-4 Advanced Scheduler, Problem 1-2 Join, Project 1--Threads +@node Problem 1-3 Priority Scheduling @section Problem 1-3 Priority Scheduling Implement priority scheduling in Pintos. Priority @@ -262,7 +262,7 @@ for a lock held by a lower-priority thread. You do not need to implement this fix for semaphores, condition variables or joins. However, you do need to implement priority scheduling in all cases. -@node Problem 1-4 Advanced Scheduler, Threads FAQ, Problem 1-3 Priority Scheduling, Project 1--Threads +@node Problem 1-4 Advanced Scheduler @section Problem 1-4 Advanced Scheduler Implement Solaris's multilevel feedback queue scheduler (MLFQS) to @@ -279,7 +279,7 @@ You may assume a static priority for this problem. It is not necessary to ``re-donate'' a thread's priority if it changes (although you are free to do so). -@node Threads FAQ, , Problem 1-4 Advanced Scheduler, Project 1--Threads +@node Threads FAQ, Multilevel Feedback Scheduling, Problem 1-4 Advanced Scheduler, Project 1--Threads @section FAQ @enumerate 1 @@ -288,7 +288,7 @@ free to do so). @enumerate 1 @item @b{I am adding a new @file{.h} or @file{.c} file. How do I fix the -@file{Makefile}s?} +@file{Makefile}s?}@anchor{Adding c or h Files} To add a @file{.c} file, edit the top-level @file{Makefile.build}. You'll want to add your file to variable @samp{@var{dir}_SRC}, where @@ -298,6 +298,14 @@ possibly @code{devices_SRC} if you put in the @file{devices} directory. Then run @code{make}. If your new file doesn't get compiled, run @code{make clean} and then try again. +When you modify the top-level @file{Makefile.build}, the modified +version should be automatically copied to +@file{threads/build/Makefile} when you re-run make. The opposite is +not true, so any changes will be lost the next time you run @code{make +clean} from the @file{threads} directory. Therefore, you should +prefer to edit @file{Makefile.build} (unless your changes are meant to +be truly temporary). + There is no need to edit the @file{Makefile}s to add a @file{.h} file. @item diff --git a/doc/userprog.texi b/doc/userprog.texi index b3f8f4c..5f270e1 100644 --- a/doc/userprog.texi +++ b/doc/userprog.texi @@ -47,7 +47,7 @@ from being run. * System Calls:: @end menu -@node Project 2 Code to Hack, How User Programs Work, Project 2--User Programs, Project 2--User Programs +@node Project 2 Code to Hack @section Code to Hack The easiest way to get an overview of the programming you will be @@ -121,7 +121,7 @@ of the usage of a large array of (identical) resources: if resource @var{n} is in use, then bit @var{n} of the bitmap is true. You might find it useful for tracking memory pages, for example. -@node How User Programs Work, Global Requirements, Project 2 Code to Hack, Project 2--User Programs +@node How User Programs Work @section How User Programs Work Pintos can run normal C programs. In fact, it can run any program you @@ -143,7 +143,7 @@ default, the @file{Makefile} in this directory will compile the test programs we provide. You can edit the @file{Makefile} to compile your own test programs as well. -@node Global Requirements, Problem 2-1 Argument Passing, How User Programs Work, Project 2--User Programs +@node Global Requirements @section Global Requirements For testing and grading purposes, we have some simple requirements for @@ -159,7 +159,7 @@ is already there---you just need to make sure you enable it! For example, running @code{pintos -ex "testprogram 1 2 3 4"} will spawn @samp{testprogram 1 2 3 4} as the first process. -@node Problem 2-1 Argument Passing, Problem 2-2 System Calls, Global Requirements, Project 2--User Programs +@node Problem 2-1 Argument Passing @section Problem 2-1: Argument Passing Currently, @code{thread_execute()} does not support passing arguments @@ -178,7 +178,7 @@ this right, a lot of things will not appear to work correctly with our tests. If the tests fail, so do you. Fortunately, this part shouldn't be too hard. -@node Problem 2-2 System Calls, User Programs FAQ, Problem 2-1 Argument Passing, Project 2--User Programs +@node Problem 2-2 System Calls @section Problem 2-2: System Calls Implement the system call handler in @file{userprog/syscall.c} to @@ -297,7 +297,7 @@ exception is a call to the @code{halt} system call. @xref{System Calls}, for more information on how syscalls work. -@node User Programs FAQ, 80x86 Calling Convention, Problem 2-2 System Calls, Project 2--User Programs +@node User Programs FAQ @section FAQ @enumerate 1 @@ -476,7 +476,7 @@ e.g.@: @samp{example 1 2 3 4: 0}. @end enumerate @end enumerate -@node 80x86 Calling Convention, System Calls, User Programs FAQ, Project 2--User Programs +@node 80x86 Calling Convention @appendixsec 80@var{x}86 Calling Convention What follows is a quick and dirty discussion of the 80@var{x}86 @@ -626,7 +626,7 @@ Your code should start the stack at the very top of the user virtual address space, in the page just below virtual address @code{PHYS_BASE} (defined in @file{threads/mmu.h}). -@node System Calls, , 80x86 Calling Convention, Project 2--User Programs +@node System Calls @appendixsec System Calls We have already been dealing with one way that the operating system diff --git a/doc/vm.texi b/doc/vm.texi index 84b0752..59e88ca 100644 --- a/doc/vm.texi +++ b/doc/vm.texi @@ -34,7 +34,7 @@ so those bugs don't keep haunting you. * Virtual Memory FAQ:: @end menu -@node VM Design, Page Faults, Project 3--Virtual Memory, Project 3--Virtual Memory +@node VM Design @section A Word about Design It is important for you to note that in addition to getting virtual @@ -52,7 +52,7 @@ In keeping with this, you will find that we are going to say as little as possible about how to do things. Instead we will focus on what end functionality we require your OS to support. -@node Page Faults, Disk as Backing Store, VM Design, Project 3--Virtual Memory +@node Page Faults @section Page Faults For the last assignment, whenever a context switch occurred, the new @@ -144,7 +144,7 @@ back in userprog project FIXME need to mention that there are many possible implementations and that the above is just an outline -@node Disk as Backing Store, Memory Mapped Files, Page Faults, Project 3--Virtual Memory +@node Disk as Backing Store @section Disk as Backing Store In VM systems, since memory is less plentiful than disk, you will @@ -170,7 +170,7 @@ page can be brought in. Many virtual memory systems avoid this extra overhead by writing modified pages to disk in advance, so that later page faults can be completed more quickly. -@node Memory Mapped Files, Stack, Disk as Backing Store, Project 3--Virtual Memory +@node Memory Mapped Files @section Memory Mapped Files The traditional way to access the file system is via @code{read} and @@ -196,7 +196,7 @@ file (plus one each for code, data, and stack). You will implement memory mapped files for problem 3 of this assignment, but you should design your solutions to problems 1 and 2 to account for this. -@node Stack, Problem 3-1 Page Table Management, Memory Mapped Files, Project 3--Virtual Memory +@node Stack @section Stack In project 2, the stack was a single page at the top of the user @@ -207,7 +207,7 @@ system should allocate additional pages for the stack as necessary, unless those pages are unavailable because they are in use by another segment, in which case some sort of fault should occur. -@node Problem 3-1 Page Table Management, Problem 3-2 Paging To and From Disk, Stack, Project 3--Virtual Memory +@node Problem 3-1 Page Table Management @section Problem 3-1: Page Table Management Implement page directory and page table management to support virtual @@ -276,7 +276,7 @@ probably want to leave the code that reads the pages from disk, but use your new page table management code to construct the page tables only as page faults occur for them. -@node Problem 3-2 Paging To and From Disk, Problem 3-3 Memory Mapped Files, Problem 3-1 Page Table Management, Project 3--Virtual Memory +@node Problem 3-2 Paging To and From Disk @section Problem 3-2: Paging To and From Disk Implement paging to and from disk. @@ -364,7 +364,7 @@ segments for each process. If you carefully designed your data structures in part 1, sharing of read-only pages should not make this part significantly harder. -@node Problem 3-3 Memory Mapped Files, Virtual Memory FAQ, Problem 3-2 Paging To and From Disk, Project 3--Virtual Memory +@node Problem 3-3 Memory Mapped Files @section Problem 3-3: Memory Mapped Files Implement memory mapped files. @@ -402,7 +402,7 @@ the changes to the @code{mmap} segment will eventually be written to the file. (In fact, you may choose to implement executable mappings as a special case of file mappings.) -@node Virtual Memory FAQ, , Problem 3-3 Memory Mapped Files, Project 3--Virtual Memory +@node Virtual Memory FAQ @section FAQ @enumerate 1