Windows 95 Sound Card DMA Memory Allocation

Windows 95 managed dynamic memory allocation for sound card Direct Memory Access (DMA) channels by using its 32-bit Virtual Machine Manager (VMM) and the Virtual DMA Device driver (VDMAD.VXD). Because legacy ISA sound cards were physically limited to 24-bit addressing and could not cross physical memory boundaries, Windows 95 dynamically allocated physically contiguous, low-memory buffers through protected-mode memory management services, falling back on an automated double-buffering scheme when direct access was impossible.

The Hardware Limitation: ISA DMA Constraints

Most consumer sound cards in the Windows 95 era, such as the Creative Labs Sound Blaster 16 and AWE32, relied on the legacy Industry Standard Architecture (ISA) bus and the motherboard's Intel 8237 DMA controller. This hardware imposed two strict physical limits:

  1. The 16 Megabyte Boundary: The 24-bit address bus limited DMA transfers strictly to the lowest 16 megabytes of physical RAM.
  2. Page Crossing Restrictions: Standard 8-bit DMA transfers could not cross a 64-kilobyte physical page boundary, while 16-bit DMA transfers could not cross a 128-kilobyte boundary.

In the flat, 32-bit virtual memory model of Windows 95, physical memory was non-contiguous, fragmented, and routinely paged above 16 MB. Consequently, sound card drivers could not simply pass user-mode virtual memory addresses to the DMA controller.

Dynamic Allocation via VMM and _PageAllocate

Sound card Virtual Device Drivers (VxDs) relied on the core Windows 95 Virtual Machine Manager to request specialized memory blocks. Rather than standard Win32 dynamic memory APIs, audio drivers used the protected-mode kernel service _PageAllocate.

To satisfy sound card DMA needs, the driver called _PageAllocate with specific bitwise flags:

  • PAGECONTIG: Guaranteed that the pages allocated were physically contiguous in hardware RAM, not merely contiguous in the virtual address space.
  • PAGEPHYS / Specific Physical Limits: Constrained the physical allocation strictly below the 0x00FFFFFF address marker (the 16 MB boundary).
  • Alignment Constraints: Allowed drivers to specify that the base address aligned in a way that prevented the requested buffer size from straddling a 64 KB or 128 KB physical boundary.

If memory was too fragmented to provide a contiguous block under the 16 MB line, the memory manager could dynamically lock, uncommit, or rearrange physical pages to satisfy the request before locking the memory down with _PageLock to prevent the pages from swapping to the hard drive during playback or recording.

The Virtual DMA Device (VDMAD.VXD) and Double Buffering

When an application requested audio playback, the data often originated in an arbitrary memory location—such as high physical memory or fragmented virtual pages. In these cases, Windows 95 utilized VDMAD.VXD to manage the transfer transparently.

If a buffer failed physical hardware requirements, Windows 95 dynamically routed the audio data through an internal DMA buffer:

  1. Windows 95 reserved a small, physical DMA buffer (often configured via the DMABUFFERSIZE entry in SYSTEM.INI, defaulting between 16 KB and 64 KB) located physically below the 16 MB limit.
  2. The sound driver or VDMAD copied a slice of the audio data from high or fragmented application memory into this designated low-memory buffer.
  3. The DMA controller was programmed to read directly from the low-memory buffer.
  4. When the DMA channel triggered a hardware interrupt signaling the end of the block transfer, the driver dynamically copied the next chunk into the buffer, continuing playback seamlessly.

Transition to PCI Bus Mastering

As Windows 95 matured and OEM Service Releases (OSR2) were introduced, PCI audio cards began replacing ISA devices. PCI audio controllers did not use the motherboard’s 8237 DMA channels; instead, they performed PCI Bus Mastering and supported Scatter/Gather operations. For these newer devices, Windows 95 no longer needed to allocate contiguous memory below 16 MB, as the PCI sound card hardware could independently traverse a chained list of fragmented physical memory pages anywhere in the 32-bit address space.