Updated to use Bochs 2.6.11
[pintos-anon] / doc / vm.tmpl
index 85e9d837967bcd8e7f382e48a354acce3d10009e..9e6a9a56a36cdebdb7430548da219303812f19e0 100644 (file)
@@ -1,8 +1,8 @@
-                           +---------------------------+
-                   |           CS 140          |
-                   | PROJECT 3: VIRTUAL MEMORY |
-                   |      DESIGN DOCUMENT      |
-                   +---------------------------+
+            +---------------------------+
+            |          CS 140          |
+            | PROJECT 3: VIRTUAL MEMORY |
+            |      DESIGN DOCUMENT      |
+            +---------------------------+
 
 ---- GROUP ----
 
 
 ---- GROUP ----
 
@@ -19,116 +19,119 @@ FirstName LastName <email@domain.example>
 
 >> Please cite any offline or online sources you consulted while
 >> preparing your submission, other than the Pintos documentation, course
 
 >> Please cite any offline or online sources you consulted while
 >> preparing your submission, other than the Pintos documentation, course
->> text, and lecture notes.
+>> text, lecture notes, and course staff.
 
 
-                       PAGE TABLE MANAGEMENT
-                       =====================
+            PAGE TABLE MANAGEMENT
+            =====================
 
 ---- DATA STRUCTURES ----
 
 
 ---- DATA STRUCTURES ----
 
->> Copy here the declaration of each new or changed `struct' or `struct'
->> member, global or static variable, `typedef', or enumeration.
->> Identify the purpose of each in 25 words or less.
+>> A1: Copy here the declaration of each new or changed `struct' or
+>> `struct' member, global or static variable, `typedef', or
+>> enumeration.  Identify the purpose of each in 25 words or less.
 
 ---- ALGORITHMS ----
 
 
 ---- ALGORITHMS ----
 
->> Describe your code for locating the physical page, if any, that
->> contains the data of a given virtual page.
+>> A2: In a few paragraphs, describe your code for accessing the data
+>> stored in the SPT about a given page.
 
 
->> How does your code coordinate accessed and dirty bits between kernel
->> and user virtual addresses that alias a single physical page, or
+>> A3: How does your code coordinate accessed and dirty bits between
+>> kernel and user virtual addresses that alias a single frame, or
 >> alternatively how do you avoid the issue?
 
 ---- SYNCHRONIZATION ----
 
 >> alternatively how do you avoid the issue?
 
 ---- SYNCHRONIZATION ----
 
->> When two user processes both need a new page frame at the same time,
+>> A4: When two user processes both need a new frame at the same time,
 >> how are races avoided?
 
 ---- RATIONALE ----
 
 >> how are races avoided?
 
 ---- RATIONALE ----
 
->> Why did you choose the data structure(s) that you did for representing
->> virtual-to-physical mappings?
+>> A5: Why did you choose the data structure(s) that you did for
+>> representing virtual-to-physical mappings?
 
 
-                      PAGING TO AND FROM DISK
-                      =======================
+               PAGING TO AND FROM DISK
+               =======================
 
 ---- DATA STRUCTURES ----
 
 
 ---- DATA STRUCTURES ----
 
->> Copy here the declaration of each new or changed `struct' or `struct'
->> member, global or static variable, `typedef', or enumeration.
->> Identify the purpose of each in 25 words or less.
+>> B1: Copy here the declaration of each new or changed `struct' or
+>> `struct' member, global or static variable, `typedef', or
+>> enumeration.  Identify the purpose of each in 25 words or less.
 
 ---- ALGORITHMS ----
 
 
 ---- ALGORITHMS ----
 
->> When a physical page frame is required but none is free, some page
->> frame must be evicted.  Describe your code for choosing a frame to
->> evict.
+>> B2: When a frame is required but none is free, some frame must be
+>> evicted.  Describe your code for choosing a frame to evict.
 
 
->> When a process P obtains a physical frame that was previously used
->> by a process Q, how do you adjust the page table (and any other
->> data structures) to reflect the physical frame Q no longer has?
+>> B3: When a process P obtains a frame that was previously used by a
+>> process Q, how do you adjust the page table (and any other data
+>> structures) to reflect the frame Q no longer has?
 
 
->> Explain your heuristic for deciding whether a page fault for an
->> invalid virtual address should cause the stack to be extended into the
->> page that faulted.
+>> B4: Explain your heuristic for deciding whether a page fault for an
+>> invalid virtual address should cause the stack to be extended into
+>> the page that faulted.
 
 ---- SYNCHRONIZATION ----
 
 
 ---- SYNCHRONIZATION ----
 
