Posted: February 12th, 2022
Place your order now for a similar assignment and have exceptional work written by our team of experts, At affordable rates
For This or a Similar Paper Click To Order Now
Learning Goal:
I’m working on a operating systems exercise and need guidance to help me learn.
Your shell should have a “prompt”, which is a symbol or message that indicates it’s ready to receive commands.
The xv6 shell has “$” and the Delenn shell has “[username@delenn] $” or similar.
Choose your own prompt.Make sure your shell can run programs with or without arguments, like “ls” or “cat README” and so on.
Print an error message if the command the user types cannot be executed.
Shells also often have some built-in commands that are not programs (they don’t cause a fork/exec).
Support the following built-in commands:help – shows a simple message about how to use your shell
PID – shows the shell’s process id
cd – changes shell’s current directory
PWD – shows the shell’s current directory
Outline of code:
Start a loop (we are going to loop forever so users can type commands over and over again).Get the input
Check some cases that handled inside the shell (no forking, “built-in” commands):change directory
print directory
help
get process id
Otherwise (not “built-in” command):Split the command into argv array
Fork
Child runs exec
Parent waits.
https://pages.cs.wisc.edu/~remzi/OSTEP/ (the book link).
Requirements: as needed | C
Place an order in 3 easy steps. Takes less than 5 mins.