Next | Prev | Up | Top | Contents | Index

User-level SCSI-bus Device Driver

If you must write a driver for a device that conforms to the SCSI standard, you can often use the /dev/scsi/sc* special files and the dslib library of routines and macros to write a user-level program that sends SCSI commands to a device on the SCSI bus.

Although this dslib interface to the SCSI device differs from the IRIX standard device interface and requires that you be familiar with the SCSI protocol, you can typically write this sort of user-level SCSI device driver in a fraction of the time that it takes to write a kernel-level SCSI device driver. As a result, even if your ultimate goal is to write a kernel-level driver for a device, you can write a user-level device driver to test the device and familiarize yourself with its features.

However, there are some limits. For example, quasi-SCSI devices that do not strictly adhere to SCSI standards for reporting errors can cause problems. In earlier IRIX releases, the user-level driver did not support SCSI commands of an unusual length (commands not of grp0, grp1, or grp2 length). IRIX 4.0 and later supports commands of 6-12 bytes, regardless of group. Finally, the dslib routines and macros may be somewhat less efficient (in terms of throughput) than a kernel-level SCSI driver. This lower efficiency may not be a problem when dealing with devices such as scanners and printers. DMA is used for all I/O, just as with kernel SCSI drivers.

IRIX uses the devscsi driver for CDROM ISO-9660 filesystems as well as for HFS (Apple® Macintosh®) and DOS(TM) floppy filesystems.


Next | Prev | Up | Top | Contents | Index