Code Monkey home page Code Monkey logo

memory-virtualization's Introduction

Virtual Memory Simulation


Description:

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.

main.c

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.

structs.h

This is where all the structs used throughout the code reside.

functions.h

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.

fifo.h

This is where all the functions regarding the FIFO (First In First Out) method are situated.

lru.h

This is where all the functions regarding the LRU (Least Recently Used) method are situated.

save_file

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.

How it works:

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


Usage:

1.Compile

$ make

2.Cleaning

$ make clean

memory-virtualization's People

Contributors

lucas3919 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.