Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this assignment, you are to explore the use and programming of some system calls through the creation of a simple shell program ( you
In this assignment, you are to explore the use and programming of some system calls through the creation of a simple shell program you are writing a simple userinterface to the operating system
should operate in a fashion similar to that as illustrated in the book, in Figure :
while true
print a command prompt
get a line of user input
if they didn't type "exit" or cd
create a child process
if I am the parent
wait for the child
else I am the child
directly execute the sys call
OR
execute the command using a version of exec.
System Calls
This list may not represent all possible options, especially for the time information and the host name.
Time information: gettimeofday, localtime, strftime
Getting the host name: uname, gethostname
Creating making a directory: mkdir
Removing a directory: rmdir
Printing working directory: getcwd
Changing directory: chdir
Kill: kill. Note that when implementing this one, just have it send a signal to the identified PID.
Creating a child process: fork
Waiting for a child process: waitpid, wait
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