110 likes | 291 Views
Drivers. CPIS 210 John Beckett. In the Beginning…. Programs accessed I/O hardware devices directly. E.g.: out 109, 0x29 # Send ASCII Space Problems: New hardware, must update program Might have multiple similar devices Programs could (perhaps accidentally) do nasty things to hardware:
E N D
Drivers CPIS 210 John Beckett
In the Beginning… • Programs accessed I/O hardware devices directly. E.g.: out 109, 0x29 # Send ASCII Space Problems: • New hardware, must update program • Might have multiple similar devices • Programs could (perhaps accidentally) do nasty things to hardware: • Change baud rate • Change video mode
The Driver Idea • Device controls are defined in a common manner • Device mfgr provides “driver” that delivers these functions • OS arbitrates between drivers and apps • Application programs deal with I/O through generic commands • Special case: File system works between I/O and apps
In The Beginning… Serial Port Terminal Emulator Parallel Port Word Perfect NIC Browser Hard Drive DOS File System
Windows 95+ Serial Port Terminal Emulator Driver Parallel Port Word Perfect Driver OS Kernel NIC Browser Driver Hard Drive Note: The Windows GUI became, to some extent, a similar “shim” DOS File System Driver
Why Do Drivers Fail? • Driver author may not fully understand how the hardware works • Driver author may not fully understand how to interface with the OS • Drivers often depend on other DLLs, which might change or not be fully understood • JB’s joke: Drivers are so technical, it’s hard to get a driver writer who is good at relationships – yet drivers are all about relationships!
Windows 95 -> Windows XP • Previously: Two different kinds of OS’s at Microsoft: • DOS-based • Windows NT • XP: Merged the two
XP -> Win7 • WHQL (Windows Hardware Quality Labs testing) • Vendor submits test logs to Microsoft per test suite from Microsoft • Microsoft may do additional testing • Microsoft supplies a digital certificate which allows driver to install without complaint • Vendors may self-sign, allowing driver to install but not allowing use of Windows logo See http://en.wikipedia.org/wiki/WHQL_Testing
Windows CE (Portables) Layered Drivers Most of the Windows CE drivers are layered driver, which consists of a MDD and a PDD. • MDD = Model Device Driver - this should be platform independent, and provide generic functions to call by the OS / driver clients. Inside the MDD it will call the PDD functions to access the hardware • PDD = Platform Dependent Driver - as named, this varies depends on the hardware platform. It should provides generic functions being called by the MDD. Monolithic Drivers • This type of drivers combined the MDD and PDD functionalities into one single driver. The advantage of having a monolithic driver instead of layered driver is performance, as it has less overhead to pass request and response across MDD and PDD. However, Layered drivers are easier to migrate, as only changes required in PDD for different hardware platforms, and requires minimal development efforts. http://blogs.msdn.com/b/saki/archive/2007/04/11/windows-ce-drivers-101-layered-drivers-vs-monolithic-drivers.aspx
Windows CE Board Support Packages (BSP) “Microsoft works closely with silicon vendors and independent hardware vendors to offer you an extensive list of Board Support Packages (BSPs) supported on Windows Embedded CE. By covering a full range of the latest supported microprocessors and other hardware components, our goal is to help you find compatible BSPs that will rapidly: • Evaluate Windows Embedded CE operating system features on your platform • Bring up the operating system on your custom hardware • Cut down on your time-to-market to original equipment manufacturers (OEMs)” http://www.microsoft.com/windowsembedded/en-us/community/bsp.aspx
Version Reporting • Drivers can check what version of the OS they are running under, and warn or refuse to work if there are concerns