In this homework you'll become familiar with the process management services on the Unix operating system. As we learned in class, the key components of the process creation API are:
For more information on the semantics and arguments to these calls, check out their Unix man pages (man 2 ...).
For this assignment, you are to write a simple shell-like command processor. In principle, your processor will act just as the many Unix shells do -- reading in commands from the console, executing the commands, printing their status on completion, and looping to read the next command. Suppose your shell is called "mysh" and uses "*" as a prompt -- then, a typical interaction with "mysh" would look like (comments are indicated by # text):
% ./mysh # start up mysh * # hit CR * /bin/ls . # list the contents of the current directory mysh mysh.c mysh.o * myshstatus Last command exited with status 0 * /bin/date Sun Jan 10 19:27:07 PST 1999 * myshstatus Last command exited with status 0 * /usr/ucb/users bershad bershad fred john smith * myshtime Last command took .2 seconds to execute. * exit # exit from mysh; returning to top level shell %
There are several things going on here worth noting since you will have to implement accordingly:
What to turn in:
This assignment is to be done individually.
You must implement the solution in a single C source file called mysh.c.
Please email your single source file to cse451-hw@cs.washington.edu by 11:59 pm on Monday, January 18th. Your email message should have the subject: Homework 1 and the message should include nothing but the source file. We will be autoprocessing your mail message by storing it in a directory, compiling and executing it, so if the mail contains anything but compilable source code, we will not be able to grade your assignment.
When to turn it in:
This assignment is due on Monday, January 18th. It will be worth 10 points and graded with this criteria in mind: