Additional read/write nonpersistent storage required

If you require write access (perhaps for temporary files, logs, etc.), and the storage doesn't have to be persistent in nature (meaning that it doesn't need to survive a reset), then once again the work is done for you.

The QNX Neutrino RTOS allows the RAM in your system to be used as a RAM-disk, without any additional coding or device drivers. The RAM-disk is implemented via the Process Manager — you simply set up a Process Manager link (using the ln command).

For example, to mount the /tmp directory as a RAM-disk, execute the following command:

ln -Ps /dev/shmem /tmp

Or place the following line in your buildfile (we'll talk about buildfiles over the next few chapters):

[type=link] /tmp=/dev/shmem

This instructs the Process Manager to take requests for any files under /tmp and resolve them to the shared memory subsystem. For example, /tmp/AAA4533.tmp becomes a request for /dev/shmem/AAA4533.tmp.

Note: In order to minimize the size of the RAM filesystem code inside the Process Manager, the shared memory filesystem specifically doesn't include "big filesystem" features such as file locking and directory creation.

If you need a relatively full-featured, POSIX-style filesystem on a RAM disk, use devf-ram or the builtin RAM disk via io-blk instead.