Device Driver Tutorial

Adding, Updating, and Removing a Driver

Use the add_drv(1M) command to make the installed driver usable. Be sure you are user root when you use the add_drv(1M) command.

# add_drv mydriver

The following events take place when you add a driver:

The file /etc/driver_aliases might be updated. The /etc/driver_aliases file shows which devices are bound to which drivers. If a driver is not listed in the /etc/driver_aliases file, then the Solaris OS does not load that driver or attach to that driver. Each line of the /etc/driver_aliases file shows a driver name followed by a device name. You can search this file to determine which driver is managing your device.

Note –

Do not edit the /etc/driver_aliases file manually. Use the add_drv(1M) command to establish a device binding. Use the update_drv(1M) command to change a device binding.

The example drivers shown in this book manage pseudo devices. If your driver manages real hardware, then you need to use the -c and -i options on the add_drv(1M) command or the -i option on the update_drv(1M) command. To specify a device class or device ID, you might find the following sites useful. This information also is useful to search the /etc/driver_aliases file to find out whether a device already is supported.

Use the update_drv(1M) command to notify the system about attribute changes to an installed device driver. By default, the update_drv(1M) command reloads the hardware configuration file for the specified driver. Use the prtconf(1M) command to review the current configuration information for a device and driver. For example, the -D option shows which driver manages a particular device. The -P option shows information about pseudo devices.

Use the rem_drv(1M) command to update the system driver configuration files so that the driver is no longer usable. The rem_drv(1M) command does not physically delete driver files. If possible, the rem_drv(1M) command unloads the driver from memory.