Nachos is a Java application written to perform the functions of a real operating system. All the details of how the operating system implements concepts such as threading, virtual memory, and processes are exposed to you. All the source code implementing the Nachos operating system is included with the distribution. However, this distribution is incomplete insofar as some of the concepts are not fully implemented. Your job will be to complete the missing portions of the operating system and use the functionality in your projects.
The first step is to understand the environment. You'll want to download a copy of the Nachos distribution from the main projects page to your home directory on ieng6. Take some time to read the instructions for all projects on the main projects page. You'll need to understand how to submit your projects.
The second step is to read the README file in the base directory of the Nachos
distribution. This will explain how to alter your path to run Nachos from
the command line (Note: more specifically, add export PATH=$PATH:/path/to/nachos/bin
to your ~/.bash_profile
, replace the last part `/path/to/nachos/bin` with the actual
path to your nachos/bin directory. Re-login for it to take effect.) There will be other information
in the README file for future projects. Don't worry about that right now.
After installing the Nachos distribution, run the program nachos (in the proj0 subdirectory) for a simple test of our code. This causes the methods of nachos.threads.ThreadedKernel to be called in the order listed in threads/ThreadedKernel.java:
Your session should match the following:
$ cd nachos/proj0 $ make $ ../bin/nachos nachos 5.0j initializing... config interrupt timer user-check grader *** thread 0 looped 0 times *** thread 1 looped 0 times *** thread 0 looped 1 times *** thread 1 looped 1 times *** thread 0 looped 2 times *** thread 1 looped 2 times *** thread 0 looped 3 times *** thread 1 looped 3 times *** thread 0 looped 4 times *** thread 1 looped 4 times Machine halting! Ticks: total 2130, kernel 2130, user 0 Disk I/O: reads 0, writes 0 Console I/O: reads 0, writes 0 Paging: page faults 0, TLB misses 0 Network I/O: received 0, sent 0
Trace the execution path by hand to find where the output is coming from (i.e. which classes are generating those output statements). Your job will be simple for this first project, simply adding another print statement as described below. But first, some general information.
Your project code will be automatically graded. There are two reasons for this:
Of course, there is a downside. Everything that will be tested needs to have a standard interface that the grader can use, leaving slightly less room for you to be creative. Your code must strictly follow these interfaces (the documented *Interface classes).
Since your submissions will be processed by a program, there are some very important things you must do, as well as things you must not do.
For all of the projects in this class...
When you want to add non-java source files to your project, simply add entries to your Makefile.
In this project, you will not need to add any new files.
As this project is so simple, there is no autograder script associated with it. Thus there are no tests we provide for this project.
As with all projects, you will submit it using the project specific submission
script. For this project, you cannot work in a group. Each student must submit their
own project 0. To submit, log into your course account and run: prep cs120s
Then move into your nachos directory and run: submit-proj0
You will have until the posted due date to submit this project. You can submit
as many times as you like. The last version submitted before the due date will be the one accepted.