Paging

Homework 6 – Paging
Due by 3:30 p.m. Tuesday, 12/1/15
Write a program that simulates the FIFO and LRU page-replacement algorithms. Your program should
accept four command-line arguments specifying the page size, the total logical memory size, the pagereplacement
algorithm to use, and the number of frames allocated. The page and logical memory sizes
should be specified by their binary logs. Thus, the following command would simulate a page size of
1KB and a logical memory size of 64KB, using LRU page-replacement with 8 frames allocated:
./simulate-paging 10 16 LRU 8
Your program should read lines from standard input, each containing a hexadecimal number
representing the virtual address of a memory reference. With each memory reference, your program
should update an internal page table, keeping track of the number of page faults generated (using pure
demand paging). Your program should also maintain any other data structures necessary to implement
the two page-replacement algorithms. Your program should termina

Leave a Reply

Your email address will not be published. Required fields are marked *