Introduction

About This Guide

This manual, the IRIX Device Driver Programming Guide, provides information and procedures for developing, installing, and testing UNIX® device drivers for IRIX™ 5.2, 5.3, and 6.0.

Based on Writing Device Drivers for Silicon Graphics Workstations (007-0910-010), first published in 1989, the current version contains numerous corrections and updates as well as information for new platforms and operating systems.

The IRIX Device Driver Reference Pages , contain all the reference pages (man pages) relevant to writing user-level and kernel-level device drivers. (See “Related Documentation” and “Reference Material”for ordering information.)

Audience

This manual is a guide to writing device drivers for Silicon Graphics® workstations and servers. It is intended for experienced C programmers and C++ programmers who have a good working knowledge of the architecture of Silicon Graphics computer systems.

Further information and support are available through the Silicon Graphics Developer Program. For information on program membership, please contact the Developer Response Center at (800) 770-3033 or (415) 390-3033, or send email to devprogram@sgi.com.

Document Overview

This guide contains the following chapters and appendices:

Chapter 1, “Introduction to Device Drivers,” introduces basic concepts of devices and provides information on the system hardware/software.

Chapter 2, “Writing a Device Driver,” describes the general interface for both user-level and kernel-level device drivers and introduces the various device driver models.

Chapter 3, “Writing a VME Device Driver,” describes the VME-bus and explains how to write user-level and kernel-level VME device drivers.

Chapter 4, “Writing an EISA Device Driver,” describes the EISA-bus interface and explains how to write user-level and kernel-level EISA device drivers.

Chapter 5, “Writing a SCSI Device Driver,” describes the SCSI-bus interface and explains how to write user-level and kernel-level SCSI device drivers.

Chapter 6, “Writing Kernel-level GIO Device Drivers,” describes the GIO-bus interface and explains how to write kernel-level GIO device drivers.

Chapter 7, “Writing Kernel-level General Memory-mapping Device Drivers,” explains how to write kernel-level general memory-mapping device drivers.

Chapter 8, “Writing Multiprocessor Device Drivers,” addresses questions about device drivers that run on multiprocessor workstations.

Chapter 9, “Writing Network Device Drivers,” addresses questions particular to device drivers that run on networked workstations.

Chapter 10, “Driver Installation and Testing,” describes symmon, the kernel debugger, and explains how to use it.

Chapter 11, “Kernel-level Dynamically Loadable Modules (DLMs),” describes how kernel modules can be loaded dynamically.

Appendix A, “System-specific Issues,” provides information on various CPUs and platforms. It addresses, among other topics, the differences in data cache invalidation, write buffer flushing, and VME addressing.

Appendix B, “SCSI Controller Error Messages,” lists common error messages.

Appendix C, “Device Driver Migration Notes,” gives the information required to make earlier IRIX device drivers compliant with releases 5.2, 5.3, and 6.0.

The Glossary contains definitions of some useful terms for device driver writers; the Index provides another set of entry points to the material in this manual.

Related Documentation

  • GIO Bus Specification, Version 2.1, Silicon Graphics, Inc.

  • IRIX Device Driver Reference Pages , Silicon Graphics, Inc., document number 007-2183-003

  • MIPSpro Porting and Transition Guide, Silicon Graphics, Inc., document number 007-2391-001

  • STREAMS Programmer's Guide, Version 1.0, Silicon Graphics, Inc., document number 007-0833-020

Reference Material

  • ANSI standards X3.131-1986, 1014-1987, and X3T9.2/85-52 Rev 4B.

  • Egan, Janet I., and Thomas J. Teixeira. Writing a UNIX® Device Driver. John Wiley & Sons, 1992.

  • Heinrich, Joseph. MIPS R4000 User's Manual. PTR Prentice Hall, 1993.

  • Hines, Robert M., and Spence Wilcox. Device Driver Programming, UNIX SVR4.2. Englewood Cliffs, New Jersey: UNIX Press, 1992.

  • Kane, Gerry, and Joseph Heinrich. MIPS RISC Architecture. Prentice Hall, 1992.

  • Leffler, Samuel J., et alia. The Design and Implementation of the 4.3BSD UNIX® Operating System. Palo Alto, California: Addison-Wesley Publishing Company, 1989.

  • M. Maekawa, A. Oldehoeft, and R. Oldehoeft. Operating Systems Advanced Concepts. The Benjamin/Cummings Publishing Company, Inc., 1987.

  • A. Silberschatz, J. Peterson, and P. Galvin. Operating System Concepts, Third Edition. Addison Wesley Publishing Company, 1991.

  • STREAMS Modules and Drivers, UNIX SVR4.2. UNIX Press, 1992.

  • UNIX System V Release 4 Programmer's Guide, UNIX SVR4.2. UNIX Press, 1992.

Notation and Syntax Conventions

This guide uses the following notation and syntax conventions:

italics 

Indicates arguments in a command line that you must replace with a valid value. In commands and functions, it indicates a portion of the name that is a variable, for which you must make the appropriate substitution, as well as function arguments. In text, italics indicate document titles, filenames, glossary items, new terms, and variables.

bold 

Indicates commands, routines, and entry point names, as well as the names of UNIX and IRIX functions. A function with a man page in the IRIX Device Driver Reference Pages , manual is indicated as follows:

ioctl(D2)

where D2 is the number of the section that contains the man page.


Note: If a reference to a function is hyperlinked to the online version of the IRIX Device Driver Reference Pages, it looks like this instead:

ioctl(D2)

The online version displays in red, and you can go directly to the online man page by clicking on the entry.

courier 

Indicates computer output and program listings.

courier bold 

Indicates user input to the computer and nonprinting keys.

[ ] 

Enclose optional command arguments. (Do not enter the brackets.)

. . . 

Indicates that the preceding optional items can appear more than once in succession.

| 

Separates a list of items, of which you can choose one.