A modular simulation of an Operating System’s Memory Management Unit (MMU).
This project demonstrates how modern kernels handle virtual memory, with a focus on:
- Paging
- Address Translation
- Page Replacement Algorithms
Current milestone: M3 – Least Recently Used (LRU)
-
Virtual Memory Simulation
Maps Virtual Page Numbers (VPNs) to Physical Frames. -
Page Replacement Algorithms
- ✅ LRU (Least Recently Used) using timestamp-based tracking
- 🔜 FIFO, Clock, Optimal
-
Console Visualizer
Real-time output showing:- Page hits
- Page misses
- Memory frame state
-
Trace Generation
Simulates realistic memory access patterns:- Hot pages
- Cold pages
- C++ Compiler (GCC or Clang)
- CMake 3.10+
git clone https://github.com/Mido191020/paging-simulator.git cd paging-simulator
cmake -S . -B build cmake --build build
./build/paging_sim
paging-simulator/
├── src/ # Core simulator logic (MMU, page tables, replacement)
├── docs/ # Technical documentation & architecture notes
├── milestones/ # Archived milestones (M1–M6)
├── tests/ # Unit tests
└── input.txt # Generated memory access traces
The simulator models a demand-paging system:
-
CPU Request Generates a virtual address (VPN).
-
MMU Lookup Checks the page table.
-
Hit Frame number is returned immediately.
-
Miss (Page Fault)
- Page fault handler is invoked
- Free frame is used or a victim page is selected (LRU)
- Page table is updated
- Execution resumes
Contributions are welcome!
Please read CONTRIBUTING.md for coding standards and pull request guidelines.