CMPSCI 377: Operating Systems
Lab 1: C++

Due: Oct 6, 1999 12:20pm

VIP Students: Your lab assignment is due two weeks from when you receive it.

Purpose of Assignment

The purpose of this assignment is to give you familiarity with the subset of C++ you will need for this course, if you do not have it already. It should take the experienced C++ programmer at most 3 hours to complete this assignment and the unexperienced programmer about a day; so plan ahead. Anyone who cannot finish this assignment on time does not have the necessary programming skills to complete this course successfully, and should drop the course. Since the assignment is not really related to operating systems, it will not be averaged into your final grade.


Use only the delux machines (DecStations) in the Edlab to compile and run your program. The graders will execute and grade your programs only on this architecture. (Although this assignment should work on either DecStations or the Alphas, the remainder of the lab assignments will only work on the DecStations.) To get to the DecStaions in the Edlab, you must walk through the first room (which contains only Alphas) and proceed to the second room where the DecStations are. If you are logging in remotely, you should use delux1 through deluxj. A good way to check which machine you are on is to type machine at the prompt - if the shell responds by saying mips, you are working on the right machine.

The Assignment

In this assignment, you will use C++ classes to implement list operations such as insertion and sorting of integers on a doubly linked list. We provide you with declarations for two classes, Dlist - the linked list class and Dlink - a link in a list, declarations for most of their member data and functions, as well as implementations of an example Dlist::SelfTest function and main.

You must implement most of the member functions, constructors, and deconstructors for both Dlist and Dlink.

I recommend using quicksort (see ``Introduction to Algorithms'' by Cormen, Leiserson, and Rivest) to do the sorting.

What We Provide

Doing and Turning in Your Assignment

To get started, make a directory in your cs377 directory called lab1 and copy all of the files from the /courses/cs300/cs377/cs377/nachos/nachos-3.4/lab1 directory. Run make dlist and see the list of errors it generates in its current form. Implement and test all the undefined member functions, constructors, and deconstructors. Also, this is a good opportunity to practice writing understandable code and comments.

We will collect the files dlist.h and from your cs377/lab1directory. For your lab to be on time, the files must have a timestamp of 10/6/1999 12:20pm or earlier.

During testing you might want to create another testing method in addition to SelfTest. Please be sure that the version you turn in has an unmodified SelfTest method.

This page is online at
Prashant Shenoy
Last modified: Wed Sep 22 15:19:09 EDT 1999