Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


mrjrt

Gavotte's Ramdisk automation package

Recommended Posts

Hello all. I've been using this site as a reference for quite some time and figured I should probably give something back. No idea if anyone will find it useful or not, but here it is, regardless.

 

Basically, I've been tweaking away on a final customised XP install so I never have to fiddle with the d**n thing again and when I need it, it'll be ready. To this end, I've done a fair bit of tweaking and integrating, but there were a few things that I didn't spot cropping up anywhere, so here they are. I'll separate them into multiple posts to keep things coherent.

 

Handy tidbit #2 - Automating ramdisk management of Gavotte's ramdisk (and friends)

I want to make use of the RAM in my machines, even when running XP for whatever reason. I found out about the "unmanaged memory" techniques et al., and after much (much) faffing around, I settled on Gavotte as it offered the behaviour and configuration I needed in the most minimal package.

 

I have attached the package I have built to run during my setup. It installs a service that will run at startup and will check and configure the ramdisk with a swap and temp directory on it, and will set up the various junctions to point at it so you don't have to use a drive letter. It will cache the initial state of the built ramdisk in the registry so it will start up faster next time.

 

Now, I've made it very configurable, but I've only fully tested it in my use case, namely, no drive letter, and temp and swap on it where possible. Did I mention, it looks how much RAM you have installed and only moves swap to the ramdisk where it makes sense to? (i.e. > 4GB). I've tested this exhaustively in vmware by adjusting memory amounts - it should handle any sizes (fingers crossed!).

 

As I started to mention, it's pretty configurable. There's a reg file in there with the default values that you can add, and then easily change (i.e. if you don't want any temp management, change the NOTEMP reg value from 0x0 to 0x1...or indeed, anything other than 0x0).

 

It also has some desktop.ini files hardcoded in there with icons you probably won't have. I should probably make those easier to change with out fiddling with the script, but I'm pretty sick of fiddling with this thing now, so I'll leave that as an exercise for the user.

 

As part of this project, I needed devcon.exe and srvany.exe, neither of which are redistributable, so if I wanted to share, I had to find alternatives. Well, I found that Microsoft have made devcon a sample bit of code that, if I read the license correctly, I can redistribute, if I compile it myself and maintain all copyright notices. You can find the original source here. I've fixed it up to compile under my old copy of VS2008 on XP, and it works a treat. I'll package that up some other time if anyone asks. As for srvany, that was a bit harder, but I found an open source reimplementation of it here. This required a fair bit of fixing up to make drop-in compatible with the stock version, but it now is. Again, I'll package up that source when someone asks.

 

The complied binaries for both are naturally in the 7z SFX executable attached. I don't really have the time to support any of these properly, but let me know and I'll do what I can. I just figured it was better to share something rather than nothing. :) Thanks to you all for the help you unknowingly have been giving me.

 

EDIT: for anyone worried about opening strange EXEs (and well you should!), I've attached the raw 7z archive...though you could just open the exe in 7z if you liked ;)

RAMDISK - Gavotte - 1.0.4096.5 - 20081113 - x86.7z

RAMDISK - Gavotte - 1.0.4096.5 - 20081113 - x86.exe

Edited by mrjrt
  • Upvote 2

Share this post


Link to post
Share on other sites

Wow!  clapping.gif

Great contribution, thanks! :yes:

 

So, here's a little addition to it (attached): a version of the Gavotte readme.txt fully in (maybe somewhat broken) English, as a pure ASCII text file, and the MS-LPL as plain text.

TXTs.7z

Share this post


Link to post
Share on other sites

First thing thanks for your thingies. :)

Of course *anyone* would be interested to a redistributable version of devcon :yes:, if you could publish it as a standalone it would be nice.

About srvany, though you already nicely solved the issue :thumbup, I can recommend using instead of it the NSSM:
https://nssm.cc/
but having an alternative is always a good thing.

jaclaz

Share this post


Link to post
Share on other sites

Of course *anyone* would be interested to a redistributable version of devcon :yes:, if you could publish it as a standalone it would be nice.

 

Fair enough, devcon.exe attached. My understanding of the license is I only need to include it with the source, which is obviously available upon request. But, just in case, it's reproduced in full here, in the spoiler below, for easy reference

MICROSOFT LIMITED PUBLIC LICENSE version 1.1

This license governs use of code marked as “sample” or “example” available on this web site without a license agreement, as provided under the section above titled “NOTICE SPECIFIC TO SOFTWARE AVAILABLE ON THIS WEB SITE.” If you use such code (the “software”), you accept this license. If you do not accept the license, do not use the software.

1. Definitions

The terms “reproduce,” “reproduction,” “derivative works,” and “distribution” have the same meaning here as under U.S. copyright law.

A “contribution” is the original software, or any additions or changes to the software.

A “contributor” is any person that distributes its contribution under this license.

“Licensed patents” are a contributor’s patent claims that read directly on its contribution.

2. Grant of Rights

(A.) Copyright Grant - Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.

(B.) Patent Grant - Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.

3. Conditions and Limitations

(A.) No Trademark License- This license does not grant you rights to use any contributors’ name, logo, or trademarks.

(B.) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.

(C.) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.

(D.) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.

(E.) The software is licensed “as-is.” You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.

(F.) Platform Limitation - The licenses granted in sections 2(A.) and 2(B.) extend only to the software or derivative works that you create that run directly on a Microsoft Windows operating system product, Microsoft run-time technology (such as the .NET Framework or Silverlight), or Microsoft application platform (such as Microsoft Office or Microsoft Dynamics).

Devcon.exe

Share this post


Link to post
Share on other sites

One last important caveat I neglected to mention above.

 

When using this, System Restore, being a bit rubbish, gets upset. It really doesn't like ramdisks AFAICT. It also really hates it when you have reparse points pointing to other drives that may not be present 100% of the time. I've tried adding the junction points to system restore's exclusions list in the registry, but it still seems to monitor them, even if only to then ignore the changes.

 

Anyone who figures out how to get it to either not follow reparse points and/or actually ignore directories in the exclusions list, please do let me know. Personally, I don't use it so it's no loss to me, but I've picked up that for some reason people do seem to use it, so be warned.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...