Question
Question#1 -For this homework, you are to add a new commands to the Xinu shell. The steps to follow for addng a new Shell command.
Question#1-For this homework, you are to add a new commands to the Xinu shell. The steps to follow for addng a new Shell command. Add a new file called shell/xsh XXX.c, where XXX is the name of your shell command. This file should be structured as follows:
/* xsh_XXX.c - xshXXX*/
#include
/*------------------------------------------------------------
* xsh_XXX - shell command to do whatever you want it to
*------------------------------------------------------------
*/
shellcmd xsh_XXX(int nargs, char *args[])
{
// Your code here
}
Add an entry to cmdtab in shell/shell.c for your new command. Add a prototype for your new command function to include/shprototypes.h.
Question#2- You are required to create commands for the followng tasks:
1. Create a new process with a user specified priority that starts running in an empty infinite loop after announcing its PID.
2. Create a new process with a user specified priority that starts running in an empty infinite loop after announcing its PID and calling sleep or sleepms to sleep for 10 seconds.
3. List the content of the ready list.
4. Create a new process that starts waiting on a semaphore that you created with the initial count of zero after announcing its PID.
5. Signal the given semaphore id for a specified amount of time using signal n.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started