Giter VIP home page Giter VIP logo

page-replacement-algorithms's Introduction

LinkedIn


Page Replacement Algorithms

A Simulation Demonstrating Virtual Memory Paging Algorithms in an OS

Table of Contents

About The Program

This program Simulates Virtual Memory Page Swapping Algorithms.
The user passes a number string as an argument to the program at the command line that determines the Page numbers hit or miss (Page Fault) in succession. The algorithms used to simulate page swaps are: First in First Out, Least Recently Used, and Optimal.

The program will exit if an incorrectly formatted string is passed, or if non-digit numeric values
less than 0 or greater than 9 are passed.

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

  • Machine Requirements:
GCC, the GNU compiler  
C++ language  
Tested on Windows 10 and Mac OS Mojave  

Installation

  1. Clone the repo
git clone https://github.com/donnerhanson/Page-Replacement-Algorithms  
  1. Compilation
    Navigate to the location of the cloned program within the Page Replacement Algorithms directory.

compile using the command

g++ -std=c++98 -Wall -Wextra -g vmmpr.cpp -o vmmpr;  

Usage

  1. After completing the installation and compilation instructions, start the program within the Page Replacement Algorithms directory by running the command in a bash shell.
  ./vmmpr 1, 2, 3, 4, 5, 3, 4, 1, 6, 7, 8, 7, 8, 9, 7, 8, 9, 5, 4, 5, 4, 2  

To run and save the output

 ./vmmpr 1, 2, 3, 4, 5, 3, 4, 1, 6, 7, 8, 7, 8, 9, 7, 8, 9, 5, 4, 5, 4, 2 > output.txt  

Example

User Input String: 1,2,3,4,5,3,4,1,6,7,8,7,8,9,7,8,9,5,4,5,4,2  

FRAMESIZE: 4  

FIFO hit table  
 *  *  *  *  *  H  H  *  *  *  *  H  H  *  H  H  H  *  *  H  H  *  
 1  2  3  4  5  3  4  1  6  7  8  7  8  9  7  8  9  5  4  5  4  2  
Input Page String Length: 22  
FIFO Hit Total: 9  
FIFO Fault Total: 13  
FIFO Hit Rate: 40.91 %  

LRU hit table  
 *  *  *  *  *  H  H  *  *  *  *  H  H  *  H  H  H  *  *  H  H  *  
 1  2  3  4  5  3  4  1  6  7  8  7  8  9  7  8  9  5  4  5  4  2  
Input Page String Length: 22  
LRU Hit Total: 9  
LRU Fault Total: 13  
LRU Hit Rate: 40.91 %  

OPTIMAL hit table
 *  *  *  *  *  H  H  H  *  *  *  H  H  *  H  H  H  H  *  H  H  *  
 1  2  3  4  5  3  4  1  6  7  8  7  8  9  7  8  9  5  4  5  4  2  
Input Page String Length: 22  
OPTIMAL Hit Total: 11  
OPTIMAL Fault Total: 11  
OPTIMAL Hit Rate: 50.00 %  

Contact

Donner Hanson - @hansondonner - [email protected] - ChapmanID - 001276484

Michelle Yoon

Project Link: https://github.com/donnerhanson/Page-Replacement-Algorithms

page-replacement-algorithms's People

Contributors

donnerhanson avatar michellesyoon avatar

Watchers

 avatar  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.