Lab 1 -  Work through chapters 1 & 2 in the UNIX text.  Read and work through the tutorial on the vi editor in both the text and the UNIX help pages:


Use the vi editor to write a C++ program that mimics the UNIX man command.  The program uses argc and argv to read a word from the UNIX shell command line.  The use of argc and argv can be found in most C++ texts.  The "word" can be any of the following UNIX commands:  ls   man   vi   mkdir   cd    cat    pwd      rm    rmdir     passwd.  How to compile and run C/C++ programs in unix can be found on the UNIX help pages. 


The program will output an explanation of the UNIX command.


For example, if the program is called manual.cpp, then the command:


$ manual cd


will print:


cd     UNIX command that changes to root directory.   When specified with a directory name cd changes to directory name.   cd ..   changes to the parent directory.


Lab 2 -  Read chapter 4 in UNIX text.  Read UNIX help pages ( )and chapter 2 on file permissions.  Do Exercise at end of chapter 4  #1,2, and 4


Lab3 - Read chapter 3 in UNIX text.  Do projects 1,2, and 3. pg 144


Lab4   Part I - Much computer science research involves simulating a real system or algorithm.   The simulation is used to make predictions on the behavior of these under certain conditions.   For the first part of this lab you are to write a C++ program, using the UNIX system, to simulate a round robin algorithm.  You should be able to pass a parameter into argv of a time quanta in milliseconds. 


Lab5 - Part II - Add to the program written in Lab4 the ability to handle context switches.  Context switch time will also be an argument to your program.  You will be provided with a data file.  The file lists processes in the order in which they arrive, and the time at which they arrive in the system.   The file is organized with one process per line.  Each line is organized with the arrival time first and then the process burst time.   Click Here to download the data file, rrdata.txt.


Your program will accept two inputs, a context switch time and a time quanta.  Run your program with context switches of:    0,  .005, .010, .015, and .020.    For each context switch, run your program with time quantas of 5, 10, 15, 20, and 25.    You will therefore have to execute your program 20 times. 


Shell scripts allow UNIX users to run the same program multiple times with different parameters. You are to run your simulation, using a shell script, with the parameter inputs, as described in the  above.    A simple shell script would implement each program execution with a different command line.  Use any graphing software, Microsoft Excel, Star Office, Mat lab, etc., to visualize your results.  Create the graphs described in class, along with any other graphs you think would help substantiate your conclusions.


Computer researchers "tell the world" about their results in a research paper.  A research paper has a definite format.   We will discuss this in class.  You are to write a research paper describing your experiment.   Hand in your source code, a copy of your shell script and your research paper.


Extra credit 1:  Use a more complex shell script that employs a loop to execute the program.  The parameter values are calculated in the loop.  The output file names are created in the loop as well.  Call a plotting program for UNIX such as gnuplot in your shell script to create all the graphs needed.  Check out and .  (2 percentage points added to your grade)


Useful gnuplot links:   (gnuplot tutorial)


Cool gnuplot plots:



  (2 percentage points added to your grade)