Write two programs that simulate two versions of a paging memory management system - one based on FIFO algorithm, another one based on LRU (for LRU, you can use either system of counters associated with frames, or a stack). Make the following assumptions:
a) the size of the internal memory is 40K, and it is divided into 10 page frames;
b) the system loads and runs one process; the length of the process is 80K (thus, it is to be divided into 20 pages).
Your driver program will be a loop running 40 times. On each run of the loop, it randomly generates a reference to a page in the process (a number in the range from 0 to 19) and makes sure that the referenced page gets a page frame. The driver will count and print out the total number of page faults; every time when a page fault occurs, it will print out the number of the page that caused the fault and the number of the page frame it gets.
Run the driver program first time using the FIFO memory management system, and save the reference string generated by the driver. Then run (a slightly different) driver program, using the LRU. Compare the numbers of page faults occurred in both cases.
d) a short (one paragraph) analysis (comparing performances of FIFO and LRU).
Make sure that you use a linked list to represent a queue in the implementation of FIFO (using arrays will result in deduction of 20 from your total). You can use arrays for LRU if you choose to implement counters. If you use stack, then implement a doubly linked list.
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request.
3) Exclusive and complete copyrights to all work purchased. (No GPL, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site).