730 - Writing UnixWare 2.1 Device Drivers
Table of Contents
Course Overview
Writing UnixWare 2.1 Device Drivers is designed for:
- Experienced C programmers who would like to learn how to write a device
driver.
- Programmers who already know how to write device drivers for another
version of UNIX or any other multi-tasking operating system.
In this course, students learn the what device drivers are and how to
write them for UnixWare's multi-user, multi-tasking, multi-processor enviroment.
Writing UnixWare 2.1 Device Drivers is taught with task-oriented
lectures and hands-on labs. It is an high-level course that provides pre-requisite
skill training for the Advanced UnixWare 2.1 Internals course.
Course Objectives
By the end of this course, students will be able to:
- Diagram the UnixWare architecture and explain the functionality of
the major components of the kernel
- Describe basic features of the Intel 386 through Pentium II I/O hardware
as it relates to device drivers
- Compare and contrast the various types of device drivers
- Explain the synchronization mechanisms used to protect sensative resources
in a single and multi-processor system.
- Write, install, and use a interrupt and non-interrupt character device
driver
- Create demand-loadable device drivers
- Create auto-configuring device drivers
- Create streams device drivers
- Create block-I/O device drivers
- Describe the architecture of SCSI and other storage technology device
drivers in UnixWare 2.1
Prerequisites
Students should have at least 6 months of experience programming in
C using system calls.
Course Series
This course is often taken as part of the following course sequence:
720 - Introduction
to SCO UnixWare 2.1 Internals
730 - Writing
Device Drivers
740 - Advanced
SCO UnixWare 2.1 Internals
Course Topics
Overview of Device Drivers
- Overview of the Unix aernel architecture.
- The function of a device driver.
- Driver types:
- Character: open/close/read/write/ioctl.
- Stream: putqueue/getqueue.
- Block:
- Target: open/close/strategy/ioctl.
- HBAs: overview of concepts.
- Link types:
- Review of the /etc/conf directory structure.
A Simple Character Driver
- The UnixWare DDI/DKI.
- Creating a simple Driver Software Package (DSP) for static drivers:
- The Master file.
- The System file.
- The Node file.
- The Drvmap file.
- The makefile file.
- The Driver.o file (and the cmn_err() routine).
- The id commands.
- The DSP for dynamic drivers.
- LAB: make the driver dynamic / test, no reboot, no restart
- Auto-configuring drivers
- Additional DSP files:
- The Autotune file.
- The Space.c file.
- Others breifly mentioned.
Intel-Specific Driver Issues
- I/O addresses and the in() and out() routines.
- Busy/Wait, polling, interrupts, and the spl() routines.
- Memory-Mapped I/O (i.e. dual-ported ram) and its associated routines.
- DMA and its associated routines.
A Basic (Character) Driver
- The load(), unload() and initialization routines.
- The open() routine.
- Moving data from/to the application:
- The read() routine.
- the write() routine.
- The close() routine.
- The ioctl() routine.
- The interrupt() routine, IPLs, and multi-threaded IPLs/locks
- Unreliable devices, timeouts, and associated routines.
Streams Drivers
- Where did streams come from?
- Overview of a streams driver (head, driver, queues, modules).
- A streams device's DSP.
- Streams device driver routines: getqueue(), putqueue(), etc.
- Streams flow-control.
- Overview of multiplexing streams drivers.
Block Drivers
- A block-device's DSP.
- The buffer cache.
- The strategy() routine.
The Host and Target Driver Scheme for Storage Devices
- What is an HBA driver?
- What is a Target driver?
- The relationship between HBA and Target drivers.
- The HBA initialization sequence and the claiming of Target devices.
- I/O sequences and their relationship to block (Target) drivers.