Creating a Ramdisk in WEC 2013

On this page there’s a reference to generating a Ramdisk to use as mass storage - is there a link more details on how to achieve this using the standard Vybrid WinCE image? There are a few links floating around the web, but they’re mostly out of date or require the use of System Generator.

Made a little progress through trial and error and piecing together scraps from the web, but would still appreciate feedback. So far, the steps are:

  1. Via Control Panel → System → Memory, drag the memory slider to allocate how much RAM to use as storage.
  2. Work out what the amount of memory is as a percentage of the whole and edit to the registry to make it persistent, as per https://developer.toradex.com/knowledge-base/set-memory-division
  3. Update the following registry keys:

.

[HKEY_LOCAL_MACHINE\SYSTEM\StorageManager\Profiles\RAMDisk]
"DefaultFileSystem"="FATFS"
"Name"="RAMDisk"
"MountHidden"=dword:00000000
"AutoMount"=dword:00000001
"AutoFormat"=dword:00000001
"AutoPart"=dword:00000001
"folder"="MyRamDisk"

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\RamDisk]
"Key"="Drivers\\BuiltIn\\RamDisk"
"Flags"=dword:00000004
"Dll"="ramdisk.dll"
"Prefix"="DSK"
"FriendlyName"="RAM Disk Driver"
"Order"=dword:00000000
"Ioctl"=dword:00000004
"Profile"="RAMDisk"
"index"=dword:00000009
"Size"=dword:02b02000

[HKEY_LOCAL_MACHINE\SYSTEM\StorageManager\AutoLoad\RAMDisk]
"LoadFlags"=dword:00000001
"DriverPath"="Drivers\\BuiltIn\\RamDisk"
"BootPhase"=dword:00000000

After this, the Ramdisk and visible and exhibits the expected behaviour; the question is, is this a clean way of doing it and are any steps or registry keys missing?

Dear @Monomix

You got quite far. Actually, you defined too many settings, now you have two ways to tell the driver to get loaded. I’m not sure whether this duplication could lead to problems:

  1. Though the [HKLM\Drivers\Builtin] and
  2. Through [HKLM\SYSTEM\StorageManager\AutoLoad].

As there are already most RamDisk settings present in the default image, the minimum set of settings you need to add is:

[HKEY_LOCAL_MACHINE\Drivers\BlockDevice\RAMDisk]
"Key"="Drivers\\BlockDevice\\RAMDisk"
"Flags"=dword:00000004
"Size"=dword:01000000

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\RAMDisk]
"Folder"="RamDisk"

[HKEY_LOCAL_MACHINE\SYSTEM\StorageManager\AutoLoad\RAMDisk]
"DriverPath"="Drivers\\BlockDevice\\RAMDisk"

Regards, Andy