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 page to your home directory.
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. There will be other information in the README file for future projects. Don't worry about that right now.
After installing the Nachos distribution and setting up your environment variables, 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:
$ 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 autograder 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...
In this project,
Change the Nachos output print statements
*** thread n looped m times
to
*** awesome thread n looped m times
That's it. Be sure to test your changes before you submit them.As with all projects, you will submit it using iLearn. For this
project, you cannot work in a group. Each student must submit their
own project 0.
You will have until the posted due date to submit this project.