Writing Device Drivers for the Solaris Operating Environment (SI-375)

The Writing Device Drivers for the Solaris Operating Environment course provides students with the knowledge and techniques necessary to write device drivers for the Solaris Operating Environment (Solaris OE). This course covers kernel topics related to driver development, driver design methodology, debugging, and the kernel support routines available to the driver writer. Various types of drivers are investigated including block drivers, character drivers, STREAMS drivers, drivers for Small Computer System Interface (SCSI) devices, and drivers for SCSI host bus adapters. Students examine and use a random access memory (RAM) disk for the block interface, write their own STREAMS module, and create the various routines of a regular character driver. Device-dependent topics are not covered.

»   Details below
 
 
Select a course
Product ID Duration Price
SI-375 5 days $2,495.00

If schedules are not displayed, or schedules shown do not match your availability, select "Request a Class" to inquire about dates or arranging an onsite or dedicated class for your organization.

 
 
Who Can Benefit

Students who can benefit from this course are UNIX programmers who need to write device drivers in the Solaris OE.

 Back to top

 
 
Prerequisites

To succeed fully in this course, students should be able to:

  • Write correct C programs and evaluate a=(int(*)())b
  • Use the C, Bourne, or Korn shell
  • Navigate the Solaris OE file system
  • Edit text files using vi or the OpenWindows or Common Desktop Environment (CDE) text editors
  • Enumerate the basic functions of the operating system
  • Define the use of the file, vnode, and inode structures in the system
  • Use the Solaris OE or UNIX system calls, particularly the I/O calls
  • Enumerate the differences between a system call and a library call
  • Use the Solaris OE development tools, such as make and cc

 Back to top

 
 
Skills Gained

Upon completion of this course, students should be able to:

  • Explain the purpose of the Device Driver Interface/Driver-Kernel Interface (DDI/DKI)
  • Determine how many devices can be connected to a SCSI-1, SCSI-2, and SCSI-3 bus
  • List the structures and system calls used in Streams
  • Understand different dynamic reconfiguration scenarios
  • Describe the architecture of the Solaris OE Power Management framework and its role in dynamic reconfiguration
  • Compile kernel code

 Back to top

 
 
Course Content

Module 1 - Hardware Overview

  • Explain how multiprocessor architectures differ
  • Describe the impact of the processor, memory model, and bus differences on the operating system
  • Describe the different logical address spaces used on a workstation running the Solaris OE and how they relate to the physical address space
  • Describe how the memory management unit translates addresses
  • Explain how I/O cache, burst transfers, and DMA work

Module 2 - The Solaris OE Kernel and Device Tree

  • Explain the difference between kernel and user address spaces
  • Explain the purpose of the Device Driver Interface/Driver-Kernel Interface (DDI/DKI)
  • Describe the creation and role of the device tree in the kernel for the Solaris OE

Module 3 - Overview of the Solaris OE Device Drivers

  • Describe how system calls invoke driver functions
  • List the system structures that drivers use to define their entry points
  • Explain how these system structures interconnect, and which structures can be examined by the driver
  • Describe the difference between a character device and a block device
  • Describe the differences between memory mapped, DMA, and programmed I/O devices

Module 4 - Multithreading

  • Explain how the multithreaded environment is used to protect data
  • Explain what is needed to enable a thread to wait for an event
  • Describe two synchronization objects supported by the Solaris OE

Module 5 - Properties

  • Understand the concept and handling of device properties
  • Describe the routines that are used to dynamically change properties
  • Describe the device driver function that handles properties

Module 6 - Debugging

  • Describe how to prepare a system for debugging
  • List the tools and commands used to debug kernel code in the Solaris OE
  • Describe basic ways of debugging device drivers

Module 7 - Autoconfiguration

  • Explain the purpose of the hardware configuration file
  • List the structures used to make a driver loadable, and understand how to initialize these structures
  • Explain the purpose of the _init(9E), _info(9E), and _fini(9E) routines
  • Describe the device driver autoconfiguration routines
  • List the entry points for device configuration
  • Describe how to compile and load a loadable driver

