Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

3D File System & Disk I/O Architecture Visualizer

An interactive 3D simulation of Operating System storage architecture and disk I/O mechanics built with Three.js, React, and TypeScript.


🏗️ 3D Layer Architecture

The visualization is split into four horizontally connected layers from top to bottom:

1. Top Layer: Logical Hierarchy (VFS Tree)

  • 3D Node-Link Tree: Represents the directory tree structure (/, /home, /var, /etc, and child files).
  • Holographic Nodes: Directory hubs and file cubes/spheres with glowing halo rings and billboard labels.
  • Interactive Tracing: Clicking any file triggers pointer beams down to its cache slot, inode, and physical data blocks.

2. Layer 1.5: OS Kernel Page Cache (RAM Ring Buffer)

  • Glowing Circular DRAM Ring: 16 Page Cache slots arranged in a circular ring buffer (Y = 7.0) between VFS and Inodes.
  • DRAM Page Slots: Visualizes 4KB kernel memory pages with illuminated statuses:
    • 🟢 CACHED: In-memory clean page; repeated reads hit RAM instantly.
    • 🟡 DIRTY: Modified page waiting for sync flush to physical storage.
    • ⚪ FREE: Available memory page slot.
  • Cache Hit vs Cache Miss Mechanics:
    • Cache Hit: Reading an already cached file completes in 0.001 ms (sub-microsecond) with 1,000,000+ IOPS! The physical disk platter and actuator arm do NOT move. A bright emerald photon pulse travels directly between File Node $\leftrightarrow$ Page Cache Slot.
    • Cache Miss: Cold reads travel all the way down to physical disk blocks, populate the Page Cache via Clock eviction, and subsequent reads hit RAM.
  • Drop Page Cache: Button emulating Linux echo 3 > /proc/sys/vm/drop_caches to flush RAM and observe cold disk reads.

3. Middle Layer: Inode Metadata Table

  • Floating Inode Grid: 48 Inode blocks (6x8 grid) on a glassmorphism pedestal.
  • Attributes: Permissions (-rw-r--r--), ownership (root:root, user:staff), file size, timestamps, and direct/indirect pointer arrays.
  • State Coloring: Cyan glowing blocks for in-use inodes, dim wireframe for free inodes, pulsing cyan when active.

4. Bottom Layer: Physical Storage (HDD Platter vs SSD NAND)

  • HDD 7200 RPM Mode:
    • Rotating metallic platter with 8 concentric track rings and 16 sectors per track (128 total physical sectors).
    • Mechanical actuator arm with voice-coil motor pivot that sweeps across tracks to the target sector radius.
    • Laser diode read/write head tip casting a focused spot on the target sector.
    • Realistic rotational latency (~4.17ms) + seek latency ($\Delta\text{tracks} \times 1.5\text{ms}$).
  • NVMe SSD NAND Mode:
    • Silicon motherboard PCB with memory controller ASIC and 4 parallel flash channels.
    • High-density flash blocks with wear-leveling heatmap counters.
    • Zero mechanical seek latency; parallel channel access with concurrent bus pulses.
    • TRIM / Garbage Collection routines to reclaim dirty/stale pages.

⚡ Visual Mechanics & Animations

  • Pointer Splines: Dynamic 3D Catmull-Rom glowing curves connecting File Node -> Page Cache -> Inode -> Physical Sectors.
  • Animated I/O Packets:
    • 🟢 CACHE HIT Pulses: Stream directly between File Node $\leftrightarrow$ Page Cache RAM Slot in 0.35s with crystal audio chime (Disk Bypassed!).
    • 🔵 CACHE MISS / READ Pulses: Travel up from physical sectors $\rightarrow$ Inode $\rightarrow$ Page Cache $\rightarrow$ File node.
    • 🟠 WRITE Pulses: Stream down from directory $\rightarrow$ Dirty RAM $\rightarrow$ Inode $\rightarrow$ allocate physical sectors.
    • 🔴 DELETE Pulses: Crimson dissolution pulses severing pointers, freeing sectors, and invalidating RAM cache.
  • Defragmentation Routine:
    • Relocates scattered physical blocks into contiguous sector rows in real time.
    • Dynamically updates Inode pointer splines during compaction.
    • Plays celebratory sound chime and confetti!

🕹️ Controls & Navigation

  • Left Mouse Click + Drag: Orbit / Rotate camera smoothly (drag threshold prevents accidental clicks)
  • Right Mouse Click + Drag: Pan camera
  • Mouse Scroll Wheel: Zoom in / out
  • Mouse Click: Select any file, cache slot, inode, or physical sector to inspect and trace
  • Mouse Hover: Floating Inspector Tooltip with hex addresses, page slot details, status, and permissions
  • Camera Presets: Overview, Directory Tree, Page Cache, Inode Table, Storage Surface
  • Audio SFX: Toggleable Web Audio API synthesizer for stepper seeks, laser pulses, cache hit crystal pings, and defrag chords.

🚀 Running the Project

npm install
npm run dev

Open http://127.0.0.1:5173/ in your browser.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages