mdevice" -- System Administration" "

Describe drivers that can be linked into kernel

/etc/conf/mdevice

File mdevice describes each device driver that can be linked into the COHERENT kernel. The command idmkcoh uses the information in this file when it builds and configures a new kernel.

mdevice contains one line for each driver or kernel component that can be linked into the kernel. Each line, in turn, consists of ten fields. The following describes the ten fields in order, from left to right:

11.. _N_a_m_e
This field gives the name of the driver or component. Each name must uniquely identify the driver or component within the kernel. This field cannot be longer than eight characters.

22.. _F_u_n_c_t_i_o_n _F_l_a_g_s
This field holds a flag for each function (that is, entry point) within the driver or component. This field is used only by drivers or components that use the STREAMS or DDI/DKI interfaces; drivers that use the internal-kernel interface should place a hyphen `-' in this field. The legal flags are as follows:
     oo    Open
     cc    Close
     rr    Read
     ww    Write
     ii    Ioctl
     ss    Startup
     xx    Exit
     II    Init
     hh    Halt
     pp    Poll -- that is, cchhppoollll(())

33.. _M_i_s_c_e_l_l_a_n_e_o_u_s _F_l_a_g_s
These flags give information about the device. They are set by most varieties of driver; the only exception is a STREAMS driver, for which only the flag S matters. The legal flags are as follows:
     cc    Character device
     bb    Block device
     ff    Driver conforms to the DDI/DKI
     oo    Driver has only one entry in //eettcc//ccoonnff//ssddeevviiccee
     rr    Driver is required in all configurations of the kernel
     SS    STREAMS module; or STREAMS device when used with the `c' flag
     HH    Device driver controls hardware
     CC    Driver uses interal-kernel (CCOONN) interface

Note that the `C' flag is unique to COHERENT, and cannot be used under other operating systems.

44.. _C_o_d_e _P_r_e_f_i_x
This gives the ``magic prefix'' by which the kernel identifies the entry-point routines for this driver. In most instances, this is identical with the driver's name.

55.. _B_l_o_c_k _M_a_j_o_r_-_D_e_v_i_c_e _N_u_m_b_e_r
This gives the major-device number of this driver when it is accessed in block mode. In most instances, this and the following field are identical.

66.. _C_h_a_r_a_c_t_e_r _M_a_j_o_r_-_D_e_v_i_c_e _N_u_m_b_e_r
This gives the major-device number of this driver when it is accessed in character (raw) mode. In most instances, this and the preceding field are identical.

77.. _M_i_n_o_r _D_e_v_i_c_e _N_u_m_b_e_r_s_, _M_i_n_i_m_u_m
This gives the smallest number that can be held by a minor-device number under this driver. Most drivers set this field to the lowest legal value, which is zero.

88.. _M_i_n_o_r _D_e_v_i_c_e _N_u_m_b_e_r_s_, _M_a_x_i_m_u_m
This gives the largest number that can be held by a minor-device number under this driver. Most drivers set this field to the highest legal value, which is 255.

99.. _D_M_A _C_h_a_n_n_e_l
This gives the DMA channel by which the device is accessed. Under COHERENT, this is always set to -1.

1100.. _C_P_U _I_D
This gives the CPU that controls this driver, should the driver be running in a multiprocessor environment and be dedicated to a particular processor. Under COHERENT, this is always set to -1.

For an example of modifying this file, see the entry for device drivers.

Example

The following gives some example entries from mdevice:
_1    _2    _3    _4    _5    _6    _7    _8    _9    _1_0
###
# Example of an kernel components:  floating-point emulator and STREAMS
###
em87 -    -    em87 0    0    0    0    -1   -1
streams   I    -    streams   0    0    0    0    -1-1

###
# Example of a STREAMS driver:  note flags `c' and `S' both set in field 3
###
echo -    cSf  echo 0    33   0    255  -1   -1

###
# Example DDI/DKI character driver:  Note that field 2 is initialized.
###
trace     ocriI     cfo  tr   0    34   0    255  -1-1

###
# Example IK driver:  Note flag `C' in field 3
###
at   -    CGHo at   11   11   0    255  -1   -1

See Also