Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

possible to make a ramdrive using c.

Posted on 2004-04-18
7
Medium Priority
?
225 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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 80 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

670 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