Solved

possible to make a ramdrive using c.

Posted on 2004-04-18
7
218 Views
Last Modified: 2010-04-15
is it possible to create a ramdrive using c that can be used in dos or windows.
if so then how?

thanks
ico2
0
Comment
Question by:ico2
  • 3
  • 2
  • 2
7 Comments
 
LVL 9

Expert Comment

by:ankuratvb
ID: 10857602
>create a ramdrive...

Can you please elaborate.
0
 
LVL 1

Author Comment

by:ico2
ID: 10858548
how can i get a program to allocate space in the memory to be treated as a hard disk???
0
 
LVL 9

Expert Comment

by:ankuratvb
ID: 10859794
Both a hard disk and your RAM are hardware devices.

If you want persistent storage,you can use files and store them on the hard disk.
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 7

Expert Comment

by:aib_42
ID: 10860066
ico2,

It is possible indeed. A ramdrive, very briefly, is a disk driver that acts as though it were using a real device, only using system memory for storage.

However, creating a ramdrive for DOS and for Windows are quite different problems. Well, maybe not.
Here's the catch: Microsoft's RAMDRIVE.SYS, which originally came with DOS, as you know is a good example of a ramdrive driver (hmm?), but it does not work with 2000+. Obviously, any driver code you wrote for Windows 2k and beyond would not work in DOS.

If you are looking to write a ramdrive for Windows 2k and beyond, here is a good sample driver with source from MS itself:
http://download.microsoft.com/download/win2000ddk/sample01/1/NT5/EN-US/Ramdisk.exe

A ramdrive for DOS wouldn't probably be too long as in lines of code, or even too hard if you have a good DOS documentation.

For Windows 95/98/ME... well, try and see if MS's drive above works.
0
 
LVL 9

Expert Comment

by:ankuratvb
ID: 10860111
Is this something like virtual memory?
If that is the case,would it be persistent?
0
 
LVL 1

Author Comment

by:ico2
ID: 10860543
i need this to work in ms-dos mostly but it would be useful to get it to work in win98 as well.
how do i use ramdrive.sys?

ankuratvb: it is the opposite of virtual memory.
0
 
LVL 7

Accepted Solution

by:
aib_42 earned 20 total points
ID: 10862008
The RAMDRIVE.SYS is basically a DOS device driver (which works in 98 btw), so you have to put something like the following in your CONFIG.SYS file:

DEVICE=C:\WINDOWS\COMMAND\RAMDRIVE.SYS <size>

The actual syntax is:
DEVICE=[drive:][\path\]RAMDRIVE.SYS [Disk_size [Sector_size [Num_entries]]] [/A | /E]
as can be noted in
http://users.cybercity.dk/~bse26236/batutil/help/RAMDRI_S.HTM
and
http://www.lagmonster.org/docs/DOS7/v-ramdrive-sys.html

I forgot to mention, MS's ramdrive has a 32MB size limitation (32767 is the max for the "size" parameter), but there are plenty of alternatives around (Going on www.simtel.net and typing "ramdisk" in the upper right search box reveals about 10)
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question