->> Explain the basics of your VM synchronization design.  In particular,
->> explain how it prevents deadlock.  (Refer to the textbook for an
->> explanation of the necessary conditions for deadlock.)
-
->> A page fault in process P can cause another process Q's page frame to
->> be evicted.  How do you ensure that Q cannot access or modify the page
->> during the eviction process?  How do you avoid a race between P
->> evicting Q's page frame and Q faulting the page back in?
-
->> Suppose a page fault in process P causes a page to be read from disk.
->> How do you ensure that a second process Q cannot interfere by e.g.
->> attempting to evict the page while it is still being read in?
-
->> Explain how you handle access to paged-out pages that occur during
->> system calls.  Do you use page faults to bring in pages (as in user
->> programs), or do you have a mechanism for "locking" pages into
->> physical memory, or do you use some other design?  How do you
+>> B5: Explain the basics of your VM synchronization design.  In
+>> particular, explain how it prevents deadlock.  (Refer to the
+>> textbook for an explanation of the necessary conditions for
+>> deadlock.)
+
+>> B6: A page fault in process P can cause another process Q's frame
+>> to be evicted.  How do you ensure that Q cannot access or modify
+>> the page during the eviction process?  How do you avoid a race
+>> between P evicting Q's frame and Q faulting the page back in?
+
+>> B7: Suppose a page fault in process P causes a page to be read from
+>> the file system or swap.  How do you ensure that a second process Q
+>> cannot interfere by e.g. attempting to evict the frame while it is
+>> still being read in?
+
+>> B8: Explain how you handle access to paged-out pages that occur
+>> during system calls.  Do you use page faults to bring in pages (as
+>> in user programs), or do you have a mechanism for "locking" frames
+>> into physical memory, or do you use some other design?  How do you
 >> gracefully handle attempted accesses to invalid virtual addresses?
 
 ---- RATIONALE ----
 
 >> gracefully handle attempted accesses to invalid virtual addresses?
 
 ---- RATIONALE ----
 
->> A single lock for the whole VM system would make synchronization easy,
->> but limit parallelism.  On the other hand, using many locks
->> complicates synchronization and raises the possibility for deadlock
->> but allows for high parallelism.  Explain where your design falls
->> along this continuum and why you chose to design it this way.
+>> B9: A single lock for the whole VM system would make
+>> synchronization easy, but limit parallelism.  On the other hand,
+>> using many locks complicates synchronization and raises the
+>> possibility for deadlock but allows for high parallelism.  Explain
+>> where your design falls along this continuum and why you chose to
+>> design it this way.
 
 
-                        MEMORY MAPPED FILES
-                        ===================
+             MEMORY MAPPED FILES
+             ===================
 
 ---- DATA STRUCTURES ----
 
 
 ---- DATA STRUCTURES ----
 
->> Copy here the declaration of each new or changed `struct' or `struct'
->> member, global or static variable, `typedef', or enumeration.
->> Identify the purpose of each in 25 words or less.
+>> C1: Copy here the declaration of each new or changed `struct' or
+>> `struct' member, global or static variable, `typedef', or
+>> enumeration.  Identify the purpose of each in 25 words or less.
 
 ---- ALGORITHMS ----
 
 
 ---- ALGORITHMS ----
 
->> Describe how memory mapped files integrate into your virtual memory
->> subsystem.  Explain how the page fault and eviction processes differ
->> for swap pages and other pages.
+>> C2: Describe how memory mapped files integrate into your virtual
+>> memory subsystem.  Explain how the page fault and eviction
+>> processes differ between swap pages and other pages.
 
 
->> Explain how you determine whether a new file mapping overlaps any
->> existing segment.
+>> C3: Explain how you determine whether a new file mapping overlaps
+>> any existing segment.
 
 ---- RATIONALE ----
 
 
 ---- RATIONALE ----
 
->> Mappings created with "mmap" have similar semantics to those of data
->> demand-paged from executables, except that "mmap" mappings are written
->> back to their original files, not to swap.  This implies that much of
->> their implementation can be shared.  Explain why your implementation
->> either does or does not share much of the code for the two situations.
+>> C4: Mappings created with "mmap" have similar semantics to those of
+>> data demand-paged from executables, except that "mmap" mappings are
+>> written back to their original files, not to swap.  This implies
+>> that much of their implementation can be shared.  Explain why your
+>> implementation either does or does not share much of the code for
+>> the two situations.
 
 
-                          SURVEY QUESTIONS
-                          ================
+               SURVEY QUESTIONS
+               ================
 
 Answering these questions is optional, but it will help us improve the
 course in future quarters.  Feel free to tell us anything you
 
 Answering these questions is optional, but it will help us improve the
 course in future quarters.  Feel free to tell us anything you