$\textstyle \parbox{1.5in}{CS4320}$ $\textstyle \parbox{3in}{\Large CS4320 Programming Project~1}$ $\textstyle \parbox{1.5in}{21~Sep 1999}$


Due Tuesday, 05 Oct 1999, at the beginning of class.

Please revisit this document regularly. It may change as we learn more about implementation details.

Overview

The goal is to implement a very simple shell running under the Linux operating system.

Our simple shell's life consists of

Our shell will provide two features of more commonly used shells: it will execute commands with full pathnames and will run commands in the background.

Specifications

The shell should support two features:

Linux System Calls

Among the system calls you may wish to know about include

fork
``splits'' a process into two pieces: a parent and a child. fork() returns one value to the parent process and a different value to the child process so they can differentiate each other.
execve
replaces the currently running program by the specified program, also giving it the specified argv values. The child process may want to use this command.
exit
stops program execution, returning a value to the parent. Your shell will probably not directly invoke this function. The programs that the shell executes will invoke this function and could be caught by a wait.
wait
suspends a process until a child process finishes.

Be sure to read the UNIX manual pages for fork(2), execve(2), exit(3), and wait(2) to learn their prototypes and necessary header files.

Optional Features

Optionally, you can extend your shell's features. For example, you can add backgrounding a process, searching for commands in a specified list, or file redirection. Go for it!

Additional Resources and Hints

The bash WWW page briefly describes shells before going into bash specifics.

This is the first time this project has been assigned so difficulties will surely be encountered. As appropriate, I will post hints and explanations here as we learn them.

Grading and Logistics

You can work in groups of up to two people. Grades will be assigned primarily according to correctness. Adequate documentation of the project and the code will assist in assigning partial credit. In class, we will discuss how to submit the project.




1999-09-20