This document, "DEC OSF/1 Writing Device Drivers, Volume 1: Tutorial" (February 1994, for DEC OSF/1 Version 2.0 or higher), is a comprehensive guide for systems engineers on how to write device drivers for hardware running the DEC OSF/1 operating system.
The tutorial is structured to provide a thorough understanding of device driver development, covering:
- Device Driver Fundamentals: An overview of device driver purpose, classifications (block, character, network, pseudodevice), the differences between static and loadable drivers, and how the kernel interacts with drivers during various operations like autoconfiguration, I/O, interrupt handling, special requests, and reinitialization.
- Device Driver Development Process: Steps for gathering information about the host system and device, designing the driver, determining structure allocation techniques, addressing CPU architecture-specific issues (e.g., 32-bit vs. 64-bit concerns, memory barriers), setting up a development environment, and porting ULTRIX device drivers to DEC OSF/1.
- Device Driver Structure and Implementation: A detailed analysis of the typical sections within a device driver (e.g., include files, declarations, autoconfiguration support, open/close, read/write, ioctl, strategy, interrupt, memory map), along with practical examples for implementing these interfaces.
- Operating Environment Context: Descriptions of the hardware-independent model, key hardware components (CPU, memory, bus, device) and their activities, and the kernel environment, including device autoconfiguration processes and crucial kernel data structures (e.g.,
buf, device switch tables, uio structures) and kernel interfaces (e.g., string, virtual memory, data copying, hardware-related, loadable driver, DMA-related, miscellaneous).
- Practical Application: A specific example of writing a character device driver for a TURBOchannel test board is provided, illustrating the concepts and code implementation.
- Device Driver Configuration: An explanation of two configuration models (third-party and traditional), the syntaxes and mechanisms used to populate configuration files, and step-by-step examples for configuring both static and loadable drivers.
The book is intended for systems engineers with a strong background in C programming, UNIX-based shells, kernel concepts, and hardware architecture, but it explicitly states that no prior experience in writing device drivers is assumed. It also serves as a resource for those involved in implementing new buses or modifying existing bus implementations. Appendices offer summary tables of interfaces and structures, example source listings, and development worksheets.