CSS 430: Operating Systems Assignments


Language

We use Java to program all assignments except Program 1. (Program 1 consists of two sub problems, one practicing Linux system calls and the other using Java.) Probably, you must want to ask why we don't use C++ for all assignments. Some of you may even expect C++ system programming with Unix/Linux system calls. So, why don't we use C++? The answer is that Unix/Linux systems have been implemented in C and thus best fit to C applications. It is not impossible to use those system calls in C++ programs, however you need to adjust your code to the C programming style. For example, you must use C characters, include C header files, define many struct data types rather than classes, define global functions rather than member functions, and use pointers to void. Even using C, we cannot hack the operating systems through system calls unless we are administrators. This is because the main purpose of system calls is to provide us with an interface to utilize the operating system features but not to hack themselves.

Of importance is to understand the logical design of modern operating system and to exercise its implementation. Thus, we do not have to hack a real operating system. Instead, using Java, we implement an operating system simulator, called ThreadOS step by step through assignments. Java is a fast-moving technology. It is object-oriented language similar to C++, (while you still need to learn a bit more about Java-unique features). It is an interpretive language so that you will get more useful error messages than C++ at run time. Furthermore, Java includes some built-in operating system features such as threads and monitors. Therefore, it is quite appropriate to illustrate and simulate operating-system concepts.

Operating Systems

The operating system I recommend for all assignments is Linux (UW1-320). Although IBM-AIX (goodall.u.washington.edu) is another choice, it is not suitable to conduct real-time performance evaluations in our assignments 2, 3, and 4, because goodall is too heavy loaded. Since Linux operating systems are free to download and available through a CD-ROM provided with many Linux reference books, you may install Linux on your PC and work at home on your assignments. I understand that most of you are much more familiar with Windows and thus you may want to use it for your assignment work. As a matter of fact, Java is available on any platforms, so that you can down load the Java platform to and run your assignment programs on your own Windows. However, please note that Java compiler and virtual machine may behave differently. For instance, some bugs in your program may be found or not found depending on the execution environment you use. Since the grader and I will compile your homework on the Linux environment, please compile and run your program on Linux before your submission.

There are several reasons why this course recommends Unix-based operating systems (such as Linux and AIX): (1) many companies and institutions use Unix machines as their servers, while their client machines are Windows, (2) most computation-intensive and concurrent applications are based on Unix, (3) many OS design techniques and concepts came from Unix, (4) the Linux Kernel code is free to obtain and is commented in many reference books, and (5) it is easy to coordinate and submit a batch of jobs through shell scripting. While you are repeatedly using Unix for your assignment work, you will gradually get familiar with Unix commands.

Here are three options you can choose to play with Unix:

  1. Linux Lab at UW Bothell - UW1-320:
    You should also be able to enter UW1-320 Linux Laboratory with your student ID card and log into the lab machines with your UW Net ID and the corresponding password. The following contact points are available if you have any problems on your Linux account: Here is a procedure to log on one of the Linux machines and upload your files:
    1. To log on any of LAB320 machines, use ssh and establish a connection to uw1-320-lab.bothell.washington.edu.
      You will automatically got one of the lab machines and see your home directory immediately.
    2. To transfer files to the LAB320 file server
      1. Use sftp and establish a connection to uw1-320-lab.bothell.washington.edu, or
      2. Use scp at a LAB machine, so that files are copied from the outside to the LAB320 machine. The following example copies a file "file.java" from goodall to a LAB machine.
            scp mfukuda@goodall.u.washington.edu:file.java .
        
  2. Linux on your own PC: Visit  http://www.redhat.com/, and download an appropriate version of Linux. Follow the instructions given on this web page. This site also provides you with some useful information about introduction, installation, FAQ, and book reviews. If you would rather buy a set of CD-ROMs, click a purchase option denoted as Shop on this page.

    Many Linux books accompanied with a CD-ROM can be found in bookstores. Although you have to buy one, the biggest merit is that you can install Linux as following the instructions step by step and teach yourself by reading it chapter by chapter.

  3. Goodall (IBM-AIX) at UW Seattle (Not recommneded for Assignments 2, 3, and 4): Your UW account is initially set to use only dante.u.washington.edu for email. You need to set your account in order to use goodall.u.washington.edu for computing-intensive applications. If you have not set it up, follow the instructions below:
    1. Log on your myUW account and click UW NetID Services
    2. Check if the Manage Your NetID Resources page indicates that your account is inactive for goodall.
    3. If it is inactive, click CPU-Intensive Research(Goodall) and activate it. The activation will be made right away, so that you can log on goodall.u.washington.edu.
    Your home directory is visible from both dante and goodall. If you want to code your programs on your home computer, you can do so, but you have to transfer the programs to goodall by sftp and compile them using javac.

Windows and Mac Users

You may download the Java platform to your own Windows and code your assignment programs on it. However, as mentioned above, the Java compiler and virtual machine may behave differently depending on the environment you use. (For instance, while some bugs do not appear on the Windows environment, they may be reported by the Linux javac.) You are responsible to make sure that your assignment program runs as well on Linux prior to your homework submission.

The Source for Java Technology

Visit http://java.sun.com. This site includes:
  1. Java Tutorial: helps you run Java programs at Windows, Unix, and Mac, introduces the Java language, and lists essential Java classes.
  2. Java Platform, API documentation: lists all necessary Java API classes. You will frequently visit this page to review what classes are ready to use for your assignment programs.
  3. Java Development Environment Download: allows you to download the Java Standard Edition development environment (JDK).

Debugging Java Programs

Assignments

  1. Program 1 exercises basic linux system-call programming and also implements a simple shell on our operating system simulator, ThreadOS.
  2. Program 2 implements a multilevel-queue-based scheduler in Java. ThreadOS.
  3. Program 3 realizes inter-threads synchronization in ThreadOS in order to arbitrate disk read/write requests from multiple threads.
  4. Project constructs a Unix file system on top of ThreadOS.

Submissions

Grading

Criteria Percentage
Documentation of your report including explanations, illustrations, discussions, and output consideration 30%
Correctness of your program (Syntax errors, run-time errors, and/or incorrect answers will result in a significant number of points being deduced from your grade). Also reassure that you have used the algorithm as specified in each assignment. 50%
Organization of your program (modularization, coding style, and an appropriate amount of comments) 20%

Acknowledgment

I sincerely appreciate that Dr. Marvin Solomon gave me a permission to use a part of his operating systems class assignments. His original work can be located at http://pages.cs.wisc.edu/~solomon/cs537.html