Tips for NACHOS Assignment 3

Implementing Demand Paged Virtual Memory

Assignment 3 is to be done inside of the directory code/vm (that is where the code is compiled). There is no new source provided by Nachos for this assignment. It makes use of the source in code/threads and code/userprog (some of which you'll modify for this assignment).

This is again one of those assignments where you are better off implementing little pieces at a time. If you find that you will not be able to do all parts of the assignment be sure to come up with a design and explain why you've chosen that design. It will also help if you can describe what you expect will be the difficulties in implementing your design and how you would test it.

Don't forget that one of the group members could always be thinking about and devising/writing good tests for each portion (or phase of implementation) of the assignment.

A Possible Strategy

Before you Start

Read all of this document first. I've suggested a step by step approach. Each step builds on the previous step and you should be aware of this when working on the earlier steps. For example, when you choose a page-out policy for paging out when one program is running, remember that later on you will want to page out pages from multiple programs and that maybe you'd like to have a different policy from the one used when only one program was executing.

Have a look at the the Nachos Roadmap document. In particular the section on tips for implementing virtual memory:

A Special Tip on Improving the File System Simulation

You are not required to do this but it may help to ensure that you don't encounter any nasty bugs in your implementation when moving to assignment 4.

Getting Started

You may wish to start by turning off time-slicing so that you have stricter control and a better under standing over what is running and when. Remember to turn it back on later.

Start off with a small portion of the assigned problem. Come up with a clear design. Implement it. Debug it. Test it. The tests should clearly demonstrate that what you've implemented works (or when it doesn't).

Paging in and running one small program

Paging in and running a few small programs

Paging in and out one large program

Paging in and out a few large programs

Paging in and out several large programs

Things to Remember (Gotcha's)


Modified: Nov 5, 1995 Created: Nov 5, 1995