When you successfully configure a driver into the kernel, lboot automatically adds members (one for each entry point in the driver) to the cdevsw structure, the character device switch table.
Note: The cdevsw structure is used for character device drivers; a block device driver structure would be named bdevsw. STREAMS drivers, which have user-accessible device nodes, such as /dev/llc2, also belong in the cdevsw structure; STREAMS modules, which have no device nodes, belong in fmodsw. The section of the cdevsw structure that maintains the pointers to the device entry points for a device called drv would look like this:
struct cdevsw cdevsw[] = { { nodevflag, 0, drvopen, drvclose, drvread, drvwrite, drvioctl, drvmmap, drvmap, drvunmap, drvpoll, 0, 0 }, };When the kernel handles a system call, it can find a specific entry point for a device if it constructs the name of the appropriate cdevsw member. For example, if the kernel must handle an open() for a device, drv, the kernel knows that drvopen is the member of csdevsw that contains a pointer to the open routine for the drv device.