IRIX® Device Driver Programmer's Guide

Document Number: 007-0911-210

Front Matter

| List of Figures | List of Examples | List of Tables |

Table of Contents

New Features in This Guide
New Features Documented

About This Guide
What You Need to Know to Write Device Drivers
Updating Device Drivers from Previous Releases to IRIX 6.5
What This Guide Contains
Other Sources of Information
Reader Comments

I. IRIX Device Integration

1. Physical and Virtual Memory
CPU Access to Memory and Devices
The 32-Bit Address Space
The 64-Bit Address Space
Address Space Usage in SGI Origin 2000 Systems
Device Driver Use of Memory

2. Device Configuration
Device Special Files
Hardware Graph
Hardware Inventory
Configuration Files

3. Device Control Software
User-Level Device Control
Kernel-Level Device Control

II. Device Control From Process Space

4. User-Level Access to Devices
PCI Programmed I/O
EISA Programmed I/O
VME Programmed I/O
VME User-Level DMA

5. User-Level Access to SCSI Devices
Overview of the dsreq Driver
Generic SCSI Device Special Files
The dsreq Structure
Testing the Driver Configuration
Using the Special DS_RESET and DS_ABORT Calls
Using dslib Functions
Example dslib Program

6. Control of External Interrupts
External Interrupts in Challenge and Onyx Systems
External Interrupts In Origin 2000 and Origin 200

III. Kernel-Level Drivers

7. Structure of a Kernel-Level Driver
Summary of Driver Structure
Driver Flag Constant
Initialization Entry Points
Attach and Detach Entry Points
Open and Close Entry Points
Control Entry Point
Data Transfer Entry Points
Poll Entry Point
Memory Map Entry Points
Interrupt Entry Point and Handler
Support Entry Points
Handling 32-Bit and 64-Bit Execution Models
Designing for Multiprocessor Use

8. Device Driver/Kernel Interface
Important Data Types
Important Header Files
Kernel Memory Allocation
Transferring Data
Managing Virtual and Physical Addresses
Hardware Graph Management
User Process Administration
Waiting and Mutual Exclusion

9. Building and Installing a Driver
Defining Device Numbers
Defining Device Special Files
Compiling and Linking
Configuring a Nonloadable Driver
Configuring a Loadable Driver

10. Testing and Debugging a Driver
Preparing the System for Debugging
Producing Diagnostic Displays
Using symmon
Using idbg
Using icrash

11. Driver Example
Installing the Example Driver
Example Driver Source Files

IV. VME Device Drivers

12. VME Device Attachment on Origin 2000/Onyx2
Overview of the VME Bus
About VME Bus Attachment
About VME Bus Addresses and System Addresses
About VME in the Origin2000
Configuring VME Devices

13. Services for VME Drivers on Origin 2000/Onyx2
About VME Drivers
Initializing the Driver
Initializing a VME Device
Creating and Using PIO Maps
Creating and Using DMA Maps
Handling VME Interrupts
Porting From IRIX 6.2
Sample VME Device Driver

14. VME Device Attachment on Challenge/Onyx
Overview of the VME Bus
VME Bus in Challenge and Onyx Systems
VME Bus Addresses and System Addresses
Configuring VME Devices
VME Hardware in Challenge and Onyx Systems

15. Services for VME Drivers on Challenge/Onyx
Kernel Services for VME
Sample VME Device Driver

V. SCSI Device Drivers

16. SCSI Device Drivers
SCSI Support in SGI Systems
Host Adapter Facilities
Designing a SCSI Driver
SCSI Reference Data
A Note on FibreChannel Drivers

VI. Network Drivers

17. Network Device Drivers
Overview of Network Drivers
Network Driver Interfaces
Multiprocessor Considerations
Example ifnet Driver

VII. EISA Drivers

18. EISA Device Drivers
The EISA Bus in SGI Systems
EISA Support in Indigo2 and Challenge M Series
EISA Configuration
Kernel Functions for EISA Support
Sample EISA Driver Code

VIII. GIO Drivers

19. GIO Device Drivers
GIO Bus Overview
Configuring a GIO Device
Writing a GIO Driver
Memory Parity Workarounds
Example GIO Driver

IX. PCI Drivers

20. PCI Device Attachment
PCI Bus in SGI Workstations
PCI Implementation in O2 Workstations
PCI Implementation in Origin Servers

21. Services for PCI Drivers
IRIX 6.5 PCI Drivers
About PCI Drivers
Using PIO Maps
Using DMA Maps
Registering an Interrupt Handler
Registering an Error Handler
Interrogating a PCI Device
Interrogating a PCI Bus
Example PCI Driver

X. STREAMS Drivers

22. STREAMS Drivers
Driver Exported Names
Building and Debugging
Special Considerations for Multiprocessing
Expanded Termio Interface
Special Considerations for IRIX
Summary of Standard STREAMS Functions
STREAMS Modules for X Input Devices

A. SGI Driver/Kernel API
Driver Exported Names
Kernel Data Structures and Declarations
Kernel Functions

B. Challenge DMA with Multiple IO4 Boards
The IO4 Problem
Fixing the IO4 Problem