Study the user guide for http://siber.cankaya.edu.tr/OperatingSystems/moss/memory/user_guide.html Memory Management Simulator
Follow the steps below for installation of the software
Create a directory in which you wish to install the simulator (e.g., "moss/memory").
$ mkdir moss
$ cd moss
$ mkdir memory
$ cd memory
Download the compressed tar archive (http://siber.cankaya.edu.tr/OperatingSystems/moss/memory/memory.tgz memory.tgz) into the directory.
Expand the compressed tar archive.
$ tar -zxvf memory.tgz
Export the classpath
$ export CLASSPATH=.
To test the program, enter the following commands.
$ java MemoryManagement commands memory.conf
The program will display a window allowing you to run the simulator.
The command file for the simulator specifies a sequence of memory instructions to be performed.
Each instruction is either a memory READ or WRITE operation, and includes a virtual memory address to be read or written.
Depending on whether the virtual page for the address is present in physical memory, the operation will succeed, or, if not, a page fault will occur.
The output file contains a log of the operations since the simulation started (or since the last reset). It lists the command that was attempted and what happened as a result. You can review this file after executing the simulation.
Hint: If you want to compile java codes as given in the manual files, you may be faced with some errors. A suggested solution is that: If there is any import statement that is used for including user-defined class, erase it. (i.e. //import Common;)
Lab work:
Create a command file that maps any 8 pages of physical memory to the first 8 pages of virtual memory, and then reads from one virtual memory address on each of the 64 virtual pages. Step through the simulator one operation at a time and see if you can predict which virtual memory addresses cause page faults. What page replacement algorithm is being used?
Modify replacePage() in PageFault.java to implement a least recently used (LRU) page replacement algorithm.