COMP242 - SHELL

Code:

The shell: shell.c

Header file: shell.h

Example of use: register_test.c
 


What does it do?

It is a shell for xinu commands. It will receive the command, validate it, execute it and return the result. After each command, you are displayed the process table and ready queue.
 


Priority juggling

The shell is a xinu process like any other. You need to create and resume it in your initialize.c. It loops forever waiting for commands. The priority for the shell needs to be the lowest out of all the xinu processes. The shell executes only when all the other processes are not running. So, in order to use the shell, first you need to suspend all the processes.
 


How do I use it?

Compile and link the code. shell.c does all the work for you. You just need to follow register_test.c. You can register three categories of elements:

Addendum

The code right supports just primitive data types for variables (int, long, char ...). It will be updated to support arrays.
 


Example calls:

create test_zero 81920 20 zero 1 0

create test_one 81920 20 one 2 a 0

kill 18

resched


 

For any questions contact the TA Stefan Zota( szota@cs.unc.edu )