Question: This question requires you to implement a user program in xv 6 - riscv. This program will make use of system calls fork, pipe, read,
This question requires you to implement a user program in xvriscv. This program will
make use of system calls fork, pipe, read, and write.
Task: Write a user program in xv name it pingpong. It should do the following:
a Create a child process.
b The parent will send an integer to this child process.
c Upon receiving this integer, the child process prints its PID followed by the value of
the integer it received.
d The child process should multiply the received integer by and send the resulting
integer back to the parent.
e The parent prints its PID followed by the value of the integer it received from the
child.
Example of usage:
$ pingpong
Integer from parent
Integer from child
Requirements: Communication between the parent and child process should be
through pipe. Your implementation must only establish a single pipe. Marks could be
deducted for lack of comments in your program.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
