

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Material Type: Project; Professor: Mims; Class: Introduction to Operating Systems; Subject: Computer Science; University: University of Illinois Springfield; Term: Spring 2005;
Typology: Study Guides, Projects, Research
1 / 2
This page cannot be seen from the preview
Don't miss anything!
CSC 389 Spring 2005 Programming Project I (Parts 1 and 2)
This project has two components that are listed below. More directions follow the two items and I will post information to help explain what the parts of the loader.c program do. I will also provide some sample code to help you get the menu option added.
Part 1
Document the simulated Loader, CPU, and Printer program that utilizes concurrent processes communicating via shared memory on a Unix system. You may make enhancements to the loader.
Loader -- The loader process will load programs from a file called cpu.dat into a section of shared memory. The shared memory should be large enough to hold two programs simultaneously.
CPU -- The cpu process will execute the programs that have been loaded into the shared memory by the loader process. The cpu will store each source statement and related output in a section of shared memory for the printer process to print.
Printer -- The printer process will print the source listing and output for the programs executed by the cpu into a file named cpu.output. *** You will need to add this part.
The cpu.dat file contains lines with an operator (+,-,*,/, or %) followed by two integer operands similar to the following:
Jobs stored in the shared memory in the running and ready states will have an associated process control block (PCB). The PCB's
will be stored in a section of shared memory. The PCB's will contain values to indicate:
a the beginning address of the program
b the number of instructions in the program
c the beginning address of the program's output
A working version of the code in contained in the file on uisacad in the directory ~tmims1>csc389sp05/loader/loader.c or the full path /export/home/tmims1>csc389sp05/loader/loader.c and the sample data for this file is in the cpu.dat file in the same subdirectory.
You should be able to get to the directory by typing cd ~tmims1>csc389sp05/ at your command prompt.
You should be able to copy the entire directory to your directory by executing the command
cp –r ~tmims1>csc389sp05/loader.
Part 2
You need to get a fresh copy of loader.c from my directory and make sure it will compile and run. You are to add code that modifies the printer section of loader.c so that printer process will print the source listing and output for the programs executed by the cpu into a file named cpu.output. Also, you will add code that will provide the user with the option of printing the output to the screen.
Turn-in a written description of your program (use a word processor) with diagrams showing the relationships of the processes, fully documented program source listing, and output from the executions.
The cpu.output file will contain lines similar to the following:
End