Skip to content

Latest commit

Β 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’½ Disk Scheduling Simulator & OS Storage Architecture Lab

A Next-Generation Interactive Operating Systems Simulator & Hardware Physics Suite

GitHub stars GitHub forks License: MIT Pure Vanilla JS Zero Dependencies


⚑ Live Demo β€’ πŸ“– Documentation β€’ 🧠 Algorithms β€’ ⏱️ Hardware Physics β€’ πŸ‘¨β€πŸ’» Developed By


🌌 Overview

The Disk Scheduling Simulator & OS Storage Architecture Lab is an interactive, browser-based computer science laboratory designed to visualize, benchmark, and teach Operating System Storage Subsystems.

Bridging the gap between classical theoretical algorithms and real-world storage hardware, it simulates both Mechanical Magnetic Hard Disk Drives (HDDs) (with rotating platters and actuator arm kinematics) and NAND Flash NVMe Solid State Drives (SSDs) (with uniform zero-seek Flash Translation Layer controllers).

  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚                         SIMULATOR ARCHITECTURE                          β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ πŸŽ›οΈ CONFIG & SPECS β”‚     πŸ–₯️ MULTI-VIEW ENGINE      β”‚  πŸ“Š LIVE TELEMETRY  β”‚
  β”‚ β€’ 11 Schedulers   β”‚  β€’ 🎯 1D Linear Physical Track β”‚  β€’ Total Seek Cyl   β”‚
  β”‚ β€’ Direction Toggleβ”‚  β€’ πŸ“ˆ 2D Trajectory Seek Graphβ”‚  β€’ Seek Latency ms  β”‚
  β”‚ β€’ Drive RPM (5.4k-β”‚  β€’ πŸ’½ Concentric 2D Platter   β”‚  β€’ Rotational Delay β”‚
  β”‚   15k RPM)        β”‚  β€’ πŸ’½ 3D Cylinder Multi-Stack β”‚  β€’ Access Time ms   β”‚
  β”‚ β€’ HDD vs. SSD Modeβ”‚  β€’ ⚑ NVMe SSD NAND Die Grid  β”‚  β€’ Head Reversals   β”‚
  β”‚ β€’ Preset Workloadsβ”‚  β€’ 🐧 Linux Kernel Multi-Queueβ”‚  β€’ Live Progress    β”‚
  β”‚ β€’ Live I/O Stream β”‚  β€’ πŸ’» In-Browser JS Sandbox   β”‚  β€’ Step Math Proof  β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🌟 Complete Feature Matrix

πŸŽ›οΈ 1. Eleven Scheduling & Linux Kernel Algorithms

  • Classical OS Schedulers:
    • FCFS (First-Come, First-Served)
    • SSTF (Shortest Seek Time First)
    • SCAN (Elevator Algorithm β€” β†— High / ↙ Low Directional)
    • C-SCAN (Circular SCAN with rapid return)
    • LOOK (Optimized Elevator reversing at boundary requests)
    • C-LOOK (Circular LOOK)
    • F-SCAN (Dual-Queue Freeze SCAN preventing starvation)
    • N-Step SCAN (Batched SCAN with configurable batch size $N$)
    • User Custom Sequence (Raw input trace verification)
  • Modern Linux Kernel Schedulers:
    • Linux Deadline Scheduler: Separate Read FIFO ($500\text{ ms}$) and Write FIFO ($5000\text{ ms}$) expiration queues alongside a sorted sector dispatcher.
    • Linux CFQ (Completely Fair Queuing): Multi-process round-robin time-slicing across concurrent processes (MySQL vs Backup vs Video).
    • Linux NOOP / None: Pure FIFO request merging with zero sorting overhead (the gold standard for NVMe SSDs).

πŸ–₯️ 2. Seven Interactive Multi-Dimensional Visualizers

