



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




All the programming assignments will be graded under the Linux operating system. The machine onyx.boisestate.edu will be used for submission and grading of programs. Make a directory for the class (say cs453). Make subdirectories (say p1, p2, ...) underneath the class directory.
In this project, we will be extending the functionality of the simple shell example that was discussed in class (ch2/shell1.c). We will call our shell “dash” (for Dead Again SHell). We will add the capability to accept arguments to commands and the ability to run background jobs. We will add some basic built-in commands like exit, cd and logout.
We will be adding a job descriptor data structure to keep track of jobs running in the background. Now your shell will assign job numbers to commands started in the background and store them in the job list while they execute. We will also add a new built-in command jobs, that allows the user to query the status of background jobs.
There will be several more parts to the dash project in the rest of the semester. So design your project so that it is easy to extend.
How do we design a data structure for a job list? We need a data structure that is flexible (that is, can grow as needed but not use much memory when not needed), easy to add/remove jobs, relatively easy to search for a job (although this requirement is not very important for our shell project). A doubly-linked list is a good choice to satisfy our needs. You can also use a Hashed Linked List, which allows for easy traversal combined with fast search.
Your mini shell should support the following functionality:
int main() {
char *line; char *prompt = "dash>";
using_history(); /* enable readline history mechanism / while ((line=readline(prompt))) { printf("%s\n",line); add_history(line); / add current line to history list */ free(line); } exit(0); }
You must use subversion for source code management in this project. Create your subversion repository under your home directory in the folder svn as follows.
svnadmin create ~/svn chmod o-rwx,g-rwx ~/svn
The chmod command protects your repository from other people accessing it directly. You should keep your linked list also in the subversion system. You may keep it as a separate project (especially if you are using the shared library version) or in the same project.
Please submit a working checked out copy. Please also include the log file from your subversion repository. You can do that by using the following command:
svn log > svn.log
Read the entire specification before designing your shell project. Write down the rationale for your design choices. Here are some issues to decide:
Your README file would typically also contain your design ideas as well as testing information. If you wish, you can have a separate design document. But you should still have a README file as described above.
Please observe the following guidelines.