Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Introduction to Operating Systems - Programming Project 1 | CSC 389, Study Guides, Projects, Research of Operating Systems

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

Pre 2010

Uploaded on 08/18/2009

koofers-user-pwh-1
koofers-user-pwh-1 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
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.
1. You will document the loader.c program and turn it in.
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.
2. You will write the necessary code to implement a menu
select to allow you to choose to print to the screen or to
a file. You only have to document the code you add. This
program has to compile and execute. You will turn in the
source code.
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:
+ 2 3
* 4 5
? 0 0
Jobs stored in the shared memory in the running and ready states
will have an associated process control block (PCB). The PCB's
pf2

Partial preview of the text

Download Introduction to Operating Systems - Programming Project 1 | CSC 389 and more Study Guides, Projects, Research Operating Systems in PDF only on Docsity!

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.

  1. You will document the loader.c program and turn it in. 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.
  2. You will write the necessary code to implement a menu select to allow you to choose to print to the screen or to a file. You only have to document the code you add. This program has to compile and execute. You will turn in the source code.

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:

SOURCE

OUTPUT

End