Driver for RAM disk interface (QNX Neutrino)
devb-ram [cam option[,option]...] [disk option[,option]...] [ram option[,option]...] [blk option[,option]...] &
Neutrino
The devb-ram driver creates a RAM disk interface. When the capacity option isn't specified, devb-ram creates a 2 MB RAM disk.
By default, devb-ram partitions the RAM disk, leaving one block for the partition table itself, and making the remainder of the RAM disk (capacity minus 1) a t77 partition, which it then initializes (internally, not by spawning dinit) to have a blank fs-qnx4.so filesystem on it. If you specify the nodinit option, you can later manually format it, optionally partition the RAM disk with fdisk (but you can make the whole thing a filesystem), and then mount it.
Because devb-ram is a block device which reads from and writes to RAM, its operations go through a lot of layers before they actually get to RAM. For a RAM disk with better performance, use the blk ramdisk=... option to io-blk.so. For more information, see "RAM disks" in the Connecting Hardware chapter of the QNX Neutrino User's Guide.
Create a 4 MB RAM drive:
devb-ram ram capacity=8192 &
The devb-ram driver causes io-blk.so to adopt various block special devices under /dev. These devices are normally named hdn, where n is the physical unit number of the device.
This driver could also require the following shared objects:
Binary | Required |
---|---|
cam-disk.so | For RAM disk access. |
libcam.so | Always |
The devb-ram driver terminates only if an error occurs during startup, or if it has successfully forked itself upon startup because it hadn't been initially started in the background.
While there's no limit to the size of a disk or partition, the limit on I/O (i.e., the lseek(), read() and write() functions) depends on the type of filesystem mounted and on whether you use the 32- or 64-bit versions of these functions. This I/O limit has no effect on the partition size for mounted filesystems. The maximum number of blocks is 232.
Known supported functions include:
chmod(), chown(), close(), closedir(), creat(), devctl(), dup(), dup2(), fcntl(), fpathconf(), fstat(), lseek(), mkdir(), mkfifo(), mknod(), open(), opendir(), pathconf(), read(), readdir(), readlink(), rewinddir(), rmdir(), stat(), symlink(), unlink() (not supported for directories), utime(), write()
Note that certain calls (such as pipe(), as well as read() and write() on FIFOs) may require the pipe manager.