Choose your own prompt.

Learning Goal: I’m working on a operating systems question and need an explanation and answer to help me learn.*you might need to read chapters 4 and 5 in the OSTEP book.*the shell must work in xv6…*if you need any files just let me knowWrite 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 “$” or something 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: (I will send it to you if you needit){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.
To support “pwd” (print working directory), keep track of the working directory (from the “cd” command) in your own code. The first working directory will be “/” when the shell starts. There is no way to get the name of the current working directory from xv6.
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
get process id
Otherwise (not “built-in” command):Split the command into argv array
Child runs exec
Parent waits
Requirements: as required in question details

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
The price is based on these factors:
Academic level
Number of pages
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more