How to Set Up a RAM Disk on FreeDOS
Configuring a RAM disk with the built-in RAM driver — a fast, volatile drive letter backed by memory, useful for temporary files and disk-heavy tasks.
A RAM disk presents a portion of system memory as an ordinary DOS drive letter — dramatically faster than physical disk access, at the cost of losing everything on it the moment the system powers off or reboots.
Step 1: decide how much memory to allocate
Consider available conventional/upper/extended memory
(check with MEM first) before choosing a size — allocating
too much leaves too little for applications afterward.
Step 2: load the RAM disk driver in CONFIG.SYS
DEVICE=C:\FREEDOS\RAM.SYS 1024 /E
This creates a 1024KB (1MB) RAM disk. The /E flag places it in extended memory rather than conventional memory — almost always the right choice, since conventional memory is by far the scarcer resource.
Step 3: reboot and confirm the new drive letter appeared
DIR
The RAM disk appears as the next available drive letter after your existing physical drives and partitions.
Step 4: format the RAM disk (often required before first use)
FORMAT E: /Q
Some RAM disk driver versions require an explicit format before the drive is usable; others initialize it automatically — check for a “drive not formatted” error as the signal you need this step.
Step 5: use the RAM disk for temporary files
SET TEMP=E:\
SET TMP=E:\
Redirecting TEMP/TMP environment variables to the RAM disk speeds up any application or utility that writes temporary files heavily during operation, since those writes now hit memory instead of physical disk.
Step 6: copy frequently-accessed files to the RAM disk for a session
COPY C:\DATA\*.DAT E:\
For a task that repeatedly reads the same set of files, copying them to the RAM disk once per session and working from there can meaningfully speed up disk-bound workloads — particularly noticeable on genuinely old, slow physical disk hardware.
Step 7: remember to copy anything important back before shutting down
Everything on the RAM disk disappears completely at power-off or reboot — this is not a backup location, and there’s no warning prompt reminding you to save work off of it before shutting down.
Step 8: adjust the size later if needed
DEVICE=C:\FREEDOS\RAM.SYS 2048 /E
Changing the size requires editing CONFIG.SYS and rebooting — there’s no way to resize a RAM disk live while the system is running.
Why /E (extended memory) is almost always the right choice over conventional memory
Given how scarce and valuable conventional memory already is for actually running applications, backing a RAM disk with extended memory instead avoids competing with the exact resource most DOS-era software is already tightly constrained by. The only reason to use conventional memory for a RAM disk would be a system genuinely lacking extended memory entirely — an increasingly rare case even on fairly old hardware.
Where the RAM disk concept in DOS actually started
RAM disks aren’t a FreeDOS-era addition — IBM added the first one, VDISK.SYS, to PC DOS 3.0 back in August 1984, notably the very first DOS component to make use of extended memory at all. Because VDISK.SYS was IBM’s own code rather than Microsoft’s, it never shipped in Microsoft’s own MS-DOS; Microsoft instead wrote an equivalent, RAMDRIVE.SYS, included starting with MS-DOS 3.2 in 1986 and carried forward through MS-DOS 5, 6.x, and even Windows 95/98/Me’s underlying DOS layer. FreeDOS’s RAM.SYS is a from-scratch reimplementation of that same, by-then decades-old and thoroughly proven concept, rather than a new idea — the /E extended-memory option this guide uses traces directly back to that original 1984 IBM design goal of keeping RAM disk allocation out of scarce conventional memory.
Sizing it against what you’re actually trying to speed up
A RAM disk sized smaller than the working set it’s meant to hold doesn’t help — a build process or dataset that doesn’t fully fit ends up partially on the RAM disk and partially back on physical disk, losing much of the speed benefit while still carrying the “everything here vanishes on reboot” risk. Size the RAM disk to comfortably fit the specific temporary files, build artifacts, or dataset you’re targeting, rather than picking a round number and hoping it’s enough.
Watching for a RAM disk that silently competes with your other memory needs
Because a RAM disk backed by extended memory draws from the same pool HIMEM.EXE and EMM386.EXE manage, an oversized RAM disk on a memory-constrained machine can leave too little extended memory for whatever else depends on it — a memory manager, another application expecting XMS, or a second RAM disk you’d forgotten was also configured. Running MEM after adding or resizing a RAM disk, the same way you would after any other CONFIG.SYS change, confirms the tradeoff you’re actually making rather than discovering it only when something else unexpectedly runs short.
Related:
- FreeDOS Memory Management: Conventional, Upper, and Extended Memory
- How to Build a TSR-Aware Batch Menu System on FreeDOS
Sources: