UCSD Main WebsiteUCSD Jacobs SchoolDepartment of Computer Science and Engineering
spacer gif
spacer gif
CSE 120
spacer gifspacer gif
spacer gif
spacer gifCourse Overview
spacer gifspacer gifStructure
spacer gifspacer gifGrading
spacer gifspacer gifCollaboration
spacer gifspacer gifUseful books
spacer gif
spacer gifspacer gifSchedule
spacer gif
spacer gifProjects
spacer gif
spacer gif Homeworks
spacer gif
spacer gifWebBoard
spacer gif
spacer gif
spacer gif
Search
spacer gifspacer gifspacer gif
Advanced search  arrows gif

spacer gif
spacer gifspacer gif
spacer gif
spacer gif
spacer gif
spacer gif
spacer gifspacer gifspacer gif
spacer gif

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).

  1. [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
    $ make

    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 following:

    
    [cs120s1@ieng6]$ 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
    

    You can also read the README for the nachos command line parameters as well as other details.

  2. [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.
  3. [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
spacer gif
spacer gif
spacer gifback to top ^
spacer gif
spacer gif
spacer gif
spacer gif
9500 Gilman Drive, La Jolla, CA 92093-0114
spacer gif
About CSE | CSE People | Faculty & Research | Graduate Education | Undergraduate Education
Department Administration | Contact CSE | Help | Search | Site map | Home
snoeren@cs.ucsd.edu
Official web page of the University of California, San Diego
Copyright © 2002 Regents of the University of California. All rights reserved.
spacer gif