1 / 25

Introduction to User-Mode Driver Framework

Introduction to User-Mode Driver Framework. Outline. What is UMDF? When should I use UMDF? When shouldn’t I use UMDF? What does UMDF give me? What kind of drivers can I write? What can my drivers do? What next?. Goals. How UMDF fits into WDF Understand UMDF’s capabilities.

zyta
Télécharger la présentation

Introduction to User-Mode Driver Framework

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to User-Mode Driver Framework

  2. Outline • What is UMDF? • When should I use UMDF? • When shouldn’t I use UMDF? • What does UMDF give me? • What kind of drivers can I write? • What can my drivers do? • What next?

  3. Goals • How UMDF fits into WDF • Understand UMDF’s capabilities

  4. Current Driver Models • Windows has several different driver models • Windows Driver Model (WDM) is the generic model • Specific driver models for popular devices classes • Storage, Networking, Printing, Imaging, etc... • Some built on top of WDM. Others run as user-mode services. • WDM Features • Asynchronous, packet-based I/O • I/O Cancellation • Layering of drivers • Dynamic loading and unloading of drivers • Plug and Play & Power management • Low-level high-performance interfaces • WDM Advantages • Large device coverage • Flexible

  5. Limitations with Current Models • Generic driver model (WDM) is too complex • Focuses on very advanced drivers which punishes simple ones • Poor DDI design • Device specific models have complexity of their own • Often this bubbles through from WDM • Developer trapped in device-specific model • Poor knowledge transfer from one to the next • Many drivers must be written in kernel mode • Even though much functionality could be user mode • Developers spend too much time driving our software • Cannot concentrate on driving their hardware • Driver quality suffers as a result • Do not allow extension and future growth

  6. Overview of Current Driver Models

  7. Windows Driver Foundation • We need a new generic driver model that ... • Scales conceptually from simple to extremely complex drivers • Can be extended to domain specific models • Can be validated at compile-time as well as run-time • Windows Driver Foundation (WDF) consists of • A generic driver model • Implementations of that model • Kernel Mode Driver Framework (KMDF) • User Mode Driver Framework (UMDF) • Driver Verification Tools • Static Driver Verifier • PREfast for Drivers

  8. Windows Driver Foundation Goals • Simplicity • No harder than it needs to be to accomplish a task • Fast time to market for drivers • Let driver developers focus on their domain, not ours • Reduce crashes and blue screens due to drivers • Better customer experience helps everyone • Provide complete driver development experience • Develop and test • Built-in diagnosability, tracing, verification tools • Deployment and Install • Support versioning

  9. Windows Driver Foundation- Experience

  10. Overview of Current (User) Driver Models

  11. Why Build a User-Mode Framework? • Difficult to provide high-quality drivers • Crash statistics prove this • WDF Framework makes drivers easier to write • Lots of driver models already live in user space • Printers, Audio, Imaging • Divergent driver models has become a problem • UMDF brings general-purpose model into user-mode • General UMDF provides: • Unified facilities • Support for WDF model

  12. What is UMDF? • Implementation of the WDF Driver Model • Provides ... • The infrastructure to run a device driver in user-mode • The WDF I/O Pipeline and PnP/PM State Machine • The core WDF objects • Devices, Files, Queues, Requests, I/O Targets, etc... • UMDF and KMDF both share the WDF Model • So learning how to use one will apply to the other • But they are not source or binary compatible • Have similar but not identical DDIs • Each has additional functionality applicable to its domain

  13. Overview of the Architecture Framework Framework UM driver UM driver Provided by: Microsoft ISV IHV Driver Manager Device Stack Host Process CoInstaller User Kernel Reflector Kernel Driver ... Kernel Driver

  14. Who Should Use UMDF? • Existing driver developers… • Who want to move drivers to user space • Who already have the “driver mindset” • New driver developers… • Coming from application development • Who need to provide device support • Who are learning new skills • Anyone who wants to... • Build a driver without a lot of development overhead • Reduce the risks associated with traditional drivers • Stop causing blue screens

  15. Where can you use UMDF? • Primary Scenarios • “Protocol Bus” devices • Devices attached to USB, 1394, TCP/IP, etc... • Software-only drivers • Filter drivers, virtualized serial port, etc… • Current Devices • Portable Media Players, Cell Phones, PDAs/ActiveSync, Auxiliary Display, Cameras • Future Devices • Devices on future protocol busses • Devices where driver can be split into ... • Small kernel-mode component to do hardware access • Larger user-mode driver to provide complex functionality

  16. When and How To Use UMDF • UMDF is a standard Windows codenamed “Longhorn” feature • Support in WDK • Build with the WDK Build Environment • Standard device driver build environment • No integration with Visual Studio

  17. Why Use UMDF? • Uses the WDF Driver Model • Can learn a single model that applies to KM and UM drivers • Faster development cycle • Easier debugging on a single machine • Crashes during development don’t require a reboot • Access to user-mode services • Win32 file I/O, Function Discovery, WINSOCK, RPC, Crypto • But you have to be careful…

  18. Why Use UMDF? • Improved stability • User-Mode Drivers are isolated from other drivers • Kernel is isolated from user-mode drivers • Increased security • Compromised driver does not crash the system • Lower privileges restrain a compromised driver • Recoverability • System can recover after a driver crash – no blue-screens • The driver can be restarted without rebooting

  19. Kernel-Mode or User-Mode Driver? You must use kernel mode when you: • Need direct hardware access, for example, • Require DMA • Must handle interrupts • Need access to device registers • Have strict timing requirements • UMDF will have increased latency • Need kernel-only resources • Or kernel components need access to your driver

  20. Features You Can Use in Your Driver • General WDF capabilities • PnP/PM provides “opt-in” callbacks for various events • Object model has context management & flow control • I/O Targets allow driver to send new I/O requests • Regardless of where the target device driver is running • Coordinated with cancellation and cleanup • Escape to Win32 and user-mode services • Standard facilities for Windows I/O model • PnP Device Discovery • Synchronous & Asynchronous I/O with Cancellation • Buffered and Direct I/O transfers • Standard INF Driven setup

  21. Common Concerns • Will a user-mode driver be fast enough? • UMDF driver can already flood a portable media device • UMDF may increase latency, but throughput remains high • Performance is one of our top priorities • But it’s not always the top priority for driver developers • Balanced with improvements in quality, stability, security, etc... • Will a user-mode driver be secure? • As secure as any other user-mode service • RPC, LSASS, WinLogon, etc... • A compromised user-mode driver is more contained • Cannot crash the system or expose kernel secrets • Will user-mode drivers be high quality drivers? • We’ll continue to push to improve driver quality in all models • UMDF will prevent badly behaved drivers from crashing the system

  22. What’s Next? • Development platform is the WDK/LDK • Currently allows developing drivers for Longhorn • But we know that’s not enough… • Plan to support Windows XP in Longhorn time-frame • Versioning support • Support for side-by-side installation • Beta program • Windows Driver Foundation Beta Program Invitation • http://www.microsoft.com/whdc/driver/wdf/beta.mspx

  23. Call To Action • Install the Windows Driver Kit • Join the WDF Beta Program • At http://beta.microsoft.com • Guest ID: Guest4WDF • Evaluate UMDF for your driver projects • Consider development time, customer support for system crashes, etc. • Send Us Feedback - We want to know • If UMDF will meet your needs • What stops you from writing your drivers with UMDF • Email: umdffdbk @ microsoft.com

  24. Additional Resources • Web Resources: • WDF Information: • http://www.microsoft.com/whdc/driver/wdf/default.mspx • Windows Debugger: • http://www.microsoft.com/whdc/devtools/debugging/default.mspx • External Resources • “Introduction to the Windows Driver Foundation: How To Develop Device Drivers Using the Kernel Mode Driver Framework” from OSR Press • Release date is September 2005 • Focuses on KMDF but provides general WDF information as well

  25. © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

More Related