This program simulates a Virtual Memory of an Operating System using the FIFO (First In First Out) method or LRU (Least Recently Used) method. We have one main file and 5 headers on this application.
This is the main file where every function is being called and the code is executing the given commands, for better organization it was decided to make the files this way.
This is where all the structs used throughout the code reside.
This is where all the functions signatures are located for better organization. Besides that on this file we have the functions used to load & organize the page table and the functions used to create the physical addresses.
This is where all the functions regarding the FIFO (First In First Out) method are situated.
This is where all the functions regarding the LRU (Least Recently Used) method are situated.
This header is where all the functions used to save the physical addresses, the amount of page faults and translated addresses are situated. this is where we create a file called "correct.txt" and print the information on it.
firtly compile the program using your terminal on the main.c application folder using the command "make", after that the program will create a binary file called "vm", for the application to work you need to pass 4 arguments on your terminal in this respective order:
1st argument is the binary file;
2nd argument is the ".txt" file used for the logic addresses;
3rd argument is the method you wish to use when loading the page table;
4th argument is the method you wish to use to load the TLB;
Ex:
./vm addresses.txt fifo lru
$ make
$ make clean