Create a RAM Disk in MS-DOS 6.22 Using RAMDRIVE.SYS

This article provides a straightforward guide on how to create a high-speed virtual disk in random-access memory using the native RAMDRIVE.SYS device driver in MS-DOS 6.22. It covers the necessary CONFIG.SYS configuration, syntax parameters for customizing disk size, memory allocation options (extended vs. expanded memory), and verification steps after rebooting.

Prerequisites

Because a RAM disk uses system memory, you should avoid placing it in conventional memory (the first 640 KB), which is needed for running DOS applications. To place the RAM disk in Extended Memory (XMS), ensure that HIMEM.SYS is loaded prior to RAMDRIVE.SYS.

Step 1: Open CONFIG.SYS

To configure the driver, open your CONFIG.SYS file using the MS-DOS text editor:

EDIT C:\CONFIG.SYS

Step 2: Add the RAMDRIVE.SYS Command

Add the DEVICE command line below HIMEM.SYS. The general syntax for RAMDRIVE.SYS is:

DEVICE=[drive:][path]RAMDRIVE.SYS [DiskSize] [SectorSize] [NumEntries] [/E | /A]

Parameter Breakdown:

  • DiskSize: The size of the RAM disk in kilobytes (ranging from 4 to 32767). The default is 64.
  • SectorSize: Sector size in bytes (can be 128, 256, or 512). The default is 512.
  • NumEntries: The maximum number of files and directories in the root directory (ranging from 2 to 1024). The default is 64.
  • /E: Creates the RAM disk in Extended Memory (requires HIMEM.SYS).
  • /A: Creates the RAM disk in Expanded Memory (requires an expanded memory manager like EMM386.EXE).

Step 3: Example Configurations

Example 1: 4 MB RAM Disk in Extended Memory (Recommended)

DEVICE=C:\DOS\HIMEM.SYS
DEVICE=C:\DOS\RAMDRIVE.SYS 4096 /E

Example 2: 8 MB RAM Disk with Custom Parameters Creates an 8192 KB disk with 512-byte sectors and up to 128 root directory entries in extended memory:

DEVICE=C:\DOS\HIMEM.SYS
DEVICE=C:\DOS\RAMDRIVE.SYS 8192 512 128 /E

Example 3: High-Memory Loading via DEVICEHIGH If you load EMM386.EXE with UMB support, you can save conventional memory by loading the driver itself high:

DEVICE=C:\DOS\HIMEM.SYS
DEVICE=C:\DOS\EMM386.EXE NOEMS
DOS=HIGH,UMB
DEVICEHIGH=C:\DOS\RAMDRIVE.SYS 4096 /E

Step 4: Save and Restart

  1. Press Alt + F, select Save, and exit the editor.
  2. Restart your computer by pressing Ctrl + Alt + Delete.

Step 5: Verify the Drive

During boot, MS-DOS displays a message from RAMDRIVE.SYS showing the assigned drive letter:

MS-DOS RAMDrive version 3.07 virtual disk [D:] installed.

The drive letter assigned will be the first available drive letter in sequence. You can now access it like any standard disk (e.g., typing D: and pressing Enter), copy temporary files to it, or use it for your TEMP and TMP environment variables in AUTOEXEC.BAT:

SET TEMP=D:\
SET TMP=D:\

Note: Any data stored in a RAM disk is lost permanently when the computer is restarted or powered off.