ChorusOS 4.0 Migration Guide

2.1 Multiple RAM Disks

Up to 16 RAM disks are supported by the ChorusOS 4.0 operating system. This number does not include internal RAM disks used as memory banks. Configuration of multiple RAM disks is achieved by modifying the following tunables:

These tunables can be read by the target, but not modified, using the sysctl command. Here are two examples:

To return the value of iom.ramdisk.sizeMax, the maximum size of any RAM disk, type:


$ arun sysctl drv.ramdisk.sizeMax

To return the size of RAM disk a, type:


$ arun sysctl drv.ramdiska.size

See the sysctl(1M) man page for more information.

After defining your RAM disks, you must associate them with a device. This is achieved using the mknod C_INIT command as follows:


$ mknod device_name device_type major_number minor_number 

The device_name is the device name within /dev, device_type is either c for character, or b for block, major_number is the major device number, and minor_number is the minor device number. The minor_number determines what number is allocated to each RAM disk according to the following table:

Table 2-1 RAM Disk Identification

minor_number range

RAM disk number 

0 to 7 

8 to 15 

16 to 23 

24 to 31 

32 to 39 

40 to 47 

48 to 55 

56 to 63 

64 to 71 

72 to 79 

80 to 87 

10 

88 to 95 

11 

96 to 103  

12 

104 to 111  

13 

112 to 119 

14 

120 to 127 

15 

See the mknod(1M) man page for more information.

Here is an example of device definitions for RAM disk 0:

# Devices for RAM disk #0
# must define both block and character modes
# Character mode
mknod /dev/rrd0a c 13 0
mknod /dev/rrd0b c 13 1
mknod /dev/rrd0c c 13 2
mknod /dev/rrd0d c 13 3
mknod /dev/rrd0e c 13 4
mknod /dev/rrd0f c 13 5
mknod /dev/rrd0g c 13 6
mknod /dev/rrd0h c 13 7

# Block mode
mknod /dev/rd0a b 14 0
mknod /dev/rd0b b 14 1
mknod /dev/rd0c b 14 2
mknod /dev/rd0d b 14 3
mknod /dev/rd0e b 14 4
mknod /dev/rd0f b 14 5
mknod /dev/rd0g b 14 6
mknod /dev/rd0h b 14 7

Which partitions you define will depend on which entries you have defined in your /etc/disktab file. See the disktab(4CC) man page for more information.

Here is an example /etc/disktab entry which defines RAM disk rd1Meg with two partitions:

rd1Meg:\
        :ns#4:nt#4:nc#2048 \
        :pa#1024:oa#0:ta=MSDOS: \
        :pb#1024:ob#0:tb=MSDOS: \
        :pc#2048:oc#0:tc=unused:

Your device definition file will look like this:

Devices for RAM disk rd1Meg
# must define both block and character modes
# Character mode
mknod /dev/rrd0a c 13 0
mknod /dev/rrd0b c 13 1

# Block mode
mknod /dev/rd0a b 14 0
mknod /dev/rd0b b 14 1

Label the RAM disk using the disklabel command:


$ arun disklabel -w rd0 rd1Meg

Format the partitions as follows:


$ arun newfs_dos /dev/rrd0a
$ arun newfs_dos /dev/rrd0b

Finally, to mount the partitions, do the following:


$ mount -t msdosfs /dev/rd0a /mnt/a
$ mount -t msdosfs /dev/rd0b /mnt/b

See ChorusOS 4.0 File System Administration Guide for more information on RAM disks.