DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Device driver overview

How drivers are accessed

Driver entry point routines for I/O operations are activated by I/O system calls, as illustrated below. ``DDI 8 entry points and system calls''.

DDI 8 entry points and system calls

The process of calling the appropriate DDI 8 driver routine can be summarized as follows

  1. The I/O system call (such as open() or read()) is directed to a special device file in the /dev directory. The special device file includes an identifier for the driver that controls the device.

  2. The system uses that identifier as an index into its drvops(D4) structure to find the appropriate routine to call. For DDI drivers prior to version 8 and ODDI drivers on SCO OpenServer 5, a system of named entry points and switch tables are used to find the appropriate entry point routine.

  3. The operating system calls the appropriate routine.

A file descriptor returned as part of an open( ) call is mapped internally into the driver instance and channel. The user process uses a file descriptor for the device, and this file descriptor is translated to an instance/channel pair that is used to index the tables during read() and write() syste call operations, and is also made available as arguments to the device's entry points routines that are called in response to a system call request.

Additional entry point routines are defined for specialized interfaces such as STREAMS and SDI. Other structures provide access to these entry points. For example, the STREAMS entry points are accessed through the streamtab(D4str) structure and the entry points for SDI Host Bus Adapters (HBAs) are accessed through the hba_info(D4sdi) structure.

Not all entry points are appropriate for all devices. For instance, a printer driver does not need a read( ) entry point routine. The operating system provides pointers to stub functions in the switch tables for routines that are not included in the driver.


© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005