Writing WDF Drivers for Windows

Click Here for Seminar Outline (PDF)

The Windows Driver Foundation (WDF) is the latest standard for creating Windows drivers, and is the preferred way to implement most new drivers for Windows.

This seminar is designed for engineers who need to understand how to design, develop, and test Windows drivers using the WDF Kernel Mode Driver Framework (KMDF). While the seminar provides the groundwork and concepts for writing any supported type of WDF driver, its focus is providing practical experience in developing KMDF software drivers, filter drivers, and drivers for USB devices. Once an attendee understands these concepts, creating KMDF drivers for other classes of devices and creating drivers using the User Mode Driver Framework (UMDF) should be relatively easy.

Hardware Included A valuable part of your learning experience in this course will be the lab exercises targeted for use with the OSR USB FX2 Learning Kit (check out the OSR Online Store for more information. Of course, we want your learning experience to extend beyond the classroom, so each student will walk away with their very own OSR USB FX2 Learning Kit.

Details

Length: 5 days

Format: Lecture and Lab

Cost: $3,350 ($3,950 for international locations)

Applicable Discounts: 2 week advanced payment - $200 off regular price; Multi-registration - contact a seminar coordinator

Current Schedule

Writing WDF Drivers for Micorsoft Windows
Santa Clara, CA
27 Sept - 1 Oct 2010

Target Audience

Engineers who need to understand how to design, develop, and test Windows drivers using the Windows Driver Foundation's (WDF) Kernel Mode Driver Framework (KMDF).

Note: Writing WDF Drivers for Windows is most appropriate for developers focused on writing new drivers for which WDF is applicable. Developers who seek a thorough understanding of the workings of the Windows I/O subsystem in preparation for writing non-WDF drivers are strongly urged to attend OSR's Writing WDM Kernel Drivers for Windows seminar instead of this seminar.

Prerequisites

Students attending this seminar must have solid knowledge of general operating systems concepts (user mode versus kernel mode, virtual memory concepts, concurrency issues), device concepts (registers, interrupts), and the basics of Windows O/S Architecture. Previous experience developing device drivers (on any operating system) will definitely be an advantage.

Due to the hands-on orientation of this seminar, attendees will be assumed to be able to use Windows at a user level, including using Microsoft's Developer's Studio (VC++). Working knowledge of the C programming language, and how to read and write to a file using Win32 (CreateFile, ReadFIle, WriteFile) are also assumed.

Seminar Outline

  • Introduction
    Welcome remarks, seminar goals and objectives, and a brief introduction to WDF and KMDF.
  • Windows Architecture Overview
    A brief review of Windows operating system architecture, focused specifically on the details needed by a KMDF driver writer.
  • The Windows Device Tree
    A description of how the Windows PnP subsystem discovers and enumerates drivers. All about Physical Device Objects (PDOs), Function Device Objects (FDOs), and filter devices. How filter drivers work their magic. How requests are processed, and passed from driver to driver within the Windows I/O Subsystem.
  • Driver Installation
    How to create installation control files for KMDF drivers. The Ten Most Frequently Used INF File Sections are discussed. The KMDF Co-Installer, and how to specify it in an INF file, is described.
  • Building and Debugging
    Using the WDK to build KMDF drivers. How to setup WinDbg, and a brief overview of the WDF Kernel Debugger Extensions (WDFKD), including retrieving the WDF Log from the "in flight recorder." Also a discussion of various driver debugging tools relevant to WDF drivers (Driver Verifier, Static Driver Verifier, Prefast for Drivers).
  • The WDF Object Model
    WDF object characteristics and taxonomy. How objects are instantiated and used in KMDF.  An overview of the most common WDF objects.
  • Driver Initialization
    How to initialize a KMDF driver and its associated device. Also, handling typical PnP and power management events such as device arrival, power-up, and power-down. How KMDF drivers are notified of and claim their hardware resources.
  • Lab: Building and Debugging, Driver Initialization (DriverEntry, EvtDeviceD0Entry, etc).
  • Interrupt Levels & DPCs
    In this module, we discuss the all-important concept of Interrupt Request Levels (IRQLs), and the specific uses that Windows makes of various IRQLs. We also discuss Deferred Procedure Calls (DPCs) and how they're used in Windows for Interrupt Service Routine completion (DPCforISR). 
  • Queues and Requests
    In this section, we discuss WDFQUEUEs and WDFREQUESTS. Topics include how Queues are instantiated, Queue dispatch types, and how Queues can be used to sort Requests. We also discuss Framework Requests and how Requests are processed and completed.
  • I/O Targets
    Local, Remote, and Special I/O Targets are discussed. How to forward Requests both synchronously and asynchronously to other drivers in the system for processing. Completion routines are also covered.
  • Lab: Request Processing and Completion, Filtering
  • Buffer Methods and Device Controls
    In this section, the different ways that requestor data buffers can be described are discussed. Direct I/O, Buffered I/O and "Neither I/O" are described, compared, and contrasted. Also discussed is how to define custom Device IO Control Codes (IOCTLs), and how the previously described buffering methods apply to IOCTLs.
  • USB Concepts
    The basics of USB are discussed including device, configuration, and interface descriptors. Endpoints and pipes are described.
  • Implementing WDF USB Drivers
    In this section, we describe how USB drivers are implemented in KMDF. This includes how a configuration and interface is chosen, and how endpoints are retrieved. How to send vendor commands to a device via Endpoint 0. Using Bulk and Interrupt endpoints. The WDF Continuous Reader is briefly discussed, as is supporting Selective Suspend (USB device power management).
  • Lab: USB, Using the OSR USB-FX2 device
  • Serialization
    In this module, we discuss issues relating to synchronizing access to shared data from within your driver. The much misunderstood topic of KMDF Synchronization Scope is fully described, as is extending sync scope to other callback routines via the Automatic Serialization parameter. WDFSPINLOCKs and WDFWAITLOCKs are discussed, along with the underlying implementations of each and how they're used.
  • Cleanup, Close and Cancel
    Strategies for handling queued and in-progress requests are discussed, as what processing typically takes place as part of cleanup and close processing.
  • Helpful Classes
    A brief description of a few Framework classes such as WDFCOLLECTION, WDFWORKITEM, and WDFTIMER that might be useful additions to your "bag of tricks."
  • Lab: USB continued, Open/Close processing
Contact Us


More on Seminars

OSR Seminars: What to Expect?

Which OSR Seminar is Right For Me?

Testimonials

Private, On-site Seminars

Seminar FAQ

How to Register

Questions? Contact a Seminar Consultant



Seminar Updates

Subscribe by email to receive scheduling updates for OSR seminars