RAM Drive

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have to create a ram drive for a project at my university. The RAM drive must be created using either c or c++. I would like to know how I could do this?
 
You can use the MS-DOS based ramdrive.sys in Windows XP by following these steps:

1. Start the Add Hardware Wizard.
2. Click on 'Next' on the 'Welcome' screen of the Hardware Wizard.
3. The Hardware Wizard will scan your machine for new hardware.
4. When it finds no new hardware, say YES, you have the hardware in.
5. Go to the bottom and choose the 'Add a new hardware device' option.
6. Use the 'Install the hardware that I manually select from a List (Advanced)' choice.
7. On the next screen, use the first choice 'Show all devices'. [WAIT!!]
8. From the next screen, choose 'Microsoft' in the list and select the 'RAMdisk Driver'. There is also the
'Have Disk' button - if you click that button, you can manually select ramdisk.inf from C:\WINDOWS\INF
9. Click 'Next' and the Hardware Wizard will install the RAMdisk driver.

That installs the hardware so that it now exists on the system. The next thing is to configure it so as to be
useful. A quick way may be to add this to your registry and see what happens on your machine. I do not know if
this will work for you but I have this in my registry.

Put this into a text file called <whateveryouwant>.reg and click it -> yes

-----start----
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Ramdisk]
"Type"=dword:00000001
"Start"=dword:00000000
"ErrorControl"=dword:00000001
"ImagePath"=hex(2):53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,44,00,\
52,00,49,00,56,00,45,00,52,00,53,00,5c,00,72,00,61,00,6d,00,64,00,69,00,73,\
00,6b,00,2e,00,73,00,79,00,73,00,00,00
"DisplayName"="Ramdisk Driver"

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Ramdisk\Parameters]
"BreakOnEntry"=dword:00000000
"DebugLevel"=dword:00000000
"DebugComp"=dword:ffffffff
"DiskSize"=dword:002e8000
"DriveLetter"="Z:"
"RootDirEntries"=dword:00000200
"SectorsPerCluster"=dword:00000002

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Ramdisk\Security]
"Security"=hex:01,00,14,80,90,00,00,00,9c,00,00,00,14,00,00,00,30,00,00,00,02,\
00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,\
00,00,02,00,60,00,04,00,00,00,00,00,14,00,fd,01,02,00,01,01,00,00,00,00,00,\
05,12,00,00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,\
20,02,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,0b,00,00,00,00,\
00,18,00,fd,01,02,00,01,02,00,00,00,00,00,05,20,00,00,00,23,02,00,00,01,01,\
00,00,00,00,00,05,12,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Ramdisk\Enum]
"Count"=dword:00000001
"NextInstance"=dword:00000001
"0"="Root\\UNKNOWN\\0000"
--------end-------

This ramdrive.sys only supports up to 32 MB but Microsoft also have a sample driver you can download and
modify to suit your specific needs. It was mad for 2000 but should be suitable for XP. This will hopefully get
you to the 256MB you desire but I do not know since I have not used it.
http://support.microsoft.com/support/kb/articles/Q257/4/05.ASP


--
Carey Frisch
Microsoft MVP
Windows XP - Shell/User

Be Smart! Protect your PC!
http://www.microsoft.com/security/protect/
 
----- Hein wrote: ----

I have to create a ram drive for a project at my university. The RAM drive must be created using either c or c++. I would like to know how I could do this

You may take a look at http://www.ramdisk.tk . You will find there a free "enhanced" version of the Microsoft RAMDisk sample, complete with source code, and more ... That version has been corrected to enable to allocate 64 MB instead of 32 MB
 
Back
Top