read data character-by-character
void prefixread (dev_t dev);
entry point routine
initiates and supervises the raw I/O data transfer
from the character device to the user data area.
When the device being accessed is a true character device
(rather than a block device being accessed
in raw mode through the cdevsw table),
the transferred data is usually buffered by the driver.
For example, using the tty structure
to get a cblock, the
functions handle character driver buffering.
Drivers for low-speed character devices
such as terminals and printers
perform semantic processing of data.
These drivers typically use the
clist data structure
and the TTY subsystem to perform buffering.
These transfer data in and out
of the user data area.
Drivers for high-speed character devices
such as network interface boards
generally set up their own buffering schemes.
Block devices usually include a
routine to support raw I/O for the device.
The logic for these routines is:
Extract the minor device number for use by
when performing physical I/O.
Check the minor device number against
the information in the
If it is improper, use the
function to issue an error message,
u.u_error to ENODEV, and return.
For disk devices,
get the size of the device from a local driver array of disk sizes.
to ensure that the I/O is correct for the device size.
This routine calls
which then calls
to perform the raw I/O.
Context and synchronization
The driver can block and can do operations such as
that require access to
the requesting process's user-level address space.
1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp
SVR5 DDI compatibility
entry point routine provides similar functionality
for DDI versions prior to DDI 8,
although note that the syntax is different.
DDI 8 drivers use the
entry point routine instead of
Drivers that contain a
routine must have a r in the second column of the
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005