Write a simple shell, which is a program that waits for you to type a command

Learning Goal: I’m working on a operating systems project and need support to help me learn.Read chapters 4 and 5 in the OSTEP book.Write a simple shell, which is a program that waits for you to type a command, and once you type it, runs that command (that program).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 builtin commands that are not programs (they don’t cause a fork/exec). Support the following builtin 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
Avoid all zombies.Turn in your .c file. You can name it whatever you want.Hints:Use the strsplit() function we created in class to break the user input into argv array: cp /home/jeckroth/csci301/2022-spring/xv6-class/{ulib.c,user.h,Makefile} .
When creating argv (probably with strsplit), make sure you add another slot at the end that you fill with a 0 (null). This is what exec() expects.
To support “cd” (change directory), first, don’t do a fork/exec since cd needs to change the directory of the shell process; instead, run the function chdir(new_dir_name) which is defined by xv6. This will change the directory the shell is running in, so if the shell tries to open/save files, run programs, etc., it will look in this “current working directory” to do so.
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
Requirements: Full required   |   .doc file | C

Calculate your order
Pages (275 words)
Standard price: $0.00
Client Reviews
4.9
Sitejabber
4.6
Trustpilot
4.8
Our Guarantees
100% Confidentiality
Information about customers is confidential and never disclosed to third parties.
Original Writing
We complete all papers from scratch. You can get a plagiarism report.
Timely Delivery
No missed deadlines – 97% of assignments are completed in time.
Money Back
If you're confident that a writer didn't follow your order details, ask for a refund.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00
Power up Your Academic Success with the
Team of Professionals. We’ve Got Your Back.
Power up Your Study Success with Experts We’ve Got Your Back.