” 辅导CS 3305A程序、 写作Operating Systems程序、C/C++程序CS 3305A: Operating SystemsDepartment of Computer ScienceWestern UniversityAssignment 1Fall 2020Due Date: September 30, 2020PurposeThe goals of this assignment are the following: Get experience with the fork(), wait() and execl() system functions Learn more about How operating systems are structured Gain more experience with the C programming language from an OS perspectiveParent and Child Processes (100 points)Write a program in C that will perform the following tasks:1. Your program will create a parent process which will create two child processes (e.g., child_1, and child_2)2. parent will wait for child_1 to complete before creating child_23. child_1 will create its own child child_1.14. Inside child_2, a system call to an external program will be made. child_2 must pass its PID to the externalprogram external_program.out. As a result of this external program call, child_2 will be replaced byexternal_program.out (hint: execl()). The path to the external program external_program.out will be passedinto the program as a command line argument.The expected output from your program should look like the following:parent process (PID 2255) created child_1 (PID 2256)parent (PID 2255) is waiting for child_1 (PID 2256) to complete before creating child_2child_1 (PID 2256) created child_1.1 (PID 2257)child_1 (PID 2256) is now completeparent (PID 2255) created child_2 (PID 2258)child_2 (PID 2258) is calling an external program external_program.out and leaving child_2From the external program: The PID of child_2 was 2258Hints: fork(), wait(), getpid(), getppid(), execl() 辅导CS 3305A作业、 写作Operating Systems作业Mark DistributionThis section describes a tentative allocation of marks assigned for the desired features. (100 points)a) A Parent process will create two Child processes: 20 pointsb) Child_1 will create its own child Child_1.1: 20 pointsc) Parent will wait for Child_1 to complete before creating Child_2: 15 pointsd) Child_2 will make a system call to an external program: 25 pointse) Parent process must not Terminate until all child processes have completed: 20 pointsComputing Platform for AssignmentsYou are responsible for ensuring that your program compiles and runs without error on the computing platformmentioned on below. Marks will be deducted if your program fails to compile or your program runs into errors onthe specified computing platform (see below). Students have virtual access to the MC 244 lab, which contains 30 Fedora 28 systems. Linux machines availableto you are: linux01.gaul.csd.uwo.ca through linux30.gaul.csd.uwo.ca. It is your responsibility to ensure that your code compiles and runs on the above systems. You can SSH intoMC 244 machines. If you are off campus, You have to SSH to compute.gaul.csd.uwo.ca first (this server is also knownas sylvia.gaul.csd.uwo.ca, in honour of Dr. Sylvia Osborn), and then to one of the MC 244 systems(linux01.gaul.csd.uwo.ca through linux30.gaul.csd.uwo.ca). httpss://wiki.sci.uwo.ca/sts/computer-science/gaulProvided Files Two C files are provided: assignment1.c and external_program.c Your code should only be inside the provided C file assignment1.c Do not make any changes to external_program.c Hints and the necessary statements that need to be outputted have been included in assignment1.c file When running the program, you must provide the path to external_program.out as an argument (seeassignment1.c for details) If you have any questions Regarding the code provided to you, contact the TAs and/or the InstructorAssignment SubmissionYou must submit your Assignment through OWL. Be sure to test your code on one of MC 244 systems (seeComputing Platform for Assignments section above). Marks will be deducted if your program fails to compileor your program runs into Errors on the computing platform mentioned above. You need to submit one fileassignment1.c.Assignment 1 FAQ will be made available on OWL. Also, consult TAs, and the Instructor for any question youmay have regarding this assignment.如有需要,请加QQ:99515681 或邮箱:99515681@qq.com
“
添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导。