Your task is to write a simulator that reads a memory trace and simulates the action of a virtual memory system with a single level page table. Your memory system should keep track of which pages are loaded into memory. • As it processes each memory event from the trace, it should check to see if the correspond-ing page is loaded. • If not, it should choose a victim page in memory to replace. • If the victim page to be replaced is dirty, it must be saved to disk before replacement. • Finally, the new page is loaded into memory from disk, and the page table is updated. This is just a simulation of the page table, so you do not actually need to read and write data from disk. When a simulated disk read or write occurs, simply increment a counter to keep track of disk reads and writes, respectively. You must implement the following page replacement algorithms: • FIFO: Replace the page that has been resident in memory longest. • LRU: Replace the page that has been resident in memory oldest.
#Sales Offer!| Get upto 25% Off: