RAM disks

A RAM disk is a storage area that exists only in memory but looks like a hard disk.

You can add one to your system by using devb-ram, but this is a RAM disk with the overhead of a block filesystem; by default, it's initialized and formatted for an fs-qnx4.so filesystem (unless you specify the ram nodinit option).

Note: By default, io-blk.so allocates 15% of system RAM for cache. The devb-ram system looks like a disk drive to io-blk.so, so it doesn't know that the cache is unnecessary. You should use the blk cache=512k option to reduce the cache size to the minimum.

A better way of creating a RAM disk is to use the blk ramdisk=... option, which creates an internal RAM disk that io-blk.so does know is RAM and doesn't need to be copied via cache. It uses a 4 KB sector size.

If you already have any other devb-* driver running, then you can simply piggyback the RAM disk on it (by adding, for example, blk ramdisk=10m to the invocation of that devb- driver).

If you really want a separate devb-ram, then it can be the container for an internal RAM disk too, with an invocation like this:

devb-ram ram capacity=1 blk ramdisk=10m,cache=512k,vnode=256

Use the /dev/ram0 device, which is the io-blk.so internal RAM disk. You need to manually dinit it and mount it first. For example:

dinit /dev/ram0
mount -tqnx4 /dev/ram0

This approach has superior performance because it eliminates the memory-to-memory copies of devb-ram, it bypasses cache lookups, and the 4 KB sectors have smaller overheads.