ChorusOS 5.0 System Administrator's Guide

Special Device Driver Files

This section reviews the special device driver files required for file system support.

If your target is an NFS client only (all its files are physically located on another system, such as the host workstation), you can skip this section.

What Special Files Are

The ChorusOS system requires you to use special(7S) device driver files to access the hardware devices where file systems reside. This means that disk labeling and other operations on uninitialized and unmounted file systems must be done using special files.

Each disk partition corresponds to at least one special file. Unless you plan to use a raw partition directly -- without a file system-- you must be able to access each partition in both block (buffered) mode and raw (character) mode, so you must create not just one special file per partition, but two. Each special file:

Naming Conventions for Special Files

Special files normally reside in the /dev directory, which is mounted at boot time. By convention, special file names follow the form /dev/rsuffix for raw (character) mode and /dev/suffix for buffered (block) mode. See also "Supported Devices".

The suffix is made up of:


Caution - Caution -

Special care must be taken with partition c. Partition c represents the whole disk and therefore must not be used to support a file system.


Because file systems are based on BSD 4.4 as implemented in FreeBSD 4.1, the same limitations found in FreeBSD 4.1 apply to ChorusOS file system management. According to limitations imposed by FreeBSD, a disk can be divided into a maximum of eight different partitions for IDE and SCSI devices, two partitions for RAM and flash devices. Partitions can be left undefined. Partitions are named using a single character in the range from a to h, each letter corresponding to one of the eight partitions for IDE and SCSI devices. For RAM and flash devices, only partitions a and c are available.


Note -

The ChorusOS operating system differs from FreeBSD 4.1 in that the latter does not distinguish between raw devices and block devices. With the ChorusOS operating system both forms of special files are retained for backward compatibility. It is recommended to use the block device.


Creating Special Files

You create special files using mknod(1M) on the ChorusOS system. Generally, you create the special files you need at boot time by including commands in the system initialization file, sysadm.ini(4CC).


Note -

Unlike earlier releases that used special device driver files created on the host, the ChorusOS operating system only lets you create special files on the target.

Previous releases allowed you to create special files on the host because no /dev directory was available at boot time. As the ChorusOS product mounts a /dev directory at boot time, it is no longer necessary to create special files on the host.


Creating Special Files at Boot Time

To create special files at boot time using the sysadm.ini(4CC) file embedded in the system image, follow this procedure:

  1. Change to the directory containing sysadm.ini:


    host% cd build_dir/conf
    
  2. Include commands of the following form in sysadm.ini using the C_INIT(1M) built-in command mknod(1M):

    mknod /dev/name [b|c] maj_nbr min_nbr
    

    where name follows the pattern described in "Naming Conventions for Special Files", b represents a buffered (block) device, c represents a character (raw) device, maj_nbr is the major number of the device and min_nbr is the minor number of the partition on the device. The following table lists memory devices by major number:

    Major Number 

    Device 

    Mode 

    ISA/IDE disk

    character (raw) and block (buffered) 

    CD_ROM disk

    character (raw) 

    Flash device 

    character (raw) and block (buffered) 

    SCSI disk

    character (raw) and block (buffered) 

    13 

    RAM disk

    character (raw) and block (buffered) 

    15 

    SCSI CD-ROM

    character (raw) 

    23 

    BPF

    character (raw) 

    24 

    NVRAM

    character (raw) 

    Note that RAM disk devices used for memory banks conventionally have major numbers 11 and 12 and are used internally by the system to make the contents of the memory banks, including the system image, available for use at boot time.

  3. Build the system image to include modifications to sysadm.ini:


    host% cd ..
    host% make system_image_name
    
Creating Special Files Manually

To create special files manually on a running ChorusOS target system:

    Run commands on the target of the type:


    host% rsh target mknod dev/name [b|c] maj_nbr min_nbr
    

    Where name follows the pattern described in "Naming Conventions for Special Files", b represents a buffered (block) device, c represents a character (raw) device, maj_nbr is the major number of the device and min_nbr is the minor number of the partition on the device.