COMP SCI 3004 - Operating Systems Assignment

Download Solution Order New Solution

Assignment Task

Simulator Requirements

Your job is to build a simulator that reads a memory trace and simulates the action of a virtual memory system with a single-level page table. The current simulator fixes the pages and page frame size to 4 KB (4096 bytes). Your program should keep track of what pages are loaded into memory. The simulator accepts 4 arguments as follows:

  • the name of the memory trace file to use.
  • the number of page frames in the simulated memory.
  • the page replacement algorithm to use: rand/lru/esc
  • the mode to run: quiet/debug

If the mode is "debug", the simulator prints out messages displaying the details of each event in the trace. The output from “debug” it is simply there to help you develop and test your code. If the mode is "quiet", then the simulator should run silently with no output until the very end, at which point it prints out a summary of disk accesses and the page fault rate.

As it processes each memory event from the trace, the simulator checks to see if the corresponding page is loaded. If not, it should choose a page to remove from memory. Of course, if the page to be replaced is dirty, it must be saved to disk. Finally, the new page is to be loaded into memory from disk, and the page table is updated. As this is just a simulation of the page table, we do not actually need to read and write data from disk. When a simulated disk read or disk write must occur, we simply increment a counter to keep track of disk reads and writes, respectively.

Most of the input (reading a trace), simulation counters and output messages has already being implemented in the skeleton files provided for you.

The skeleton reads the parameters, processes the trace files and for each access it generates a page read or write request. Your job is to complete the simulation of the memory management unit for each replacement policy:

  • rand replaces a page chosen completely at random,
  • lru always replaces the least recently used page
  • clock performs the replacement algorithm described in the textbook section 22.8.

You should start thinking how you can keep track of what pages are loaded, how to find if the page is resident or not, and how to allocate frames to pages. Some short traces (trace1, trace2, and trace3) will be used in the testing script and are provided to facilitate local testing of your code.

This IT and Computer Science has been solved by our PhD Experts at My Uni Paper. Our Assignment Writing Experts are efficient in providing a fresh solution to this question. We are serving more than 10000+ Students in Australia, the UK, and the US by helping them to score HD in their academics. Our Experts are well-trained to follow all marking rubrics and referencing styles.

Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.