DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
HDK Technical Reference

Character device drivers

Character device drivers may transfer data between a user-level process and the device using any scheme other than the system buffer cache. Character drivers control devices such as network cards, terminal devices, printers, and specialized devices such as robots, medical devices, and retail sales devices.

On SCO OpenServer 5 and for DDI versions before version 8, character device drivers used the read(D2) and write(D2) entry point routines for doing the actual I/O transfer rather than using the strategy(D2) entry point routine used by block device drivers.

DDI implementation

See the table in Intro(D2) for a listing of the entry point routines required in character drivers written for DDI versions prior to version 8.

Beginning with DDI 8, all drivers use the biostart(D2) entry point routine for I/O transfers, and there is no structural difference between block and character device drivers. The device special files or nodes in the /dev directory are still marked as block or character, however.

ODDI implementation

Character driver entry-point routines Section D2oddi manual pages contains manual pages for the ODDI entry point routines. The following table summarizes the entry points used in ODDI character drivers.

Type Routine Purpose
entry point open(D2oddi) start access to a character device
  close(D2oddi) end access to a character device
  read(D2oddi) transfer data from internal buffers to user space
  write(D2oddi) transfer data from user space to internal buffers
  ioctl(D2oddi) perform I/O control commands
device-specific init(D2oddi) initialize the device when it is booted
  halt(D2oddi) executed when the computer is shut down
  intr(D2oddi) executed when an interrupt occurs
  start(D2oddi) interact directly with the device
  poll(D2oddi) executed on each clock tick
  proc(D2oddi) perform device-dependent line discipline I/O
  probe(D2oddi) defines the device for the Device Query Interface

For more information about writing SCO OpenServer 5 character device drivers, see Chapter 3 of Peter Kettle and Steve Statler, Writing Device Drivers for SCO UNIX.


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