| Home | Syllabus
| Schedule | Homework:
1 2 3
4 5 6
| Projects | Grades
| Feedback
| CS Home
|
CMPS 111: Introduction to Operating Systems (Fall 2001) |
There will be four projects assigned this quarter, each one due about 2 weeks after it is assigned. Due dates are listed on the schedule and each individual project description:
Here, you'll find information that applies across all of the projects. Project-specific information can be found in each project's home page.
The assignments in this class do not require you to write large quantities of code. For most assignments, you need only write a few hundred lines of code, if not fewer. However, the concepts covered in class and in the operating system are quite difficult for most people. As a result, deciding which lines of code to write is very difficult. This means that a good design is crucial to getting your code to work, and well-written documentation is necessary to help you and your group to understand what your code is doing.
The most important thing to do is write your design first and do it early! Each assignment is about two weeks long; your design should be complete by the end of the first week. Doing the design first has many advantages:
Doing your design early is the single most important factor for success in completing your programming projects!
One of the most important debugging tools you can use is the dbprintf() statement in your code. This statement is identical to a standard printf() statement (also available in the DLX OS) except that it has an extra argument before the formatting string. This first argument determines whether the dbprintf() statement actually prints anything. Please read the documentation for DLXOS for further details.
Another debugging technique you may find useful is to turn on instruction and/or data tracing in the simulator. This doesn't affect the execution of the simulated program (the operating system), but does let you trace the action of the CPU to see where things go awry. The trace reports all of the instructions that are executed as well as any loads or stores that are done. Using this information and an assembly language listing of your operating system, you can follow your operating system as it runs. Often, the best solution is to start where the operating system malfunctions and work backwards, tracing the path of execution that led to that point.
Testing your code is an important part of the assignment. You should run as many tests as necessary to convince your group members (and the TA...) that your code works. This can be done by including several sets of tests in a single executable (selectable by passing arguments to the operating system via the -a option to the simulator) or by having several different versions of the source file. Either way, you should include a README file with your code to explain how you tested it.
Projects may not come with test data files, so you might have to make up your own. The best way to do this is to pretend that your job is to crash your program, and come up with input data or situations that are likely to cause problems. Many programs can deal with "normal" input; however, operating systems have to deal with all kinds of error conditions without crashing (though Micro$oft doesn't seem to have learned this...).
Each project must be handed in using the submit system on the CATS instructional computing cluster. For each project, hand in documentation, code, and any test files you created (scripts or data).
Your design documentation should describe the design of your project. This includes the data structures you're going to use, as well as the high-level pseudo-code for each high-level function. For this assignment, the high-level functions are pretty much the only functions you're going to need. For later assignments, though, you may have lower-level functions that aren't part of the "public" interface. We suggest that you document major functions that aren't visible it makes design simpler but you don't have to document every single function you're going to implement. A sample design document is available online.
Documentation must be in one of two file formats: plain ASCII text, or Adobe Portable Document Format (PDF). However, you don't have to purchase Adobe Acrobat to generate PDF. Instead, print your document to a file (this works on Macs, PCs, and Unix) and then use the Unix command ps2pdf on the Instructional Computing cluster to convert PostScript to PDF. Regardless of how you generate your PDF file, please stick to the basic fontsTimes, Helvetica, Courier, and Symbolto ensure that it'll display correctly on most computers and printers.
Please turn in all of the files you used to build your project: source code, Makefiles, and any other scripts you may have used. In addition, please include a README file to explain anything unusual to the TA testing procedures, etc. Your code and other associated files should be in a single directory so they'll build properly in the handin directory.
You can turn in files by running the following Unix command in your project directory:
submit cmps111.f01 projn *.c *.h *.s Makefile README documentation.pdf
Of course, you should modify documentation.pdf to be whatever you've called your design and documentation file. You may also hand in scripts and other files you used in testing, such as input data. Finally, you should use the correct n corresponding to the current project. Don't worry if you accidentally use the wrong nyou won't be allowed to submit files for projects other than the one currently assigned.
Don't submit object files or other files generated by the DLX compiler or assembler. Every file in the handin directory that could be generated automatically by the DLX compiler or assembler will result in a 5 point deduction from your project grade. This doesn't include scripts, documentation, or input datathe DLX compiler and assembler can't generate these automatically.
The default Makefile supplied with the operating system provides a clean target; make clean will remove all generated files from the project directory, which may be helpful for doing a "clean build" of the operating system or eliminating large (but automatically recoverable) files from old project directories.
The intent of the grading for the project is not to differentiate among those students who do a careful design and implementation of the assignments. Rather, the grading helps us identify those students who (i) don't do the assignments or (ii) don't think carefully about the design, and therefore end up with a messy and over-complicated solution. Remember that you can't pass this course without at least making a serious attempt at each of the assignments. Further, the grading is skewed so that you will get substantial credit, even if your implementation doesn't completely work, provided your design is logical and easy to understand. This means that you should first strive to come up with a clean design of your project on paper. Also, don't try to add fancy features just because some other group is!
The grading for the project will be as follows: 40% design, 60% implementation. We have structured the grading in this way to encourage you to think through your solution before you start coding. If all you do is to work out a detailed design for what you would do to address the assignment (and if the design would work!), but you write no code, you will still get almost half of the credit for the assignment. The implementation portion of the grade considers whether you implemented your design, ran reasonable test cases, and provided documentation that the TA could understand. Part of being a good computer scientist is coming up with simple designs and easy to understand code; a solution which works isn't necessarily the best that you can do. Thus, part of the design and implementation grade will be based on whether your solution is elegant, simple, and easy to understand.
The simulator and compiler/assembler should be capable of running on any Unix-like workstation. We've tested them under Linux and Solaris, but can't make guarantees for any other operating system. The dlxos code, however, runs only in the simulator, and should run anywhere the simulator can run.
There are three pieces of code you need: the operating system code, the DLX simulator, and the DLX compiler/assembler. If you want to do your project work on the CATS instructional systems (or associated workstations), you only need the code for the operating system itself. Both the DLX simulator and the DLX compiler and assembler are available on all CATS machines running Solaris that can mount AFS in the directory /afs/cats.ucsc.edu/courses/cmps111-em/dlx/bin. You need not copy files from this directory; instead, make links to the executables (gcc-dlx, dlxasm, and dlxsim). Of course, your operating system development should be done in your home directory.
If you want to run the system on your own Linux box, you'll need to build your
own version of the assembler, compiler and emulator. You'll need the following
tar files from /afs/cats.ucsc.edu/courses/cmps111-em/dlx:
dlxgcc-dist.tgz
dlxsim.tgz
dlxasm.tgz
Building the simulator is relatively straightforward: unpack the compressed tar file, enter the directory, and type gmake. The assembler is even easierit's written in perl, so you just have to unpack it. The compiler is a little more difficult, so follow these steps:
Note that the compiler is relatively large it requires around 50 MB to install. The assembler and simulator are significantly smaller.
Several people have already installed the DLX tools successfully on Linux boxes. There are a few minor issues which need to be addressed: