View the step-by-step solution to:

Question

(https://pdos.csail.mit.edu/6.828/2012/homework/xv6-shell.html). The MIT assignment asks the students to implement

the pipe "|" and IO indirection ">" operators and somewhat more in a very simple shell. We ask you to implement the sequence command execution operator ";" and the parallel execution operator "&" and more


1)     After your shell has started, it will give a prompt to the user. You should use "F19" for the prompt.

2)     If the user types cmd1;cmd2 after the prompt, cmd1 will get executed, followed by cmd2. After cmd2 is executed, your shell will give a new prompt in a new line, ready to execute the next command line.

3)     If the user types cmd1&cmd2, both commands will get executed in parallel. After both terminate, your shell will give a new prompt in a new line, ready to execute the next command line.

4)     The commands cmd1 etc. are real commands supported by xv6 and they take arguments. An example is the command echo "A".

5)     Your shell shall support a command line with a string of 3 or more commands connected by the ";" and "&" operators. The operators are of equal rank and they will be executed from left to right. The string "cmd1&cmd2;cmd3" will see cmd1 and cmd2 executed in parallel. Cmd3 after they both terminate.

6)     A command string terminated by a "&" is illegal; but it is fine with ";"'

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes