|
1 | 1 |
|
2 | | -# 💾 Part 2 – Memory Management: Page Replacement Algorithms |
| 2 | +# 🧠 Operating System Design – Academic Project (Fall 2024) |
3 | 3 |
|
4 | | -### 📌 Operating System Design Project – Fall 2024 | University of North Texas |
5 | | -🧑🏫 Instructor: Prof. Amar M. Maharjan |
6 | | -📁 Project 5 of 6 | Focus: Page Replacement Strategy Simulation & Evaluation |
| 4 | +##🎓 CSCE 5640 – University of North Texas |
| 5 | +**Instructor:** Prof. Amar M. Maharjan |
| 6 | +**Team Members:** Ganesh Gundekarla, Shreya Sri Bearelly, Divya Sree Dandu, Vikas Varala |
7 | 7 |
|
8 | | -This project simulates and evaluates five popular page replacement algorithms to understand their efficiency in managing memory pages. Each algorithm is tested using reference strings from input files and frame sizes of 10 and 20. The results are analyzed based on the number of page faults encountered during execution. |
| 8 | +This repository contains a two-part academic project on **Operating System Design**, focused on process scheduling and memory management. Each part covers core operating system concepts implemented in C++, tested with real scenarios, and analyzed with custom-built datasets. This project is part of a six-project academic portfolio developed during graduate coursework. |
9 | 9 |
|
10 | 10 | --- |
11 | 11 |
|
12 | | -## 🧠 Algorithms Implemented |
13 | | - |
14 | | -1. **FIFO (First-In First-Out)** – Replaces the oldest page in memory. |
15 | | -2. **Optimal** – Replaces the page that will not be used for the longest future duration. |
16 | | -3. **LRU (Least Recently Used)** – Removes the least recently accessed page. |
17 | | -4. **LFU (Least Frequently Used)** – Evicts the page with the lowest access frequency. |
18 | | -5. **MFU (Most Frequently Used)** – Replaces the most frequently used page, assuming it's no longer needed. |
19 | | - |
20 | | -Each algorithm is implemented in a separate C++ source file and handles custom reference string input formats. |
21 | | - |
22 | | ---- |
23 | | - |
24 | | -## 📂 Folder Structure |
| 12 | +## 📁 Repository Structure |
25 | 13 |
|
26 | 14 | ``` |
27 | | -Part2/ |
28 | | -├── code/ |
29 | | -│ ├── fifo.cpp |
30 | | -│ ├── optimal.cpp |
31 | | -│ ├── lru.cpp |
32 | | -│ ├── lfu.cpp |
33 | | -│ ├── mfu.cpp |
34 | | -│ └── input/ # Reference strings for testing |
35 | | -├── docs/ |
36 | | -│ └── Project2Report.docx |
37 | | -└── README.md # This file |
| 15 | +os-design-project/ |
| 16 | +├── Part1/ # CPU Scheduling Algorithms |
| 17 | +│ ├── code/ |
| 18 | +│ ├── docs/ |
| 19 | +│ └── README.md |
| 20 | +├── Part2/ # Page Replacement Algorithms |
| 21 | +│ ├── code/ |
| 22 | +│ ├── docs/ |
| 23 | +│ └── README.md |
| 24 | +└── README.md # (This file) Combined Overview |
38 | 25 | ``` |
39 | 26 |
|
40 | 27 | --- |
41 | 28 |
|
42 | | -## 📄 Input Format |
| 29 | +## ⚙️ Part 1 – CPU Scheduling Algorithms |
43 | 30 |
|
44 | | -Each line in the input file is a space-separated sequence of page references: |
| 31 | +### 🧠 Overview |
| 32 | +Implements and evaluates five core CPU scheduling strategies: |
| 33 | +- First-Come First-Served (FCFS) |
| 34 | +- Shortest Job First (SJF) |
| 35 | +- Priority Scheduling |
| 36 | +- Round Robin |
| 37 | +- Priority with Round Robin |
45 | 38 |
|
46 | | -``` |
47 | | -7 0 1 2 0 3 0 4 2 3 0 3 2 |
48 | | -``` |
49 | | - |
50 | | -Files are grouped by test size (10-frame and 20-frame scenarios). |
| 39 | +Each algorithm is tested on custom datasets containing 6, 10, and 16 processes. Results focus on metrics like average waiting time and turnaround time. Outputs are generated and analyzed using Python visualization tools. |
51 | 40 |
|
52 | 41 | --- |
53 | 42 |
|
54 | | -## ▶️ How to Compile and Run |
| 43 | +## 💾 Part 2 – Page Replacement Algorithms |
55 | 44 |
|
56 | | -Example for FIFO: |
57 | | -```bash |
58 | | -g++ fifo.cpp -o fifo |
59 | | -./fifo input/ref10_1.txt input/ref10_2.txt ... |
60 | | -``` |
| 45 | +### 🧠 Overview |
| 46 | +Simulates five page replacement strategies: |
| 47 | +- FIFO |
| 48 | +- Optimal |
| 49 | +- LRU (Least Recently Used) |
| 50 | +- LFU (Least Frequently Used) |
| 51 | +- MFU (Most Frequently Used) |
61 | 52 |
|
62 | | -Repeat similarly for other algorithm files. |
| 53 | +Each algorithm is tested with reference strings and evaluated using different frame sizes (10 and 20). The analysis focuses on the number of page faults and efficiency of real-time memory handling strategies. |
63 | 54 |
|
64 | 55 | --- |
65 | 56 |
|
66 | | -## 📊 Results Summary (Page Faults) |
| 57 | +## 📈 Summary Tables |
67 | 58 |
|
68 | | -| Algorithm | Avg Faults (10 Frames) | Avg Faults (20 Frames) | |
69 | | -|-----------|------------------------|-------------------------| |
70 | | -| FIFO | 10.2 | 25.6 | |
71 | | -| Optimal | 9.6 | 21.8 | |
72 | | -| LRU | 10.0 | 23.4 | |
73 | | -| LFU | 10.4 | 23.4 | |
74 | | -| MFU | 10.2 | 25.6 | |
| 59 | +### CPU Scheduling – Avg Waiting Time |
75 | 60 |
|
76 | | -📌 **Observation:** Optimal yields the lowest page faults as expected, while LFU and LRU provide efficient real-world alternatives. |
77 | | - |
78 | | ---- |
| 61 | +| Algorithm | 6 Procs | 10 Procs | 16 Procs | |
| 62 | +|------------------------|---------|----------|----------| |
| 63 | +| FCFS | 44.17 | 83.24 | 136.26 | |
| 64 | +| SJF | 32.67 | 65.88 | 109.49 | |
| 65 | +| Priority | 50.20 | 81.66 | 138.10 | |
| 66 | +| Round Robin | 58.20 | 121.50 | 200.71 | |
| 67 | +| Priority + Round Robin | 50.73 | 82.44 | 138.16 | |
79 | 68 |
|
80 | | -##📄 Documentation |
| 69 | +### Page Replacement – Avg Page Faults |
81 | 70 |
|
82 | | -Comprehensive explanations, charts, and comparisons are available in the DOCX report. |
| 71 | +| Algorithm | 10 Frames | 20 Frames | |
| 72 | +|-----------|-----------|-----------| |
| 73 | +| FIFO | 10.2 | 25.6 | |
| 74 | +| Optimal | 9.6 | 21.8 | |
| 75 | +| LRU | 10.0 | 23.4 | |
| 76 | +| LFU | 10.4 | 23.4 | |
| 77 | +| MFU | 10.2 | 25.6 | |
83 | 78 |
|
84 | 79 | --- |
85 | 80 |
|
86 | | -## 🧑💻 Contributors |
| 81 | +## 🧾 Learning Outcomes |
87 | 82 |
|
88 | | -- Ganesh Gundekarla |
89 | | -- Shreya Sri Bearelly |
90 | | -- Divya Sree Dandu |
91 | | -- Vikas Varala |
| 83 | +- Gained hands-on experience simulating low-level OS mechanisms |
| 84 | +- Understood how CPU and memory scheduling impacts performance |
| 85 | +- Practiced software modularity, input handling, and evaluation pipelines |
| 86 | +- Leveraged C++ for systems programming and Python for analysis |
92 | 87 |
|
93 | 88 | --- |
94 | 89 |
|
95 | | -## 📘 References |
| 90 | +## 📫 Contact |
96 | 91 |
|
97 | | -- Operating System Concepts, Silberschatz, Galvin & Gagne (10th Edition) |
98 | | -- Research on Memory Hierarchies and Caching Policies |
| 92 | +Created by Ganesh Gundekarla |
| 93 | +🔗 [LinkedIn](https://www.linkedin.com/in/ganeshgundekarla) • [GitHub](https://github.com/gnevercodes) |
0 commit comments