请教QNX下RAMDISK的设置

请问QNX下可以设置虚拟硬盘吗?现在我的系统没有硬盘但是需要在上电情况下存一些东西,当然这些东西掉电后允许丢失。

devb-ram

能说的具体些吗?如何配置,虚拟磁盘映射到什么地方,谢谢。

例, alloc 4M RAM drive from main memory.
devb-ram ram capacity=8192
mount /dev/hd0t77 /fs/ramd0

mount /dev/hd0t77 /fs/ramd0?ram盘怎么会变成/dev/hd0t77

devb-ram

Driver for RAM disk interface (QNX Neutrino)


You must be root to start this driver.




Syntax:


devb-ram [cam option[,option]…]
[disk option[,option]…]
[ram option[,option]…]
[blk option[,option]…] &


Runs on:

Neutrino

Options:

\

Use commas (,) to separate the options. You can put the cam, disk, ram,
and blk groups of options in any order.




cam options

quiet
Be quiet: don’t display any information on startup.
verbose
Be verbose.


disk options

The disk options control the driver’s interface to cam-disk.so. If
specified, they must follow the disk keyword. For more information, see
cam-disk.so.

ram options

The ram options control the driver’s interface to RAM:

address=addr
The physical address to overlay. The default is not to overlay.
blksize=size
Set the sector size. The default is 512 bytes.
capacity=blocks
Specify the capacity of the RAM drive in the blocks of the size
specified by the blksize option. The default is 4096 blocks (2 MB).
nodinit
Don’t partition the RAM disk or format a QNX 4 filesystem on it.


blk options

The blk options control io-blk.so. These options must follow the blk
keyword and must be specified after any general or disk options. For
more information, see io-blk.so.

Description:

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.

Examples:

Create a 4 MB RAM drive:

devb-ram ram capacity=8192 &


Files:

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.soFor RAM disk access. libcam.soAlways

Exit status:

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.

0
The devb-ram driver wasn’t started in the background and therefore
forked itself. The original process terminated with a zero exit status,
the forked process continued.

0
An error occurred during startup.


Caveats:

While there’s no limit to the size of a disk or partition, I/O (i.e. the
lseek(), read() and write() functions) is currently limited to 2
gigabytes per partition (or disk). This I/O limit has no effect on the
partition size for mounted filesystems.

#ls /dev
一般有hd0,hd0t79之类的东西,代表硬盘。然后
#devb-ram ram capacity=8192 &

#ls /dev
应该多了hd1,hd1t77之类的东西,代表虚拟出新的硬盘了。再
#mount /dev/hd1t77 /newhd
就可以用了。