CS330 Project (Fall 2005)--Details
Part 2 (Due December 2)--worth 7%
The following is the detailed marking scheme and submission details.
Marking scheme(out of 17):
- ___/0.5 implemented EXIT (this should be implemented using signals)
- ___/2 implemented shell using fork/execvp/wait system calls
- ___/3 implemented '%' breakdown:
- ___/0.5 finding the '%'
- ___/1 correct functioning (ie. parent doesn't wait)
- ___/1 message is printed when the child is done
- ___/0.5 in subsequent commands, parent correctly waits for child
- ___/1 implemented LAUNCH (parent doesn't wait)
- ___/1 implemented ORDINARY (parent waits)
- ___/1 implemented MODE (print whether in LAUNCH or ORDINARY mode)
- ___/1 implemented SLEEP (calls library routine)
- ___/5 implemented piping using ':' breakdown:
- ___/0.5 finding the ':'
- ___/2 separating into two argument vectors
- ___/2 executing commands and feed output of one as input
to other using a pipe
- ___/0.5 parent correctly waits for child to finish
- ___/1.5 clearly outlined documentation of assumptions and structures used
- ___/1.0 appropriate comments, whitespace, and variable names.
A couple of HINTS:
- you may find it useful to use waitpid instead of
wait. For more on this system call, use man 2 wait.
- The piping can be implemented by forking within the child.
Submission Details
- Along with your source code and script,
you will include a document providing:
- an outline of your program's design (using words
and/or pictures of the structures/classes used).
These are things used specifically for Part 2.
- a list of assumptions made in the program design and
coding. This will include assumptions that were
inherited from the basic code that you were given to
get you started
- You will submit a complete source listing. Your code must be well
commented, have appropriate indentation and white space, use
meaningful variable names and constants.
- You will also submit a script of your run performing the following:
sleep 9
sleep 60 %
sleep 40 %
ps
LAUNCH
LAUNCH
MODE
sleep 70
sleep 80
sleep 100 %
MODE
ps
ORDINARY
date
touch hello
ls -l
rm hello
ls -l
MODE
SLEEP 5
SLEEP 60 %
MODE
SLEEP 40 %
ps
LAUNCH
MODE
SLEEP 70
SLEEP 80
SLEEP 100 %
ps
cp /net/share/class-info/cs330/joke.txt joke1.txt
cp /net/share/class-info/cs330/joke2.txt joke2.txt
cp /net/share/class-info/cs330/joke3.txt joke3.txt
cp /net/share/aliases/CS330-001.200530 allofus.txt
ls -l
ls -l : sort
cat joke1.txt : sort
cat allofus.txt : wc -l
echo "Hello"
cat joke2.txt
env : grep USER
blah
peanuts
EXIT