Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

devlinks(1M)

disks(1M)

drvconfig(1M)

kernel(1M)

modinfo(1M)

ports(1M)

rem_drv(1M)

tapes(1M)

driver.conf(4)

system(4)

ddi_create_minor_node(9F)

add_drv(1M)

NAME

add_drv − add a new device driver to the system

SYNOPSIS

add_drv [ −b basedir ] [ −c class_name ] [ −i ’identify_name...’ ] [ −m ’permission’,’...’ ] [ −n ]

device_driver

AVAILABILITY

SUNWcsu

DESCRIPTION

The add_drv command is used to inform the system about newly installed device drivers. 

OPTIONS

−b basedir Sets the path to the root directory of the diskless client.  Used on the server to execute add_drv for a diskless client.  The client machine must be rebooted to install the driver. 

−c class_name The driver being added to the system exports the class class_name. 

−i ’identify_name’ A white-space separated list of aliases for the driver device_driver.

−m ’permission’ Specify the file system permissions for device nodes created by the system on behalf of device_driver.

−n Do not try to load and attach the driver, just modify the system configuration files for the device_driver.

EXAMPLES

The following example adds the SUNW,example driver to the system, with an alias name of SUNW,alias.  It assumes the driver has already been copied to /usr/kernel/drv. 

example# add_drv −m ’∗ 0666 bin bin’,’a 0644 root sys’ \
−i ’SUNW,alias’ SUNW,example

Every minor node created by the system for the SUNW,example driver will have the permission 0666, and be owned by user bin in the group bin, except for the minor device a, which will be owned by root, group sys, and have a permission of 0644. 

The following example adds the driver to the client /export/root/sun1.  The driver is installed and loaded when the client machine, sun1, is rebooted. 

example# add_drv −m ’∗ 0666 bin bin’,’a 0644 root sys’ \
−i ’SUNW,alias’ -b /export/root/sun1 \
SUNW,example

This second example produces the same result as the first, except the changes are on the diskless client, sun1, and the client must be rebooted for the driver to be installed. 

EXIT CODES

add_drv returns 0 on success and 1 on failure. 

FILES

/kernel/drv boot device drivers, platform-dependent drivers. 

/usr/kernel/drv other drivers that could potentially be shared between platforms. 

/etc/driver_aliases driver aliases file. 

/etc/driver_classes driver classes file. 

/etc/minor_perm minor node permissions. 

/etc/name_to_major
major number binding.

SEE ALSO

devlinks(1M), disks(1M), drvconfig(1M), kernel(1M), modinfo(1M), ports(1M), rem_drv(1M), tapes(1M), driver.conf(4), system(4), ddi_create_minor_node(9F)

Writing Device Drivers

NOTES

Aliases may require quoting (with double-quotes) if they contain numbers. 

BUGS

add_drv will accept a full pathname for device_driver. However, the kernel does not use the full pathname; it only uses the final component and searches the internal driver search path for the driver. This can lead to the kernel loading a different driver than expected.

For this reason, it is not recommended that you use add_drv with a full pathname.  See kernel(1M) for more information on the driver search path. 
 

SunOS 5.5/x86  —  Last change: 13 Feb 1995

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026