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:
- 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:
- Meryll Larkin<mlarkin@uwb.edu>
sets up your Linux account if it has not yet been created. If you have
an account but have forgotten your password, you should visit her at the
IS office.
- Dina
Meske<dinam@u.washington.edu>, our CSS counseling services
coordinator helps you enter UW1-320 with your ID card if it does not
unlock the laboratory entrance.
Here is a procedure to log on one of the Linux machines and upload
your files:
- 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.
- To transfer files to the LAB320 file server
- Use sftp and establish a connection to
uw1-320-lab.bothell.washington.edu, or
- 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 .
- 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.
- 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:
- Log on your myUW account and click UW NetID Services
- Check if the Manage Your NetID Resources page indicates
that your account is inactive for goodall.
- 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:
- Java
Tutorial: helps you run Java programs at Windows, Unix, and Mac,
introduces the Java language, and lists essential Java classes.
- 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.
- Java Development
Environment
Download: allows you to download the Java Standard Edition development
environment (JDK).
Debugging Java Programs
- Compile-time errors: The javac compiler points
out where your source program has syntax errors. Carefully look at
its error messages. You will find out code line numbers that
have syntax errors. Open your source code, go to those lines, and
fix your bugs.
- Run-time errors: The java virtual machine points out
where your compiled program has run-time errors. Carefully look at its
error messages. You will find out your source code's line numbers that
have run-time errors. Open your source code, go to those lines, and
fix your bugs.
- Debugging tools:
The following three may be helpful to develop your Java
program. However, please note that they may not be always useful
especially when you develop multi-threaded programs. (Most assignments
are multi-threaded programs)
- Jcreator is a Java IDE. It
provides the user with the following functionality: Project
management, project templates, code-completion, debugger interface,
editor with syntax highlighting, wizards and a customizable user
interface.
- JPad Pro is a Java editor that uses Sun's JDK/SDK to
compile and run Java.
Assignments
- Program 1 exercises basic linux
system-call programming and also implements a simple shell on our
operating system simulator, ThreadOS.
- Program 2 implements a
multilevel-queue-based scheduler in Java.
ThreadOS.
- Program 3 realizes inter-threads
synchronization in ThreadOS in order to arbitrate disk
read/write requests from multiple threads.
- Project constructs a Unix file
system on top of ThreadOS.
Submissions
- Hardcopy must include your report, program listing, and
execution output. Your report must include specifications,
explanations, and/or illustrations of algorithm and data structures
you used, and summarize your consideration of test results, (i.e., do
they make sense?). Note that you do not have to repeat writing all the
assignment specification. Use a typewriter font (e.g. courier new) for
your source code and execution output.
- Softcopy must be a tar archived file that includes
only your java source code. Your code should compile and run properly
using javac under linux since the grader tests them only using
linux javac. Follow the softcopy submission procedure shown below:
-
To log in the uw1-320-lab linux laboratory:
ssh -l your_linux_account uw1-320-lab.bothell.washington.edu
-
To compile your Java program, type:
javac your_program1.java your_program2.java ...
-
To run your Java program, type:
java your_program1
To run our ThreadOS simulator with your assignment, type:
java Boot
Upon a successful compilation, you will get an your_program1.clas,
your_program2.java ...
-
To archive your source programs in a file named "program1.tar":
tar -cvf - your_program1.java your_program2.java > program1.tar
* * * * * *
(A space must be inserted at each of these * marks.)
-
To submit your archived file "program1.tar" including your homework
assignment 1, visit our Catalyst
eSubmit website (please refer to the syllabus for the e-submit link).
Don't email your softcopy to me. You may repeat submitting a newer
copy as many times as you hope.
- Assignments are due at the beginning of lecture for both
your hardcopy and softcopy on the specified date. No late programs
will be accepted unless you provide me with a proof showing that you
have been under an emergency circumstance. No matter the
circumstances, it is always best to turn in something.
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