Comp. Sys. Org. II, Project 1: Process management

Assigned: Feb. 3
Due: Feb. 24

The first project involves taking an existing simulator for a toy machine, which runs a single process, and extending it to run multiple processes.

Please note: There is a lot of stuff attached to this project, but some parts of it is much more important than others, and it will all make better sense if you work through it in the intended order.

The project is not, technically, very difficult. My solution involved writing about 80 lines of quite straightforward C code; in a more compressed style, I imagine you could do it in 40 lines. It requires no difficult mathematical analysis, only simple features of C, and no clever systems hackery. What it does require is that you understand very precisely what the code is supposed to do.

How to do this assignment

My recommendation would be to do things in the following order.

You do not at any point have to figure out how the STML programs work (not that they're very difficult); it is of no relevance whatever to doing the assignment. However, some people are uncomfortable unless they understand all aspects of whatever system they are working on (an attitude that, alas, becomes increasingly difficult to maintain as you progress in computer science). So I certainly don't discourage you from working through these simple programs, and I will be happy to answer questions about them in private discussion (i.e. not during class time and not on the class mailing list.)

Getting help

If you have specific, fairly focussed, questions, then the best thing to do is to email them to the class list, or, if you think that a lot of your classmates have the same question, during class time. If you are just generally at sea, and have no idea what's going on, then probably you should come see me in my office. You can either come during office hours or make an appointment via email.


I entirely encourage you to discuss any aspect of the project with your classmates. However, each student MUST write all his/her own code individually. Any sharing of code will be considered as CHEATING and dealt with accordingly.

If you take code taken from any source other than the code I have provided in stm.c, you must acknowledge the source in comments in your code.

Submitting the project

Source code in C, including the code carried over from stm.c, should be emailed to the grader, Jack Fan ( Be sure to include your name, email address, and ID number in a comment at the top of the source code. This project must be done in C; no other programming language will be accepted. The project must run on the i5 system.


Please note: Your program will be tested on examples other than those provided here.
A program that does not compile gets a maximum of 20 points.
A program that does not get as far as beginning execution of each of the STM modules gets a maximum of 50 points.
Good program structure and adequate commenting are worth 10 points.

Bugs and Errors

Please let me know by email about any bugs in the code or errors in the web pages as soon as you find them.