Projects

A significant element of this class are four programming projects using the (Java version of the) Nachos instructional operating system. Although Java may seem an odd choice, both the (outdated) C version of Nachos and the Java version focus on OS concepts; they are rather equivalent at a high-level.

The Linux machines located in EBU3B B230 or B250 are the recommended platform for your projects. For remote access, you can use ieng6-250.ucsd.edu through ieng6-254.ucsd.edu machines via SSH or VNC).

Groups

You may work alone or with a partner on projects 1 - 3 (not on project 0). If you decide to work with a partner, you may need to take extra steps to do so. See the working in a group page for info on how to setup your development environment to accommodate group work.

Obtaining Nachos

You can download a copy of the Spring 2017 CSE 120 distribution of Nachos here. Within this archive you will find the various java classes necessary to run Nachos. Some brief usage instructions for Nachos:

  • The simplest approach is to run on the B230+ machines as above on ieng6 (ssh). It is recommended you try this at least once to see the environment the TA does. Each project has a slightly different configuration, so to build for a certain project, enter projN (where N in {0,1,2,3}) directory and type make. This essentially runs javac to build your classes. After this (without changing directories!), running ../bin/nachos (which is basically a shell wrapper invoking the jvm) will execute nachos.

  • Alternatively, you can mimic this development environment on some reasonably POSIX-y machine.

  • The base nachos distribution is just java files, so you can import these into your fancy IDE; note that you may need to go through some extra work to make the project-specific configuration files functional. You should feel free to use whatever IDE you like, however we will not be providing support for (nor using) any particular IDE ourselves. So please be sure your submissions will compile and run without any special IDE libraries and/or configuration files.

Project Autograders

Some of the projects will have corresponding scripts that you can use to test your implementation. These scripts will run your code against an autograder that will send you an email of your results. We are providing this facility so that you can see if your implementation is on the right track. This facility is to be used only as a check that your implementation is working as you expect (and to some extent, as we expect). It is not a comprehensive test of all the functionality that you are to implement. We are providing this as an aide that will complement (not replace) your own thorough unit testing.

Details of how to run the autograder tests for each project (for which it is available) will be given on each project's description page.

Submitting Projects

All projects will be handed in using submission scripts. During submission the script will ask you to enter your login id and your partner's login id (if applicable). Note that if you are working with a partner (which you can only do for projects 1 - 3), only one of you must submit.

To submit projects you'll run a project specific submit script. After logging into your account, you'll want to run: prep cs120a

This may be automatically run for you when you log in. Then move into the nachos directory and run: submit-projN where N corresponds to the project number (0 - 3). This script will tar up your Nachos distribution and then submit it via a turnin script. Be sure that your code compiles before submitting it. If your submission does not compile, we cannot give you a grade. Upon successfully submitting each project, you will receive a confirmation email.

Important

Please note: If you and your partners are from different sessions, please submit to both sessions!

Projects

As promised, there are four projects. You are advised to start early and get ahead if possible! Together, all the projects comprise 30% of your final grade. So do not try to throw together a solution at the last minute or your grade will suffer.

Project
Project 0: Jump Start
Project 1: Threads
Project 2: Multiprogramming
Project 3: Demand Paging

Additional Resources

Recommendations

  • Lib.assertTrue() is your new best friend:
    • For entry from code which you DID write, it helps you keep track of invariants you established.
    • For entry from code which you DID NOT write, it helps you verify that you understand the nachos environment.

    Note that these can be compiled out so there is essentially no performance hit.

  • Look at the javadoc for the functions you use, and related functions. It has lots of nachos invariants and secret tips. Reading other nachos code is useful too, to see what tools are provided to you (lots!).

  • When hacking fails, try pencil and paper.

  • Prefer parsimony.