-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
* 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
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
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
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
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
``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
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
-@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
-@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
-@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.
* 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.
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
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
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
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
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
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
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
@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
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
* 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
@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
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
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
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
@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
@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
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
* 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
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
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
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
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
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
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.
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.
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