RAM Drive on Win98???

I had used a RAM drive quite some time ago (Win 3.1) and have recently come to a situation where I would like to use one again.

Can you do this in Win98? How?

I saw a note in the Win95 forum where the answer was supposedly yes for Win95 and that you needed to create an entry in the config.sys of (for example):

device=C:\windows\randrive.sys 8192 512 256

This is roughly what I remember from Win 3.1, but when I tried it on Win98 I didn't get a drive, so the question is "Can it be done and how?".  If so, what are the parameters needed and allowed?
Gene KlamerusTechnical ArchitectAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Here ya go klamerus!

In your config.sys file

files=10 (whatever setting you choose)
buffers=10 (whatever setting you choose)
devicehigh=ramdrive.sys /E 2048

You'll find the current version of Ramdrive.sys on your Windows 98 Boot Disk.


here's a program that will do it for you, let you assign the drive letter and how much RAM to use


over course, you'll need winzip
Gene KlamerusTechnical ArchitectAuthor Commented:
Well, that's half the answer (or perhaps more), but it raises some more questions.

1 - I don't have a config.sys.  I can create one, but since I don't have one, my thought would be that nothing is going to read it.

2 - What good will the other items in your config.sys do on my Win98 (which doesn't have DOS, I'm think).  For instance, files=10 refers to allowed open filehandles, etc.  Do I need to have all these for the ramdrive to work, or is this simply your config.sys which happens to have them?

3 (and last) - what are the allowed parameters for ramdrive.sys now?  I would expect /E = extended memory like before and /A = expanded memory.  What about the arguments for # of allowed files in RAM drive root directory, etc?

If you can answer these, I'll even boost the points
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Klamerus, I can answer your questions, which I have done below, but really using a ramdrive within the Win98 user interface somewhat defeats the way Win98 runs normally. Actually you would be causing a massive drain on Windows resources for very little, if any, benefit.

First, ramdrive doesn't support long files names, as it is a MS-DOS utility, not a 16bit or 32bit Windows utility.

Second, by incorporating ramdrive, you are blocking physical memory that Windows would rely upon and would then run into out of memory errors. Win 3.X ran fine this was as it was predominantly MS-DOS based, Win9X is entirely different.

Ramdrive, like I mentioned above, is a DOS utility, which is why I mentioned the config.sys file, as this is normally where it is called (or invoked). You can still call it from your config.sys, however I suppose I could show you how to call it from either your registry or an INI file as long as you thoroughly understand that doing so could result in a Win98 crash.

The file handle issue, again, goes back to the fact that Ramdrive.sys is a dos utility, which is why I included it. Are they needed in Windows, no, but in DOS they are, as are the stacks and buffer calls and loading dos high.

The /E and /A parameters date back to DOS versions 5.0 and earlier when Ramdrive was a convenient way to speed up taskswapping, which isn't necessary in Win9X. Windows 95 relies on, in part, MS-DOS 7.X and I believe that Win98 is at 8.X. Neither of these are required.

Unlike any version of Win9X, Windows 3.X could use Ramdrive.sys, but it also relied upon an ini statement of swapdisk= in order to swap files between extended memory and workspace memory. This is not supported in any Win9X versions.

The maximum value for RAMDRIVE.SYS is 32 MB minus 1K, which comes out to 32,767 kilobytes. However, when HIMEM.SYS is being used as an XMS provider, RAMDRIVE.SYS can be no
larger than 16 MB. This is due to a limitation in HIMEM.SYS. This leads to my earlier comment as to why would you want to do this as Win9X has virtually no such limits.

The values for files, or "NumEntries" is a minimum of 2, a maximum of 1024 and a default of 64.

Here's an article you may find interesting:
PSS ID Number: Q142546
Article last modified on 05-18-1999
The information in this article applies to: - Microsoft Windows 95
Windows 95 uses memory differently than earlier versions of Windows. If you
encounter unusual random problems in Windows 95 that you did not experience in
an earlier version of Windows, your computer may have faulty memory. This
article describes how to use a RAM drive to test the memory in your computer and
what to do if this does not solve the problems you are experiencing.
Microsoft RAMDrive is a memory-resident program that lets you use part of your
computer's RAM as if it were a disk drive. By creating a RAM drive that uses
most of your computer's physical RAM, you may be able to isolate the memory
problem to a particular memory chip. To create a RAM drive using Windows 95,
perform the following steps:
1. Restart your computer. When you see the "Starting Windows 95" message, press
   the F8 key, and then choose Command Prompt Only from the Startup menu.
2. Use any text editor, such as Edit.com, to add the following line to the
   Config.sys file
   device=<path>\ramdrive.sys <x> /E
   where <path> specifies the location for Ramdrive.sys and <x> is
   equal to the total amount of RAM (converted from megabytes to kilobytes)
   minus 4096 (4 megabytes are required for Windows 95 to start). For example,
   if you installed Windows 95 on drive C in a folder called Windows and your
   computer has 16 megabytes (MB) of RAM, add the following line:
   device=c:\windows\ramdrive.sys 12288 /E
   The value 12288 is derived from the following formula using the example
   (16 * 1024) - 4096 = 12288 bytes
   NOTE: The Ramdrive.sys line must follow the Himem.sys line, or the RAM drive
   may not function.
   NOTE: Windows 95 is limited to a 16-MB RAM drive. For additional information,
   please see the following article in the Microsoft Knowledge Base:
   Q126448 Err Msg: Not Enough Extended Memory Available to Start...
3. Save the Config.sys file and then restart your computer normally.
4. If the problems no longer occur, halve the value for <x> in the
   Config.sys file and restart your computer. Repeat these steps until the
   problem returns. Once it returns, the faulty RAM is in the area that you most
   recently removed from the RAM drive. Contact your hardware manufacturer about
   replacing this memory.
5. If the problems persist, there may be a problem in the memory above the high
   memory area (HMA) that Ramdrive.sys is not using. To test the memory above
   the HMA (starting at 1088K), remove Ramdrive.sys from the Config.sys file and
   add the following line to the Config.sys file
   device=<path>\himem.sys /int15=<x>
   where <path> specifies the location for Himem.sys and <x> is equal
   to the total amount of RAM you want to exclude from Windows 95's use. For
   example, the line "device=c:\windows\himem.sys /int15=4096" prevents Windows
   95 from using the section of memory from 1088K to 5184K (or roughly the first
   4 MB of RAM above conventional memory + the UMA + the HMA). If the problems
   no longer occur, this memory needs to be replaced.
If you continue to have problems, one of the following situations may exist:
 - The problems may be caused by memory within the 1088K of RAM that the
   RAMdrive and HIMEM statements cannot reserve for Windows 95. To test this,
   try new memory modules or switch the order of the RAM modules in your
   computer. If you are unfamiliar with this process, Microsoft recommends that
   you contact your hardware manufacturer for assistance.
 - The problems may be caused by CPU cache RAM. Many new processors implement a
   method of optimization that uses motherboard and internal CPU cache RAM to
   increase performance and optimize data and code execution. This cache is used
   to offset the number of direct reads that are performed against main memory
   for frequently used data and code.
   To test this, disable the internal and external CPU cache. For information on
   how to do this, please read your hardware documentation or contact your
   hardware manufacturer.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Gene KlamerusTechnical ArchitectAuthor Commented:
Well that's enough information.

I've experimented a bit with this and may just have to toss in the towel.  Although the various notes I've read indicate that you "should" be able to create a drive of up to ~32 MB, as soon as I go past ~5,000 MB Win98 fails to fully come up, so apparently, RAM drives are not only poorly supported, they're now pretty much broken.  I have 288 MB of RAM in my laptop, and I would like to "donate" 20-30 MB of it to working storage when I'm in Win98.  When I'm booted into NT I need all I can get for DBs, etc., so I wouldn't use it there.  I will be checking out the pointer from 1cell however.

There are good reasons to use RAM Drives, despite the fact that the the O/S caches.  For one thing, they make a very good workarea.  For instance, if you have a MSVC project with 20-30 files (sources, includes, etc.) and are in a mode where you need to recompile frequently, RAM drives are very handy, especially if you use the same drive for your TEMP directories.  When I go through re-compiles in such a scenario, my speeds are a fraction of what they are when the files are on a hard drive.

Another reason is drives on laptops are notoriously slow.  In fact, at one point, we found it was actually faster to use DriveSpace because it was faster to read less bytes from the drive and do the decompression, than it was to read uncompressed data.  This was a while ago.

I might play with a RAM drive as a service, or in one of the *.INI files. I'll have to experiment to see if that helps with the lock-ups during startup.  The timing or when the drive is created may be the issue.

Anyway, this has been an interesting weekend experiment, but nothing I really need, it was just an idea.
You may want to try and push it as high in the upper memory area as possible and stay away from the first 64Mb of memory and see what happens.
Gene KlamerusTechnical ArchitectAuthor Commented:
The program XMKDSK.EXE mentioned above works great!

It creates drives very fast, can create huge drives (I'm using 50 MB, but I tried 100 MB just for grins), I can specify the drive letter and it will create from the top of memory if desired.

As to the value of using a RAM Drive, a relatively new book from Oreilly has come out on optimizing Windows that describes some of the reasons for having a RAM Drive.  The books actual name claims its for optimizing Windows for games, graphics, & multimedia, but it really doesn't hit those areas specifically at all.  It's very good and covers most of the tricks I know, but a few I didn't know of.
Thanks for the info, its appreciated!
Gene KlamerusTechnical ArchitectAuthor Commented:
That was a typo:

The program is XMSDSK.EXE - it's a bit hard to get, but worth having.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows OS

From novice to tech pro — start learning today.