Module 8 - Device Programmed I/O

  • Understand how to map device registers for device-independent access
  • Understand and handle basic side effects and constraints of programmed I/O (PIO)
  • Describe the issues that must be addressed to ensure driver portability

Module 9 - Interrupts

  • Describe how the interrupt routine operates
  • Describe priority inheritance and how it affects critical sections of non-interrupt code
  • Describe the interrupt levels and describe how they are processed
  • Understand the significance of interrupt levels under the Solaris OE architecture
  • Describe the top and bottom halves of a driver and describe how they are synchronized

Module 10 - Direct Memory Access

  • Name the three types of DMA
  • Describe the main features of the DDI DMA model
  • Describe the DMA data structure used by the driver
  • Name the three software components of the DMA model
  • Explain how system resources are allocated for DMA
  • Describe a DMA Window

Module 11 - Block Drivers

  • Describe the routines composing a block driver and indicate where they are initialized
  • Describe the key data structure in a block driver
  • Describe how to check user credentials
  • Describe how transfer parameters are passed to a block driver
  • Explain the purpose of the xxstrategy() routine
  • Describe the use of buffer mapping routines

Module 12 - Character Drivers

  • Describe the routines common to both character drivers and block drivers, and identify which are unique to character drivers
  • Describe the data structure passed to the xxread() and xxwrite() routines
  • Explain how a character driver can use the physio(9F) routine, and why you would use the physio() routine
  • Explain the purpose of the xxioctl() routine
  • Describe the function used for segment mapping
  • Explain the purpose of the xxchpoll() routine

Module 13 - SCSI Target Drivers

  • Determine how many devices you can connect to a SCSI-1, SCSI-2 and SCSI-3 bus
  • Describe how the target driver communicates with the target device
  • Determine what functions a driver uses to communicate with the host adapter driver
  • Describe how the host adapter returns the result of a transfer request to the target driver

Module 14 - SCSI Host Bus Adapter (HBA) Drivers

  • Describe the HBA Transport Layer
  • Describe how a driver stores target HBA data in the tran_hba_private field
  • Describe how you detach an HBA driver
  • Name the routine that is used to create a SCSI packet
  • List the routines that are used to handle SCSA command transport and command completion

Module 15 - STREAMS

  • List the structures used in STREAMS
  • Explain queue bands
  • Describe the transparent ioctl(2) mechanism
  • Describe the interfaces to the STREAMS module and driver routines
  • Explain how to install a STREAMS module
  • List the new STREAMS system calls and support routines
  • Understand the concept of perimeters and STREAMS multithreading and concurrency

Module 16 - Hot-Plugging or Dynamic Reconfiguration

  • Describe different dynamic reconfiguration scenarios
  • Describe the architecture of the Solaris OE Power Management framework and its role in dynamic reconfiguration
  • Describe how to convert a Solaris OE device driver to support dynamic reconfiguration
  • Describe the additional commands that have been added to the attach(9E) and detach(9E) routines
  • Describe the additions that should be made to a Data Link Provider Interface (DLPI) driver
  • Describe the additional functions that are provided for HBA hot-plugging

Module 17 - Compiling, Loading, Packaging, and Testing Drivers

  • Compile kernel code
  • Describe how to manually install and load a device driver module
  • List the commands used to package an application in the Solaris OE
  • Describe the package creation process
  • Describe basic ways of testing device drivers

Module 18 - Making a Device Driver 64-Bit Ready

  • Describe the three objectives for porting a driver to a 64-bit Solaris OE
  • Understand general and driver-specific 64-bit issues

 Back to top

 
 
Browse Other Course Topic Areas
 
Sun Training U.S.   
» Training outside the U.S.
 
 
 
 
 
Fast Track
Fast Track
Prepare for Sun certification in half the time - and get a free Sun branded jacket.
Sun Training Libraries
Purchase now and receive a free Apple iPod Touch!
Contact About Sun News & Events Employment Site Map Privacy Terms of Use Trademarks Copyright Sun Microsystems, Inc.