Nachos Project 0: Install
Due: Thursday, April 10, at 23:59 PDT.
Note: This is an individual assignment! Each student must
submit a copy of their KThread.java file.
In this "project" you will familiarize yourself with installing and
compiling the Nachos distribution.
The tutorial below
should not take that much time at all; if you seem to be having
serious problems, send us mail immediately (or use the webboard).
- [0 pts] Download and unpack the Nachos
distribution for this class:
$ tar xvzf nachosj-120.tar.gz
Once you have unpacked it, add /nachos/bin to your PATH.
Build a nachos executable using the make command in the proj1 directory:
$ cd nachos/proj1
This will create versions of the nachos executable in various
subdirectories. We will be using the proj1 directory for the
upcoming project 1, so let's use that nachos bytecode. Run it
without any arguments -- it should produce output similar to the
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
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
You can also read the README for the nachos command line parameters
as well as other details.
- [5 pts] You will be modifying the KThread.java file for project
1, so let's get acquainted with it now. Modify KThread.java so that it
prints the loop 6 times instead of 5 times.
- [5 pts] Now would also be a good time to learn how to write your
own test cases. In particular, you can look at how the
selfTest method is written. Modify the test case to loop 3
threads instead of just 2. (You should instantiate another KThread).
To submit your assignment you will need to use the prep
command and then the turnin command. First go to your
nachos/threads directory, and then type:
$ prep cs120s
$ turnin KThread.java