Solaris devices are represented by device nodes. These are under a device path hierarchy in the /devices directory . Entries are linked to /dev to give a more meaningful and simplier name. When Solaris is installed, package SUNWcsd gets installed. This contains the core Solaris device nodes,(in /devices with symbolic links to /dev), required for the initial boot of Solaris after install.
Any additional device nodes and symbolic links are created by the devfsadm command, which is run when boot -r is specified. Device nodes are created with the major number mapped to the correct driver as listed in the file /etc/ name_to_major . For example:
/dev/dsk/c0t0d0s2 is linked to /devices/pci@1/scsi@8/sd@0,0:c .
If you perform a long list of this device, the major number is listed as 32 . Checking /etc/ name_to_major , 32 is mapped to sd so this device will use the sd driver. The names of the drivers listed in this file tend to be aliases for the real name as defined in /etc/driver_aliases. For example, for qfe network cards, qfe is an alias for SUNW,qfe.
The driver is intially assigned a major number when the add_drv command is run. If a new device previously not supported is added, the kernel module can be dynamically loaded into the kernel as follows:
1. Add the module to one of the following as appropriate: o /platform/`uname -i`/kernel o /platform/`uname -m`/kernel o /kernel o /usr/kernel 2. Run add_drv to assign a major number 3. Run devfsadm to create the device nodes
Solaris will load the required drivers at boot time because the ufsboot program is a filesystem aware bootloader. This means it can find the required modules on disk before the root filesystem is mounted.
At boot OBP probes the hardware to create an in memory hardware topology that's passed to the kernel.
To ensure existing devices remain the sam across reboot, /etc/path_to_inst is checked. This maps 'geographical' device name to an instance number and driver alias. The instance number also maps to the device minor number (the device driver can convert instance numbers to minor numbers).
Kernel mode programs use the device instance number, user mode programs use the major/minor numbers.
Driver parameters can either be defined in /etc/system or /kernel/drv/ module.conf .