View Full Version : How to compile XP ramdrive.sys (Q257405)
Thorazine
03-04-02, 11:51 PM
Sorry Ken I wasn't sure where to post considering the topic is both a tweak and a security issue.
Can anyone tell me what tools I need to compile this driver for XP? Or where to find the recompiled driver?
Thorazine
03-08-02, 02:24 PM
I'm guessing from the incredible amount of replies to this thread that no one has a clue what I'm talking about.
SavageHrt
03-19-02, 10:39 AM
Sorry for the late reply, but I've been away for awhile. Anyway, I saw your post and decided that this would be a challenge. After reading the article, downloading the driver from Microsoft, and a lot of web searching I finally got a Ramdrive to work in XP. Here's what I did....
1. You don't have to compile the source Microsoft gives you. It's already compiled (you have a file named 'ramdisk.sys and ramdisk.inf) All you have to do is install a new device using the Add Hardware Wizard and manually browse to ramdisk.inf.
2. However, before you do that you should edit ramdisk.inf to reflect what drive letter you want (defaults to Z: ) and how big you want it (max is approx 33MB or 0x01f00000).
3. Once the editing is complete install the driver.
4. Before you reboot check ensure you change the following registry setting:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Fastfat\Start
You need to change it from 4 to 1 (this is a must or it won't work)
5. Reboot
6. Enjoy
If you have any questions please ask.
Sav
Thorazine
03-19-02, 09:34 PM
Awesome!
I figured out how to install the driver, modify the reg with the 32MB size, but I received the "Incorrect Function" error when trying to access the drive. I'll modify the registry with that hack and see how it goes.
I was just trying to follow what was posted in the MSKB article. However, I didn't have a clue as to how to go about compiling the driver.
SavageHrt
03-19-02, 10:34 PM
Let me know what happens...
Sav
Thorazine
03-19-02, 11:11 PM
Changing the FastFat service startup behavior from disabled to system worked like a charm. You rock bro!
monkeyhead
03-20-02, 12:54 AM
yeah that 4 to 1 worked for me too, but now how do i change the size?
i changed it to 32 megs and well it gives me incorrect function
Thorazine
03-20-02, 01:02 AM
It's 32MB in size but 'My Computer' should report the size as 30.9MB. Did you change the DiskSize key in the reg to 01F00000?
Or you could use the decimal equivalent->32505856
monkeyhead
03-20-02, 01:06 AM
33554432
thats what i had as 32 megs....... i'm trying what you gave me now..... what would the decimal equiv be for 64 megs?
Thorazine
03-20-02, 01:13 AM
The MS sample driver is limited to 32 :(
Here's a link to a third-party program that wouldn't work for me before. I haven't tried it with SavageHRT's hack. You might even try to replace the ramdrive.sys in the %systemroot%\system32\drivers folder to see if it will work with more than 32MB if you don't want the little control panel applet.
I haven't fooled with any of this yet so..... have fun.
http://www.arsoft-online.de/products/ramdisk/
SavageHrt
03-20-02, 04:12 AM
I'm pretty sure we can change the default maximum from 32MB to whatever we want by looking in the source code and making the proper changes. The downside to that is that you'll need Microsoft's Driver Development Kit (DDK) in order to compile the source. Unfortunately Microsoft doesn't have it available for download but they do offer it on a CD for no charge (other than the shipping costs).
Thorazine: Thanks for the props but I must admit that isn't my hack. I found it after about 3-4 hours of web searching on some obscure forum. Anyway, I'm glad it worked.
Sav
Thorazine
03-20-02, 02:11 PM
All this business of loading two .sys files at startup that deal with reallocation of memory smells of blue screen if the registry values are problematic. Especially if the driver steps on the toes of other drivers loading. Here I'll describe how to recover your XP machine in the event of the Dreaded Blue Screen of Death in the context of this tweak.
Depending on when the machine blue screens will dictate the appropriate action.
1)
If the machine blue screens BEFORE you log in then the fix may be quite simple. On the next reboot, hit F8 when the XP splash screen appears and choose "Last Known Good Configuration". This will reload the registry values prior to loading the new drivers.
2)
If you monkey with the registry and have already loaded the driver once prior to a blue screen at boot then the top option will not work. This is because once you login to a Windows NT/2K/XP box this is considered a successful configuration and the values are loaded into the CurrentControlSet registry hive.
In a situation like paragraph two. Here's what you need to do. (Hey that rhymed:).
Boot from your install CD or go here to make XP boot disks.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q310994
Boot into the recovery console. (Repair option and then the Recovery Console). You can load the Recovery Console so it appears everytime you boot. This command: winnt32.exe /cmdcons (you have to do this prior to the blue screen)
Use the reg.exe command to change the above keys to disable ramdrive.sys and fastfat.sys. The exact syntax I'm not sure of, if I get a chance I'll edit this thread with it. You should be able to reboot normally now.
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.