How Windows 95 VCACHE Handled Disk Read Buffering
Windows 95 introduced a major architectural evolution in PC storage performance by replacing the legacy, real-mode MS-DOS caching system with VCACHE, a fully integrated 32-bit protected-mode virtual device driver. Operating alongside the 32-bit Installable File System (IFS) Manager, VCACHE managed system disk read buffering by dynamically sizing memory buffers and eliminating the performance bottlenecks associated with real-mode transitions. This article examines the internal architecture of VCACHE, how it coordinated with block device drivers, and how it optimized read requests through dynamic allocation and intelligent read-ahead buffering.
The Shift from SMARTDrive to 32-Bit VCACHE
In Windows 3.x and MS-DOS, disk caching relied heavily on SMARTDrive, a real-mode or 16-bit protected-mode TSR (Terminate and Stay Resident) utility. SMARTDrive required a static allocation of extended or expanded memory reserved at boot time, which wasted system memory when disk activity was low and starved the operating system of RAM. Furthermore, whenever Windows 3.x executed disk I/O, the CPU frequently had to switch between 16-bit protected mode and 16-bit real mode to service standard MS-DOS interrupts (such as INT 21h and INT 13h), generating heavy CPU overhead.
Windows 95 eliminated these bottlenecks by moving the entire storage stack into 32-bit flat protected mode. VCACHE operated as a native Virtual Device Driver (VxD) that resided within the kernel ring 0 memory space, enabling seamless communication between the VFAT file system, the IFS Manager, and disk hardware controllers without ever dropping into real mode.
Integration with the Installable File System (IFS)
VCACHE did not operate in isolation; it sat directly beneath the IFS Manager. When an application executed a file read request (via Win32 APIs or virtualized Win16/DOS interrupts), the IFS Manager parsed the request and handed it off to the file system driver, such as VFAT.
Instead of routing the read request directly to the physical storage hardware, the file system queried VCACHE first. VCACHE maintained a hash table of recently accessed disk sectors. If the requested data resided in the cache buffer (a cache hit), VCACHE fulfilled the read request by copying the blocks directly from kernel memory to the application's memory space, bypassing the physical hard drive entirely.
Dynamic Buffer Allocation
A defining feature of VCACHE's 32-bit architecture was dynamic cache allocation. Rather than locking down a fixed block of RAM like its predecessors, VCACHE worked in tandem with the Windows 95 Virtual Memory Manager (VMM):
- Elastic Memory Sizing: VCACHE expanded its buffer pool when physical RAM was free and disk activity was high, maximizing read hit rates.
- On-Demand Release: When applications required more physical memory, the Virtual Memory Manager instructed VCACHE to flush and shrink its buffer pools, freeing memory pages to avoid excessive paging to the swap file.
- Block Allocation: Memory was managed in 4 KB cache blocks (matching the x86 paging architecture), which allowed effortless translation between virtual memory addresses and disk sectors.
Read-Ahead and Prefetch Optimization
VCACHE substantially improved physical disk read throughput through an intelligent read-ahead algorithm designed for sequential data access. When VCACHE detected sequential read patterns:
- Prediction: It anticipated that subsequent sectors would soon be requested by the running thread.
- Asynchronous Prefetching: It instructed the 32-bit I/O Subsystem (IOS) and disk port drivers (such as ESDI_506.PDR) to load sequential disk sectors into cache buffers ahead of execution.
- Latency Reduction: By the time the application dispatched the subsequent read instructions, the sectors were already present in RAM, effectively hiding physical disk seek and rotational latency.
Through direct 32-bit hardware driver access, dynamic memory management, and read-ahead heuristics, VCACHE transformed disk read buffering in Windows 95 into a scalable, high-throughput subsystem that minimized CPU overhead and maximized storage responsiveness.