Mode Name Visual Experience & Physical Details
🎯 1D Linear Track High-DPI physical track with glowing magnetic head pointer (H), color-coded request nodes, seek arcs, and interactive tooltips.
πŸ“ˆ 2D Seek Graph OS textbook-style coordinate chart plotting Time Steps ($Y$-axis, top-to-bottom) vs. Cylinder Number ($X$-axis, left-to-right).
πŸ’½ Concentric 2D Platter Kinetic rotating magnetic platter ($0 \to \text{Max}$) with a mechanical actuator arm pivoting its read/write head tip over tracks.
πŸ’½ 3D Cylinder Stack Isometric stack of 3 platters (6 surfaces: Head 0 to Head 5) with a synchronized multi-head actuator comb demonstrating CHS addressing.
⚑ NVMe SSD Flash Array 4-channel, 16-die NAND Flash cell array demonstrating Flash Translation Layer (FTL) wear-leveling and zero mechanical seek penalty.
🐧 Linux Kernel Lab Real-time multi-queue visualization showing Read FIFO, Write FIFO, and Sorted Dispatcher queues.
πŸ’» In-Browser JS Sandbox Integrated Monaco-style JavaScript code editor allowing students to write, execute, and test their own custom scheduling algorithms.

⚑ 3. Storage Hardware Architecture: Mechanical HDD vs. NVMe SSD

Toggle between πŸ’½ Mechanical HDD and ⚑ NVMe SSD with one click:

  • Mechanical HDD Mode:
    • Accurately models physical actuator arm acceleration ($2.0\text{ ms startup} + \Delta C \times 0.15\text{ ms/cyl}$) and rotational delays across $5400$, $7200$, $10000$, and $15000\text{ RPM}$ spindles.
  • NAND Flash NVMe SSD Mode:
    • Demonstrates why classical elevator schedulers are bypassed on SSDs in favor of NOOP/none, showcasing uniform $\sim 0.04\text{ ms}$ latency across arbitrary logical block addresses.

πŸ“ 4. CHS ↔ LBA Translation Calculator

Built-in live mathematical translator converting between Cylinder-Head-Sector (CHS) and Logical Block Addressing (LBA): $$\text{LBA} = (C \times \text{HeadsPerCyl} + H) \times \text{SectorsPerTrack} + (S - 1)$$


🎞️ 5. Interactive Drag-to-Scrub Timeline & Voice Narration

  • Video-Style Scrubber: Drag continuously through the seek history to inspect head positions at any micro-step.
  • AI Voice Narration (V): Live Web Speech API voice synthesis announcing each cylinder seek.
  • Binaural Stereo Audio: Web Audio stereo panner that pans sound left-to-right matching the head's physical cylinder position.

πŸŽ“ 6. Gamified OS Exam Quiz Arena

  • Procedurally generated university exam questions testing next-cylinder predictions.
  • Multiple-choice cards, streak tracker (πŸ”₯ Streak), score tracking, and mathematical step explanations.

πŸ“„ 7. Homework Solution & Data Export Suite

  • πŸ“„ Homework Solution (.md): Full formatted Markdown assignment report with LaTeX formulas, seek distance tables, and final metrics ready to submit for university coursework.
  • πŸ“Š Telemetry Dataset (.csv): Raw numerical step-by-step dataset.
  • πŸ–ΌοΈ Canvas Snapshot (.png): One-click high-resolution diagram export.

πŸŒ“ 8. Dual Theme Engine

  • Dark Obsidian Glass (Cyberpunk neon glow, default)
  • Light Academic Paper (High-contrast, classroom projector friendly)
  • Toggle instantly via Header button or T shortcut with localStorage persistence.

🧠 Supported Scheduling Algorithms Comparison

Algorithm Type Time Complexity Starvation Risk Directional Best Use Case
FCFS Classical $\mathcal{O}(N)$ None (100% Fair) No Light, sequential workloads
SSTF Classical $\mathcal{O}(N^2)$ High (Boundary Starvation) No Batch workloads with clustered requests
SCAN Classical $\mathcal{O}(N \log N)$ None Yes (β†— / ↙) High-load shared HDD servers
C-SCAN Classical $\mathcal{O}(N \log N)$ None Yes (β†— / ↙) Systems requiring uniform wait times
LOOK Classical $\mathcal{O}(N \log N)$ None Yes (β†— / ↙) General-purpose desktop HDDs
C-LOOK Classical $\mathcal{O}(N \log N)$ None Yes (β†— / ↙) High-throughput server workloads
F-SCAN Classical $\mathcal{O}(N \log N)$ None Yes (β†— / ↙) High dynamic arrival environments
N-Step SCAN Classical $\mathcal{O}(N \log N)$ None Yes (β†— / ↙) Systems prone to arm stickiness
Linux Deadline Linux Kernel $\mathcal{O}(N \log N)$ Guaranteed None Yes Real-time & database servers (MySQL)
Linux CFQ Linux Kernel $\mathcal{O}(P \times N)$ None Round-Robin Multi-user & desktop Linux systems
Linux NOOP Linux Kernel $\mathcal{O}(N)$ None No NVMe SSDs, Flash, & Virtual Disks

⏱️ Hardware Drive Physics & Latency Equations

Disk access time is calculated using the official Operating Systems physics formulation:

$$\text{Total Access Time } (T_{\text{access}}) = T_{\text{seek}} + T_{\text{rotational}} + T_{\text{transfer}}$$

1. Seek Time ($T_{\text{seek}}$)

The time required for the mechanical actuator arm to position the read/write head over the desired cylinder track: $$T_{\text{seek}} = T_{\text{startup}} + (\Delta C \times \text{Seek Rate})$$

  • Default: $2.0\text{ ms startup} + (\text{Seek Cylinders} \times 0.15\text{ ms/cyl})$

2. Average Rotational Latency ($T_{\text{rotational}}$)

The average time for the requested disk sector to rotate under the read/write head (equivalent to half a rotation): $$T_{\text{rotational}} = \frac{1}{2} \times \left(\frac{60}{\text{RPM}}\right) \times 1000\text{ ms}$$

Spindle Speed (RPM) Category Average Rotational Delay
5,400 RPM Laptop / Power-Saving HDD 5.56 ms
7,200 RPM Desktop Standard HDD 4.17 ms
10,000 RPM VelociRaptor High-Performance 3.00 ms
15,000 RPM Enterprise SAS / Server HDD 2.00 ms

⌨️ Keyboard Shortcuts

Shortcut Action
Space Play / Pause animation playback
← Previous Step (Step backward)
β†’ Next Step (Step forward)
Home Jump to Start (Initial head position)
End Jump to End (Complete simulation)
R Reset simulation state
T Toggle Theme (Dark Obsidian ⇄ Light Academic)
V Toggle AI Voice Narration
Canvas Click Inject I/O Request at clicked cylinder/sector

πŸš€ How to Run Locally

Because the project is built with Pure Vanilla Web Technologies, zero build tools or npm package installations are required.

Method 1: Local HTTP Server (Python)

python -m http.server 8000

Open http://localhost:8000/project.html in your browser.

Method 2: Direct File Open

Double click project.html directly in any modern web browser.


πŸ‘¨β€πŸ’» Developed & Maintained By

PRIYA RANJAN

Full-Stack Engineer & Systems Architecture Enthusiast

GitHub Repository


Crafted with ❀️ and precision for Operating Systems education and computer engineering students worldwide.


πŸ“œ License

This project is licensed under the MIT License β€” see the LICENSE file for full details.


⭐ If you find this project helpful for your Operating Systems studies or coursework, please consider starring the repository!

About

πŸ’½ Operating system storage architecture & disk kinematics simulator β€” 60 FPS HTML5 Canvas visualizer benchmarking 11 algorithms.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages