Solved

possible to make a ramdrive using c.

Posted on 2004-04-18
7
219 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

734 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