Solved

possible to make a ramdrive using c.

Posted on 2004-04-18
7
220 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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
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

Independent Software Vendors: 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

This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

617 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