Description of Task
For this assignment, assume you have 16KB of usable memory available for
you to use. This memory is byte-addressable, meaning it takes 14 bits
to reference all the physical bytes. The page size for this machine
is 1KB - meaning your page replacement algorithm has 16 frames to work
with.
Your logical address space is 16 bits.
Your program will implement 3 seperate page replacement algorithms, FIFO,
LRU, and optimal for a single user. This will be tested by calling an address
generator that will return an integer array with N number of logical
memory references
for each replacement algorithm. Your program should record the number of page
faults using each algorithm.
Specifications
-
Your makefile shall create an executable called PA4.
-
PA4 shall take 2 parameters from the command line. Anything other than
integers (or nothing) will result in an error and termination.
-
The first is the number of logical memory
references to run the algorithm for. This
number is an integer greater 100 and less than 1000000.
-
The second is the seed to give the random number generator. This number
is an integer greater than or equal to 0.
-
The default for the first number is 1000, the default for the second number
is 0.
-
Your program will include the genAddress function given
here. Do NOT change this file in any way.
-
Your program will call the genAddress function, which will return a pointer
to an integer array of N logical memory references.
-
Your program will use those memory references in order and
execute each of the page replacement algorithms
recording the number of page faults for each.
-
Your program will print the results per the sample output below.
Output
Below is example output:
recondite> PA4 100000 0
FIFO = 20583 pagefaults
LRU = 18845 pagefaults
Optimal = 11459 pagefaults
recondite>
What to Submit
Submit your .c and .h files, your Makefile,
and a README file containing a description
of each file and any information you feel
the grader needs to grade your program.
The program files should be well documented
with both data dictionaries and logic flow
descriptions.
Your makefile should perform both a make clean
as well as a make all. Name the
executables per the requirements .
You are required to work alone on this lab.
Submit all files
using the RamCT CS370 Assignment Submission icon
This is Programming Assignment 2.