CIS 345/545 Homework 2 Fall 2020 (Due: Oct. 8) This homework helps you understand how to run and add test cases in the educational operating system Pintos (CSU version). Login a Linux workstation in...

File attached.


CIS 345/545 Homework 2 Fall 2020 (Due: Oct. 8) This homework helps you understand how to run and add test cases in the educational operating system Pintos (CSU version). Login a Linux workstation in our Linux cluster. Type tar xvfz ~cis345s/pub/pintos csu.tar.gz to uncompress and extract the files to your working directory. Next, use the following commands to compile and build the kernel kernel.bin: cd pintos_csu/src/threads make Note that the test cases about threads located under pintos csu/src/tests/threads have been compiled and included in the kernel. Use the following to run the test case alarm-single: pintos -v -- run alarm-single Take a screenshot of the terminal window and print it. The source code of the test case alarm-single can be found in alarm-wait.c. In the second part of this homework, you are asked to add the producer/consumer program as a new test case. First, you need to copy the producer/consumer program from ~cis345s/pub/prd-cns.c to the directory pintos csu/src/tests/threads/. Then, you need to modify the file prd-cns.c to meet the Pintos system requirements, including the changes of the header files, types of mutex locks and semaphores, functions such as thread create(), lock acquire(), lock release(), sem down(), sem up(), etc. Note that just use the default priority PRTY DEFAULT for the producer and consumer threads when they are created. Further- more, you have to rename the main() function to be test prd cns(). You also need to do the following under the directory pintos csu/src/tests/threads/: • Add the pair {"prd-cns", test prd cns} to the test table tests[] in the file tests.c. • Add test prd cns as an extern test func in the file tests.h. • Add the source tests/threads/prd-cns.c to tests/threads SRC in the file Make.tests. Now you can switch back to the directory pintos csu/src/threads to rebuild the kernel to include the new producer/consumer test case. Use following to run it: pintos -v -- run prd-cns Take a screenshot of the terminal window and print it. Turnin Each group (two students) has to submit your report and program electronically. You have to put your report file (i.e. hw2 report.pdf) under the pintos csu dir. Before you submit, you need to use make clean to clean all of the object/executable files. Then, on grail, change the directory to the parent directory of the pintos csu dir and use the following command to submit the whole pintos csu dir: turnin -c cis345s -p hw2 pintos csu Your report should include the screenshots and the explanations of the execution results. The cover page should contain your picture(s), name(s), and the login id you used to turnin the project. Start on time and good luck. If you have any questions, send e-mail to [email protected].
Sep 29, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here