Skip to content

Commit eab70dc

Browse files
feat: upgrade Disk Scheduling Simulator to full OS Storage Architecture Lab with 11 schedulers, 3D platter, SSD mode, and code sandbox
0 parents  commit eab70dc

7 files changed

Lines changed: 4812 additions & 0 deletions

File tree

‎.gitignore‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Operating System Files
2+
.DS_Store
3+
Thumbs.db
4+
desktop.ini
5+
6+
# IDE & Editor Directories
7+
.vscode/
8+
.idea/
9+
*.swp
10+
*.swo
11+
12+
# Node / Package logs (if applicable)
13+
node_modules/
14+
npm-debug.log*
15+
yarn-debug.log*
16+
yarn-error.log*
17+
18+
# Antigravity Brain / Scratch temporary logs
19+
.system_generated/
20+
scratch/

‎CONTRIBUTING.md‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Contributing to Disk Scheduling Simulator & OS Storage Lab
2+
3+
Thank you for your interest in contributing! Whether you are adding a new scheduling algorithm, improving visualizations, or fixing documentation, your contributions are welcome.
4+
5+
## How to Contribute
6+
7+
1. **Fork the Repository**:
8+
Click the **Fork** button at the top right of [https://github.com/Priya-Ranjan-0201/Disk_Scheduling_Algorithm](https://github.com/Priya-Ranjan-0201/Disk_Scheduling_Algorithm).
9+
10+
2. **Clone your Fork**:
11+
```bash
12+
git clone https://github.com/YOUR_USERNAME/Disk_Scheduling_Algorithm.git
13+
cd Disk_Scheduling_Algorithm
14+
```
15+
16+
3. **Create a Feature Branch**:
17+
```bash
18+
git checkout -b feature/awesome-feature
19+
```
20+
21+
4. **Make Your Changes**:
22+
- `project.html`: UI structure & semantic markup
23+
- `project.css`: Design system & theme styling
24+
- `project.js`: Algorithm logic & canvas renderers
25+
- `README.md`: Documentation & mathematical explanations
26+
27+
5. **Test Your Changes**:
28+
Run a local server:
29+
```bash
30+
python -m http.server 8000
31+
```
32+
Open `http://localhost:8000/project.html` and verify canvas animations, algorithm step accuracy, and responsive layout.
33+
34+
6. **Commit and Push**:
35+
```bash
36+
git add .
37+
git commit -m "feat: add awesome feature"
38+
git push origin feature/awesome-feature
39+
```
40+
41+
7. **Submit a Pull Request**:
42+
Open a Pull Request against the `main` branch with a clear description of your changes.
43+
44+
## Code Guidelines
45+
- **Zero External Dependencies**: Keep the application purely in Vanilla HTML5, CSS3, and modern JavaScript (ES6+).
46+
- **High-DPI Canvas Rendering**: Ensure canvas elements scale crisply on Retina/4K screens via `devicePixelRatio`.
47+
- **Dual-Theme Compatibility**: Test styles in both Dark Obsidian Glass and Light Academic Paper themes.

‎LICENSE‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Priya Ranjan
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

‎README.md‎

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# 💽 Disk Scheduling Simulator & OS Storage Architecture Lab
2+
3+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
4+
[![Pure Vanilla JS](https://img.shields.io/badge/Built%20With-Vanilla%20JS%20%7C%20HTML5%20%7C%20CSS3-orange.svg)](#)
5+
[![Zero Dependencies](https://img.shields.io/badge/Dependencies-Zero%20(No%20npm%20needed)-brightgreen.svg)](#)
6+
[![HTML5 Canvas](https://img.shields.io/badge/Visualization-HTML5%20Canvas%202D%20%26%203D-purple.svg)](#)
7+
[![Web Audio API](https://img.shields.io/badge/Audio-Web%20Audio%20%26%20Speech%20API-red.svg)](#)
8+
9+
A state-of-the-art, interactive educational suite and hardware physics lab for exploring Operating System **Disk Scheduling Algorithms** (Classical & Linux Kernel) and **Storage Hardware Architecture** (Mechanical Magnetic HDDs vs. NAND Flash NVMe SSDs).
10+
11+
Designed for university OS courses, computer architecture labs, and systems software engineers.
12+
13+
---
14+
15+
## 🌟 Complete Feature Matrix
16+
17+
### 1. 🎛️ 11 Scheduling Algorithms & Linux Kernel Schedulers
18+
- **Classical OS Schedulers**:
19+
- **FCFS** (First-Come, First-Served)
20+
- **SSTF** (Shortest Seek Time First)
21+
- **SCAN** (Elevator Algorithm — ↗ High / ↙ Low Directional)
22+
- **C-SCAN** (Circular SCAN)
23+
- **LOOK** (Optimized Elevator)
24+
- **C-LOOK** (Circular LOOK)
25+
- **F-SCAN** (Dual-Queue Freeze SCAN)
26+
- **N-Step SCAN** (Batched SCAN with configurable $N$)
27+
- **User Custom Sequence**
28+
- **Modern Linux Kernel Schedulers**:
29+
- **Linux Deadline Scheduler**: Separate Read/Write FIFO deadline queues ($500\text{ ms}$ Read / $5000\text{ ms}$ Write) alongside sorted sector sweep.
30+
- **Linux CFQ (Completely Fair Queuing)**: Multi-process round-robin time-slicing across concurrent processes (e.g. MySQL vs Backup vs Player).
31+
- **Linux NOOP / None**: Simple FIFO request merging; optimal standard for NVMe SSDs.
32+
33+
---
34+
35+
### 2. 🖥️ 7 Interactive Multi-Dimensional Visualizers
36+
37+
| Tab | Visualizer | Description |
38+
| :--- | :--- | :--- |
39+
| **🎯 1D Track** | Linear Track View | High-DPI track line with glowing head pointer (`H`), color-coded request nodes, seek arcs, and tooltips. |
40+
| **📈 2D Graph** | OS Textbook Seek Chart | Time Steps ($Y$-axis, top-to-bottom) vs. Cylinder Number ($X$-axis, left-to-right). |
41+
| **💽 Platter 2D** | Concentric Hard Disk Platter | Kinetic spinning disk with concentric circular tracks ($0 \to \text{Max}$) and pivoting mechanical actuator arm. |
42+
| **💽 3D Cylinder** | 3D Multi-Platter Stack | Isometric stack of 3 platters (6 surfaces: Head 0 to Head 5) with a synchronized multi-head actuator comb. |
43+
| **⚡ SSD Flash** | NAND Flash Memory Array | Visualizes Flash Translation Layer (FTL), channels, dies, blocks, and pages with zero mechanical seek. |
44+
| **🐧 Linux Kernel** | Linux Queue Architecture | Live multi-queue breakdown showing Read FIFO, Write FIFO, and Sorted Dispatcher. |
45+
| **💻 Code Sandbox** | In-Browser JS IDE | Live JavaScript code editor to write, test, and benchmark custom scheduling algorithms. |
46+
47+
---
48+
49+
### 3. ⚡ Storage Architecture: HDD vs. NVMe SSD
50+
51+
Toggle between **💽 Mechanical HDD** and **⚡ NVMe SSD**:
52+
- **HDD Mode**: Calculates mechanical seek time + rotational latency ($\approx 4\text{ to } 10\text{ ms}$).
53+
- **SSD Mode**: Demonstrates zero mechanical seek penalty ($\sim 0.04\text{ ms}$ uniform latency via PCIe Gen 4 FTL Controller), illustrating why classical elevator schedulers are replaced with NOOP on solid-state drives.
54+
55+
---
56+
57+
### 4. 📐 CHS ↔ LBA Translation Calculator
58+
Converts between Cylinder-Head-Sector addressing and Logical Block Addressing:
59+
$$\text{LBA} = (C \times \text{HeadsPerCyl} + H) \times \text{SectorsPerTrack} + (S - 1)$$
60+
61+
---
62+
63+
### 5. 🎞️ Interactive Timeline Scrubber & Media Controls
64+
- **Drag-to-Scrub Timeline**: Scrub smoothly through any point in the simulation history like a video player.
65+
- **Playback Suite**: Play, Pause, Next Step, Prev Step, Jump to Start, Jump to End, Reset, and Variable Speed ($1\times \to 5\times$).
66+
67+
---
68+
69+
### 6. 🎙️ Web Speech Voice Narration & Spatial Audio
70+
- **AI Voice Narration (`V`)**: Synthesizes step-by-step vocal explanations in real time using the Web Speech API.
71+
- **Binaural Audio Panning**: Web Audio stereo panner that pans sound left-to-right matching the head's physical cylinder position.
72+
73+
---
74+
75+
### 7. 🎓 Gamified OS Exam Quiz Arena
76+
- Procedurally generated scenario questions testing next-cylinder predictions.
77+
- Multiple-choice cards, streak tracker (`🔥 Streak`), score tracking, and mathematical explanations.
78+
79+
---
80+
81+
### 8. 📄 Homework Solution, Telemetry & Snapshot Exporter
82+
- **📄 Homework Solution (`.md`)**: Full formatted Markdown assignment solution with LaTeX formulas and step tables ready to submit for university coursework.
83+
- **📊 Telemetry Dataset (`.csv`)**: Raw numerical step-by-step dataset.
84+
- **🖼️ Canvas Snapshot (`.png`)**: One-click high-resolution diagram export.
85+
86+
---
87+
88+
### 9. 🌓 Dual Theme Engine
89+
- **Dark Obsidian Glass** (default, glowing neon cyberpunk accents)
90+
- **Light Academic Paper** (clean, high-contrast, classroom projector friendly)
91+
- Instant toggle via Header button or `T` shortcut with `localStorage` persistence.
92+
93+
---
94+
95+
## ⌨️ Keyboard Shortcuts
96+
97+
| Shortcut | Action |
98+
| :--- | :--- |
99+
| <kbd>Space</kbd> | **Play / Pause** animation playback |
100+
| <kbd>←</kbd> | **Previous Step** (Step backward) |
101+
| <kbd>→</kbd> | **Next Step** (Step forward) |
102+
| <kbd>Home</kbd> | **Jump to Start** (Initial head position) |
103+
| <kbd>End</kbd> | **Jump to End** (Complete simulation) |
104+
| <kbd>R</kbd> | **Reset** simulation state |
105+
| <kbd>T</kbd> | **Toggle Theme** (Dark Obsidian ⇄ Light Academic) |
106+
| <kbd>V</kbd> | **Toggle Voice Narration** |
107+
| **Canvas Click** | **Inject I/O Request** at clicked cylinder |
108+
109+
---
110+
111+
## 🚀 How to Run Locally
112+
113+
Because the project is built with **Pure Vanilla Web Technologies**, no build tools or npm package installations are required.
114+
115+
### Method 1: Local HTTP Server (Python)
116+
```bash
117+
python -m http.server 8000
118+
```
119+
Open **[http://localhost:8000/project.html](http://localhost:8000/project.html)** in your browser.
120+
121+
### Method 2: Direct File Open
122+
Double click `project.html` directly in any web browser.
123+
124+
---
125+
126+
## 📜 License
127+
This project is open-source and available under the [MIT License](LICENSE).

0 commit comments

Comments
 (0)