CSCE A320: Operating Systems

Fall 2017. Assignment 6

Due: NLT 12/10/2017. 11:59 PM

Individual assignment.

Your job is to implement a virtual memory simulator by implementing the MMU and its TLB. Your code should implement the internal operation of MMU (Tenenbaum p199, Figure 3-10) with an additional functionality of TLB’s modified bit (Tenenbaum p203, Figure 3-12).

The virtual memory page requests will be loaded to the sequential physical memory frames initially, until all physical memory frames are used up. The physical memory frames will be loaded in sequence starting at page frame 0 to 2^[phys]-1. If all physical memory page frames are used up, the virtual page requests will be mapped to a MMU’s physical memory frame by invalidating the first physical page frame in MMU that was read but not written to, if no read pages are available, the first written page will be invalidated.

MMU table structure.

Phys mem frame [phys] bits

Present/absent bit

Read/Write bit

For each virtual memory address request, the MMU will output its encoded physical memory address request leaving MMU going to the physical memory sub-system. The output will be printed in a 32-bit int format.

Syntax: The VM simulator will be evoked from the command line with three parameters and will read the CPU’s virtual memory requests from the command line. The application will terminate with Ctrl-C signal:

$ ./vmsim [bus] [vm] [phys]

$ [r/w] [vm address request1]

$ [r/w] [vm address request2]

[bus] – the VM bus size in bits

[vm] – the number of bits used to represent a virtual page

[phys] – the number of bits used to address physical page frames on the system.

[r/w] – a binary marker is the memory access to to read or write. The pages fetched for read requests can be evicted from the working memory without writes, write requests must be first written to disk before a page fault request is fetched.

[vm address request] – read in as a 32 bit integer, then cast to [bus] size by masking off the upper (the most significant bits) 32-[bus] number of address bits. If the value virtual memory address request value is greater then a maximum value that can be represented by 32bit integer, write an error message.

What to turn in: All source files for your VM simulator, and at minimum 3 test shell scripts that will thoroughly test your code and illustrate the operation of your VM simulator. Include one (1) page the analysis, as a .pdf file, of your VM simulator performance. The analysis should leverage your test scripts; include any and all plots needed to illustrate the VM performance. Collecting and visualizing the normalized statistics of your simulator’s performance: requests, page faults, page writes…

What to turn in:

On the BB, submit an archive with your source code files that are well coded and commented, a makefile that will compile and run your code, README.txt if necessary, test scripts you used to test your shell, and a write-up summarizing your design in either simple .txt or .pdf format. Please DO NOT include executables of your code or the datafiles you used as sources like the long data files you used for testing.