|
| 1 | +# 💽 Disk Scheduling Simulator & OS Storage Architecture Lab |
| 2 | + |
| 3 | +[](https://opensource.org/licenses/MIT) |
| 4 | +[](#) |
| 5 | +[-brightgreen.svg)](#) |
| 6 | +[](#) |
| 7 | +[](#) |
| 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