Specifications
Understanding Device Drivers
2-9
1. The system directs the I/O system call (open and read, for exam-
ple) to a special device file. This file includes the major number for
the driver that controls the device.
2. The system uses the major number as an index into its switch tables
to find the appropriate routine to call.
3. The operating system calls the appropriate routine. (Figure 2-3
depicts the between these components.)
Figure 2-3. Switch Table Entry Points and System Calls
When the system does a character-access read or write operation on a device that
supports both block and character access, the driver typically calls its own strategy
routine (through physiock(D3)). The driver references its strategy routine directly,
not through a switch table.
STREAMS drivers contain their own entry points accessed indirectly through the driver's
streamtab(D4) structure.
open
open
close
close strategy
read write ioctl
Device Switch Table(s)
System
Calls
File
Subsystem
Driver
Character Driver
Driver
Entry
Points
Block Driver
open close read write ioctl
buffer cache
calls
Interrupt Handler
Interrupt Vector
Device
mount un-mount read write
160990