Upload
giselle-tull
View
220
Download
3
Tags:
Embed Size (px)
Citation preview
User-Mode Driver User-Mode Driver Framework: Introduction Framework: Introduction And OverviewAnd Overview
Jeffrey CopelandJeffrey CopelandProgram ManagerProgram ManagerWindows Device Experience GroupWindows Device Experience GroupMicrosoft CorporationMicrosoft Corporation
IntroductionIntroduction
What this talk coversWhat this talk coversOverviewOverview
Future directionsFuture directions
Intended audienceIntended audience
Other sessions of interestOther sessions of interestFollowing talk on UMDF architectureFollowing talk on UMDF architecture
Tomorrow’s UMDF lab session and Q&ATomorrow’s UMDF lab session and Q&A
Why User Mode?Why User Mode?
High-quality drivers are difficult to writeHigh-quality drivers are difficult to writeCrash statistics prove thisCrash statistics prove this
User mode drivers are “safer”User mode drivers are “safer”
Some Windows driver models already live Some Windows driver models already live in user spacein user space
Printers, audio, imagingPrinters, audio, imaging
UMDF is the general purpose user UMDF is the general purpose user space modelspace model
A Quick Word About WDFA Quick Word About WDF
Windows Driver Foundation is the Windows Driver Foundation is the successor to WDMsuccessor to WDM
WDM is deprecatedWDM is deprecated
New Kernel Mode and User Mode driver New Kernel Mode and User Mode driver frameworks – KMDF and UMDFframeworks – KMDF and UMDF
These fit into the driver life cycleThese fit into the driver life cycleDriver kitDriver kit
Test toolsTest tools
Installation toolsInstallation tools
How To Expose A DeviceHow To Expose A Device
You can use a stand-alone application You can use a stand-alone application with a DLL to directly access the devicewith a DLL to directly access the device
Non-shared deviceNon-shared device
You can write a service to share You can write a service to share the devicethe device
You can write a driver to use normal I/OYou can write a driver to use normal I/ONot WDM – Old technologyNot WDM – Old technology
UMDF?UMDF?
KMDF?KMDF?
UMDF versus KMDFUMDF versus KMDF
When to use UMDFWhen to use UMDFProtocol buses – USB, 1394, IPProtocol buses – USB, 1394, IP
Software-only drivers – Filters, virtual portsSoftware-only drivers – Filters, virtual ports
You must use KMDF if you needYou must use KMDF if you needMore stringent timing requirementsMore stringent timing requirements
Hardware access – DMA, interruptsHardware access – DMA, interrupts
Kernel-mode clients or access to kernel dataKernel-mode clients or access to kernel data
Hybrid-model driversHybrid-model drivers
Where Can You Use UMDF?Where Can You Use UMDF?
Where Can You Use UMDF?Where Can You Use UMDF?
TodayTodayDevice classes: Device classes:
Cell phones, media players, cameras, other Cell phones, media players, cameras, other portable devicesportable devicesRFID, NFCRFID, NFCBiometric and other security devicesBiometric and other security devicesDevices which currently are accessed directly Devices which currently are accessed directly through applications or servicesthrough applications or services
Buses:Buses:USB USB –– through WinUSB I/O Target through WinUSB I/O TargetIP – sockets through WinSockIP – sockets through WinSockBluetooth – RFCOMM or WinSockBluetooth – RFCOMM or WinSockAny bus that provides user-mode accessAny bus that provides user-mode access
Where Can You Use UMDF? Where Can You Use UMDF?
Factors to consider todayFactors to consider todayCan the device use a UMDF class driver?Can the device use a UMDF class driver?
Can the driver access device over that bus?Can the driver access device over that bus?
Does the kernel need to access the device?Does the kernel need to access the device?
FutureFutureWorking with device teams to drive Working with device teams to drive availabilityavailability
Need Feedback to help set prioritiesNeed Feedback to help set priorities
UMDF DevelopersUMDF Developers
Existing driver developersExisting driver developersWho want to move drivers to user spaceWho want to move drivers to user space
Who already have the “driver mindset”Who already have the “driver mindset”
New driver developersNew driver developersComing from application developmentComing from application development
Who need to provide device supportWho need to provide device support
Who are learning new skillsWho are learning new skills
Anyone who wants toAnyone who wants toBuild a driver without a lot of development overheadBuild a driver without a lot of development overhead
Reduce the risks associated with traditional driversReduce the risks associated with traditional drivers
Stop causing blue screensStop causing blue screens
KernelProgrammers
UMDF DevelopersUMDF Developers
UMDF developers come from UMDF developers come from two directionstwo directions
The application programmer still needsThe application programmer still needsto understand something about low-level to understand something about low-level system facilitiessystem facilities
Application Programmers
UMDF StructureUMDF Structure
UMDF driverUMDF driverFramework loads driver Framework loads driver
Driver then creates structure andDriver then creates structure andspecifies callbacks and event handlersspecifies callbacks and event handlers
C++ and “COM-lite”C++ and “COM-lite”
For more details stay for the UMDF For more details stay for the UMDF technical talktechnical talk
UMDF StructureUMDF Structure
Device StackDevice Stack
Driver Manager
Host ProcessUserUser
KernelKernel
Framework
UM driverFramework
UM driver
Reflector
...
CoInstaller
Kernel Driver
Kernel Driver
PerformancePerformance
Test system: hyper-threaded 3.2Ghz P4, 1GBTest system: hyper-threaded 3.2Ghz P4, 1GBPerformance sample availablePerformance sample available
Null driverNull driverRaw throughput up to 4 gigabits/secRaw throughput up to 4 gigabits/sec
Buffer size “sweet spot” 64-128 KbBuffer size “sweet spot” 64-128 Kb
Win32 I/O target – USB hard driveWin32 I/O target – USB hard driveThroughput 170 megabits/secThroughput 170 megabits/sec
CPU usage 11%CPU usage 11%
UMDF can easily saturate a USB 2.0UMDF can easily saturate a USB 2.0bus’s maximum speed of 480 megabits/secbus’s maximum speed of 480 megabits/sec
No adverse performance impact in No adverse performance impact in existing UMDF driversexisting UMDF drivers
Why To Use UMDFWhy To Use UMDF
Single WDF model – Both KM and UMSingle WDF model – Both KM and UM
Quicker development timeQuicker development timePnP/Power boilerplate is encapsulatedPnP/Power boilerplate is encapsulated
Debugging in user mode is easier!Debugging in user mode is easier!
Crashes in testing don’t force a rebootCrashes in testing don’t force a reboot
Access to user-mode servicesAccess to user-mode services
Shallow learning curve for Shallow learning curve for application developersapplication developers
Why To Use UMDFWhy To Use UMDF
Improved stabilityImproved stabilityUM drivers are isolated from each otherUM drivers are isolated from each other
Kernel is isolated from UM driversKernel is isolated from UM drivers
A step toward general driver isolationA step toward general driver isolation
Increased securityIncreased securityCompromised driver can’t crash the systemCompromised driver can’t crash the system
But may still compromise device dataBut may still compromise device data
RecoverabilityRecoverabilityDriver can recover or be restarted afterDriver can recover or be restarted aftera crash without a blue screena crash without a blue screen
Why To Use UMDFWhy To Use UMDF
““Writing a UMDF driver is relatively easy Writing a UMDF driver is relatively easy once you get your hands around using once you get your hands around using COM-lite. Perhaps best of all, when your COM-lite. Perhaps best of all, when your driver crashes while you're debugging it, driver crashes while you're debugging it, the system stays running.” the system stays running.” – Mark – Mark CariddiCariddi, , OSR OSR –– The NT Insider The NT Insider
““Plug-and-play and power management Plug-and-play and power management are easier to use. Queues and I/O targets are easier to use. Queues and I/O targets are straight-forward, and they have what I are straight-forward, and they have what I needed already.” needed already.” –– Janet Schneider, Janet Schneider, Microsoft Storage TeamMicrosoft Storage Team
Why To Use UMDFWhy To Use UMDF
““UMDF allows me to focus on the functional UMDF allows me to focus on the functional implementation, rather than the intricaciesimplementation, rather than the intricaciesof driver development. The best part about of driver development. The best part about UMDF drivers is that a crash doesn't causeUMDF drivers is that a crash doesn't causea blue screen.”a blue screen.”– Dan Polivy, Microsoft SideShow developer– Dan Polivy, Microsoft SideShow developer
Smart Card As A Case StudySmart Card As A Case Study
Rewrite of an existing WDM driverRewrite of an existing WDM driverDeveloper had driver knowledge,Developer had driver knowledge,but not WDM or WDF experiencebut not WDM or WDF experience
2 months to come up to speed on2 months to come up to speed onWDF and the existing driverWDF and the existing driver
1½ months to re-implement the1½ months to re-implement thedriver in UMDFdriver in UMDF
Smart Card As A Case StudySmart Card As A Case Study
35% code reduction – measured in 35% code reduction – measured in source bytessource bytes
4000 lines of PnP code removed4000 lines of PnP code removed
Functionally identical driver with less code, Functionally identical driver with less code, higher robustness, more maintainabilityhigher robustness, more maintainability
Code now “feels simpler”Code now “feels simpler”
Results are similar to experience porting Results are similar to experience porting WDM network and modem drivers to KMDFWDM network and modem drivers to KMDF
Smart CardSmart Card
Janet SchneiderJanet SchneiderStorage Driver developerStorage Driver developerMicrosoftMicrosoft
SideShowSideShow
Dan PolivyDan PolivyMobile PC developerMobile PC developerMicrosoftMicrosoft
UMDF AvailabilityUMDF Availability
Beta UMDF availableBeta UMDF availableFor Windows Vista nowFor Windows Vista now
For Windows XP next weekFor Windows XP next week
As update to the Beta 2 Windows Driver KitAs update to the Beta 2 Windows Driver Kit
Available for Windows Server 2003 at Available for Windows Server 2003 at same time as release for Windows Server same time as release for Windows Server codenamed "Longhorn"codenamed "Longhorn"
UMDF In The FutureUMDF In The Future
New driver models will move to WDFNew driver models will move to WDF
New features in UMDFNew features in UMDFWe’re in post-Windows Vista planning nowWe’re in post-Windows Vista planning now
We need your feedbackWe need your feedback
Help us decideHelp us decide
Possible convergence on OS platformsPossible convergence on OS platformsWindows MobileWindows Mobile
ResourcesResources
Join the WDF Beta ProgramJoin the WDF Beta Programhttps://connect.microsoft.com/availableprograms.aspxhttps://connect.microsoft.com/availableprograms.aspx
Sign in with your Microsoft Passport, and join the WDK/WDF betaSign in with your Microsoft Passport, and join the WDK/WDF beta
Participate in the UMDF newsgroupParticipate in the UMDF newsgroupmicrosoft.beta.windows.driverfoundation.umdfmicrosoft.beta.windows.driverfoundation.umdf at at
betanews.microsoft.combetanews.microsoft.com
WHDC web siteWHDC web site
DevCon 2005 presentationsDevCon 2005 presentationshttp://www.microsoft.com/http://www.microsoft.com/whdc/driver/wdf/UMDF.mspxwhdc/driver/wdf/UMDF.mspx
Join us for the UMDF lab and Q&A WednesdayJoin us for the UMDF lab and Q&A WednesdayLab requires a Design Preview AgreementLab requires a Design Preview Agreement
Ask the Experts Tuesday eveningAsk the Experts Tuesday evening
Call To ActionCall To Action
Install the Windows Driver KitInstall the Windows Driver Kit
Try UMDF for your driver projectsTry UMDF for your driver projects
Send us feedback!Send us feedback!We want to know how to make the framework We want to know how to make the framework betterbetter
We want to know what features are We want to know what features are still missingstill missing
Respond to our surveyRespond to our survey
UMDFFDBK @ microsoft.comUMDFFDBK @ microsoft.com
© 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions,
it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.