Log in

View Full Version : The WM5 RAM Disk, compatible with (almost) every WM5 device, is here!


Menneisyys
07-31-2006, 06:16 PM
Anyone having read my articles (see for example this one (http://www.pocketpcmag.com/blogs/index.php?blog=3&p=929&more=1&c=1&tb=1&pb=1)) on the (dis)advantages of the new Windows Mobile 5 operating system know the memory/storage model of the operating system doesn’t at all let for (even temporary) storage kept in the very fast, albeit scarce and volatile dynamic RAM.

RAM disks can help this situation. They allow for allocating some (with current 64 MByte Pocket PC’s) 2…10 Mbytes of RAM (with 128M RAM Pocket PC’s, figures can be entirely different and there can even be 96 Mbyte-big RAM disks) and map it as a stand-alone drive in the file system as if it were a real storage card.

Being a “real” drive letter means it will not only be represented by a subdirectory in the file system (as can be seen in this screenshot (http://www.winmobiletech.com/kuvat/RamdiskDirInFileSystemAndDrive.bmp.png)) but also the standard, built-in CAB (program) installer will offer the ability to install your new apps there as can be seen in this Dell Axim x51v (http://www.winmobiletech.com/kuvat/RamdiskAsInstallTarget.bmp.png) (note that the lack of the “available disk space” is not a bug caused by the RAM disk but the A12 ROM version of x51v itself; without the RAMdisk, it behaves exactly the same way as can be seen in here (http://www.winmobiletech.com/kuvat/x51vInstallAvailableMemNotDisplayed.bmp.png)), HP iPAQ hx4700 (http://www.winmobiletech.com/kuvat/RamdiskAsInstallTarget-hx4700.bmp.png) and HTC Wizard (http://www.winmobiletech.com/kuvat/WizardInstalRamdiskTarget.bmp.png) screenshots.

What do RAM disks offer? For example extracting CAB files or other archives, transferring files from the desktop to the PDA or relocating your Web browser’s cache there. In the next chapter, I elaborate on these questions more thoroughly.

What can be RAM disks used for?

Cache Relocation: You may want to relocate your browser cache directories, particularly now that all Pocket PC browsers that use a local file cache (all of the browsers except for Thunderhawk, Opera Mini and Minimo before version 0.014 (http://www.pocketpcmag.com/blogs/index.php?blog=3&p=651&more=1&c=1&tb=1&pb=1)) have relocatable cache directories. Please see my blog and my old(er) articles on relocating the cache these browsers.

Relocating a browser cache will result in (in cases, dramatic) page loading / switching speed increase, particularly with Web pages containing a lot of diffent, not-yet-cached, small images (flash ROM media is extremely slow for file creation, as opposed to dynamic RAM-based virtual file systems). The dramatic file system load (which isn't a problem if you relocate the cache to a storage card, though) decrease is also a big plus.

All you need to do is relocating the cache to the RAM disk directory (\Ramdisk) and you’re all set.

Software Testing: If you often test new programs on your PDA, you may prefer installing them to dynamic (fast) RAM (if there is enough memory for that) instead of static flash ROM or a storage card. You may already have noticed how slow it can be to install programs into the main storage memory of WM5 devices (or, particularly unoptimized and/or lower-end, storage cards), compared to the lighting-fast speed of earlier operating systems installing to RAM.

The slow install speed can be extremely painful with some applications or games that install hundreds of files like the excellent platformer game SuperTux (http://www.pocketpcmag.com/blogs/index.php?blog=3&p=986&more=1&c=1&tb=1&pb=1), the excellent adventure game Fade or some IR remote controllers (http://pocketpcmag.com/forum/topic.asp?TOPIC_ID=17874). Copying hundreds of (small) files to flash-based media has always been painfully slow even if it’s correctly optimized (as far as memory cards are concerned, see this tutorial (http://pocketpcmag.com/forum/topic.asp?TOPIC_ID=17921) on the latter question). Installing, say, SuperTux (which consists of some 800 files) onto a storage card or in the built-in storage memory of a WM5 device can take minutes, while it only takes some seconds when installed into RAM.

Also, if you temporarily install a new program to a RAM disk instead of the built-in storage, on non-native WM5 devices that are known for lengthy and painful filesys.exe compactions you can entirely avoid the need for (re)compaction. You quickly test the new application and decide whether you need it at all. If you do need it, you can reinstall it to a less volatile memory type; if you don’t need it, just uninstall. No filesys.exe compactions will take place.

Finally, program loading is much faster from a RAMdisk than from any kind of flash memory. This also helps quick testing.

Standard desktop-based software installation: when you install a Pocket PC progam on your desktop, in most cases a CAB file will be transferred to your PDA, in the \Windows\AppMgr\Install directory, so that it can be decompressed on the PDA itself. This directory, however, is in flash ROM and, therefore, even if you install your application on a storage card, using the built-in flash ROM memory for temporary storage purposes will inevitably result in a filesys.exe compaction.

As has already been pointed out in my article, it’s not possible to redirect \Windows\AppMgr\Install to anywhere else (including \Ramdisk). Therefore, it’s highly preferable on a non-native WM5 device to get the CAB install file (by, for example, not letting ActiveSync install it directly on the PDA by disconnecting the Pocket PC before starting the desktop installer and, then, just searching for the CAB file by hand as is explained for example here (http://pocketpcmag.com/forum/topic.asp?TOPIC_ID=14246)), transferring it to \Ramdisk via ActveSync and, then, execute it from there. (Incidentally, you’d have the same effect if you transferred the file to a storage card instead. It, however, requires a storage card and, if done via ActiveSync, is considerably slower than transferring to the RAM disk.) This quarantees no excessive storage flash ROM writing/deletion takes place.

All in all, RAM disks can be used for a lot of things where a soft reset destroying the (volatile) contents of the disk isn’t a problem.

The RAM disk program

There have always been homemade RAM disk solutions for the (hacked) WM5 update for the HTC Blue Angel and Himalaya; most importantly, that of buzz_lightyear available here (http://buzzdev.net/index.php?option=com_remository&Itemid=68&func=fileinfo&id=50) for download and extensively discussed in the same site. Please note that you should NOT use this version on any non- Blue Angel / Himalaya device – it simply won’t work (I’ve tested it on all my three WM5 devices, without any success. Of course, before letting it start, I made sure to decrease the, by default, 32Mbyte-large RAM disk size to something acceptable on a 64M RAM device.)

Other devices, as has been pointed out in my main article on upgraded (non-native) WM5 devices (http://www.pocketpcmag.com/blogs/index.php?blog=3&p=929&more=1&c=1&tb=1&pb=1), so far, haven’t had any kind of RAM disk.

Now, the situation has changed: well-known Pocket PC community member Solnyshok has recompiled the WM5 RAM disk and released a version that is, finally, compliant with (almost?) all the WM5 devices out there, unlike buzz_lightyear’s one-model-only solution. His formal announcement can be found here (http://discussion.brighthand.com/showthread.php?t=224727) (and has also discussed for example here (http://buzzdev.net/component/option,com_simpleboard/Itemid,59/func,view/catid,64/id,23106)).

All you need to do is downloading his ZIP file (note that I’ve also made it available here (http://www.winmobiletech.com/sekalaiset/GenericWM5RAMDisk.zip), just to be on the safe side if for example the server doesn’t work and/or you don’t want to strggle with RapidShare. Note that my ZIP file also contains the .lnk files to be explained later – they don’t need to be copied to \Windows) and putting the two files, ramdisk.dll and ramdisk.exe, into \Windows.

Now, download this (already-linked) file (http://www.winmobiletech.com/sekalaiset/GenericWM5RAMDisk.zip) and copy all the .lnk files from it to, say, \Windows\Start Menu\Programs (or anywhere else) for quick access. With the exception of RamDisk-Unload.lnk, all these link files create a RAM disk (if they can) in the file system.

I’ve created many RAM disk intialization files; you’ll only need to click one of them to create a cache of the given size. For example, if you want a 10 Mbyte large RAM disk (and your Pocket PC is capable of maintaining it), click the RamDisk-10240.lnk link. Shortly after that, a new, \Ramdisk directory (and a new, virtual storage card) should appear in your Pocket PC’s (file) system. If it doesn’t, reset your device and retry (in some cases, particularly with bigger (8-10 Mbyte) RAM disks, you need to soft reset before creating the disk because of, probably, the memory fragmentation, which makes it impossible to allocate memory for the RAM disk.)

Important note: if you put these lnk files under \Windows\Start Menu\Programs, do not put them into a subdirectory named ‘ramdisk’ – the directory may be deleted upon initiating the RAM disk. Any other subdirectory name may be used.

Note that, particularly with bigger (8-10 Mbyte) RAM disks, you may see “bad handle” error messages like this (http://www.winmobiletech.com/kuvat/TooBigRamDisk-HandleInvalid.bmp.png) when trying to copy something to the RAM disk inside the Pocket PC (and simple “can’t upload” messages when trying to do the same from the desktop, via the WinCE file system plug-in of Total Commander (http://pocketpcmag.com/forum/topic.asp?TOPIC_ID=15577)).

If you encounter this, just remove the RAM disk (by executing RamDisk-Unload.lnk) and, then, recreate it. Soft reset won't be necessary.

Problems

The biggest problem with the current version is that it doesn’t survive a soft reset, unlike the HTC Blue Angel / Himalaya version. Solnyshok, however, promises a solution to this.

It, if you don’t store anything valuable on it and/or you don’t soft reset your Pocket PC often, isn’t that big a problem.

Compliance / test result chart

Legend: + stands for working, - stands for non-working.

http://www.winmobiletech.com/kuvat/RAMDiskChart.png

As can be seen, with the HTC Wizard (a.k.a. imate K-Jam, T-Mobile MDA Vario, Qtek 9100, MDA Vario, XDA mini S, SPV M3000, VPA Compact II, Dopod 838), you can’t go over 6M and the two VGA devices, over 10M RAM disk size. I, however, provide the link files for bigger RAM disk sizes too if you want to test them on other models.

It’s also worth noticing how blazingly fast USB (measured via the WinCE file system plug-in of Total Commander) transfer to the RAM disk is (at least two times faster than to the built-in storage / inserted memory cards).