CS – 405, Fall 2019, Iyengar
Individual Programming Assignment #1.
Due: Midnight 9/30/19
Export your project to your folder
Simulation of Buffering and Spooling in a Single Use
and Muti-User System.
Input: System and Job Descriptions in the file jobs.dat.
The system is described as follows:
The first line describes the block size for transfer from secondary device (tape) to the primary device (disk) and the time for the transfer.
Ex: 100 50 indicating - that transfer from tapes to disks are always in chunks of 100, and this takes 50 units of time).
The second line describes the size of the disk.
Ex: 500 (indicating that the size of the disk is 500 units).
The third line describes the block size for transfer from the primary device to the Memory and the time for the transfer.
Ex: 50 5 (indicating – that transfer from disks to memory are always in chunks of 50 and this takes 5 units of time).
The fourth line describes the size of Memory.
Ex: 200 (indicating that the size of the main memory is 200 units).
The fifth line describes the size of the input space for a job.
Ex: 100 (indicating that input area for jobs is 100 units).
The sixth line describes the size of buffer into which DMA transfers could occur
Ex: 50 (indicating that input buffer into which DMA transfers is 50 units)
The above data will be followed by descriptions of jobs - one job per line. The format for the job description is as given below.
Job name C I C I C I ….. C
Where C is the cpu burst time, and I is the input data needed.
A job description could look like
First 10 80 30 40 25 60 10 60 20 30 50
Where the job name is First, it does 10 units of cpu time, then requires 80 units of data, then does 30 units cpu time, then requires 40 units of data, …, and then finally does 50 units of cpu.
The jobs.dat file contains unknown number of job descriptions.
Assume that all jobs are at the start on the tape, and are stored in the following format
Code for job1, data for job 1, code for job 2, data for job 2, ….
All jobs have code size of 200 units and input data space of 100 units.
Ignore interrupt processing overheads and memory to memory transfer overhead from DMA buffer to input space.
Project: Your program must simulate
a) Single Job without buffering and/or spooling.
b) Single Job with buffering – but no spooling.
c) Single Job with buffering and with spooling.
d) Multiple Jobs with buffering and spooling.
Output:
For each of the cases of simulation, your program must output every significant event that takes place in the system, with the time when the event happens. Examples of such events are – job xx started, spooling request issued, buffering issued, job zz completed, all jobs completed, etc.
Finally, your program should output, for each case of simulation.
The time to complete all jobs, the time spent executing user jobs, and the
Time spent (idle) by the system.