Computer Science 432
Operating Systems

Williams College
Fall 2006


Lab 5: The Cow Shell
Due: 9:55 AM, Tuesday, October 31, 2006


After a few weeks of small labs while being distracted by Reading Period and an exam, it's back to a bigger programming task.

For this lab, you are to write a C program called the Cow Shell (cowsh), a mini command shell interpreter. cowsh is similar to familiar Unix shells such as the Bourne shell (sh) the Bourne-Again shell (bash), and C shell (csh, tcsh). You will learn about process creation, pipes, input/output redirection, background process management, signals, and interrupt handling, and gain extensive experience with C.

The program is designated a "team program" (groups of size 2 or 3 permitted) for honor code purposes. Collaboration within a group is, of course, unrestricted. You may discuss the program with members of other groups, but what you turn in must be your own group's work. Groups must be formed no later than 9:00 AM, Monday, October 23, 2006, and be confirmed by all group members by electronic mail to terescoj@cs.williams.edu. All group members will be assigned the same grade for the lab. There are many subtasks that can be carved off and assigned to group members, so everyone is encouraged to join a group.

Requirements

Like the Unix shells you use every day, cowsh should issue a prompt (perhaps "cowsh#"), at which it reads commands from the user and executes them.

Your shell should interpret the following commands and provide the following functionality:

Notes

Submission and Evaluation

All necessary files should be submitted using turnin as a single "tar" file, lab5.tar. Include a Makefile to allow easy compilation of the Cow Shell program.

I will compile and test your shell programs on CSLab FreeBSD systems.

Your program will be graded based on a total of 50 points.

Penalties may be applied for poor design choices, poor formatting of code, poor programming style, or if your program compiles with warnings (when using gcc -Wall).

Have fun and good luck!