Developing and Debugging Windows KMDF Drivers

3 days lecture + hands-on lab

Target Audience

For Driver Developers, Support Engineers and Software QA Engineers

Description

The Kernel Mode Driver Framework (KMDF) which is a part of Windows Driver Foundation (WDF) greatly simplifies development of kernel mode drivers. This course covers development and debugging of kernel mode drivers based on KMDF. Attendees will learn about the architecture of KMDF, debugging facilities provided by KMDF, KMDF objects, key data structures used by KMDF drivers, KMDF USB Drivers, KMDF Bus drivers and how to debug crashes and hangs caused by KMDF drivers.

In the hands-on labs attendees get an opportunity to develop, install, test and debug drivers that exercise the above interfaces on Windows 7 running inside a Virtual Machine as well as analyze kernel mode crash dumps that pertain to these technologies.

Pre-requisites

Proficiency in "C" programming language
Familiarity with Windows kernel architecture and data structures

Goals

Upon completion of this course attendees would be able to:

Understand the components and architecture of KMDF, how drivers interact with framework and find out detailed information about KMDF drivers loaded on a system.

Understand the KMDF driver installation process and debug failures associated with installing and removing KMDF drivers in the system.

Understand the In-Flight-Recorder (IFR) facility provided by KMDF. Obtain IFR logs of failing KMDF drivers and interpret the contents of the IFR log to diagnose problems in the drivers.

Use the KMDF verifier tool to perform run time error checking for KMDF drivers and detect common problems.

Understand the KMDF object model and the relationship between object and handles. Perform basic operations on KMDF objects, use the debugger to navigate objects, retrieve information about them and debug object re-parenting and reference counting problems in KMDF drivers.

Understand how the framework provided perform synchronization, how to override the default behavior using synchronization scope and execution level and debug failures caused due to incorrect use of these features.

Implement event handler for various I/O requests, queue requests and debug problems related to requests being stuck in I/O queues.

Understand how KMDF drivers communicate with USB devices, implement USB drivers using KMDF and debug power management issues like USB selective suspend.

Implement bus drivers to perform device enumeration and removal using KMDF and debug child device removal problems caused by bus drivers.

Topics

KMDF Architecture
KMDF Drivers
KMDF Library
KMDF Loader
KMDF Versions
KMDF Co-Installer
KMDF Debugging Tools
KMDF Symbols
Debugger Extension
In Flight Recorder (IFR) Log
WDF Verifier
KMDF Status Codes
KMDF Bug Checks
KMDF Objects
KMDF Objects
Object Hierarchy
Object Cleanup
Object Contexts
Object Handles
Execution Level
Synchronization Scope
KMDF Data Structures
Driver, Device, File, Queues, Requests
DPC, Timer, Work Item
Memory, Collections, String, Locks
Interrupt, Resource Lists
DMA Common Buffer
DMA Enabler & Transaction
I/O Targets
KMDF USB Drivers
USB Objects (Devices, Interfaces, Pipes)
USB Device Configuration
USB Requests
USB Continuous Reader
USB Power Management
KMDF Bus Drivers
KMDF Bus Architecture
Structure of a KMDF Bus Driver
Enumeration Models
Reporting Device Arrival and Removal
Debugging Child Lists
Bus Driver Testing and Debugging