wdm architecture
comparisons
Friday April 28, 2000 15:29
Windows win32 driver model [wdm] overview Revision 2 Tuesday April 11, 2000 15:12 1 Monday April 10, 2000 13:36 0 Monday March 27, 2000 09:33
|
|
| Windows 2000 wdm hardware
access
A Visual Basic 6.0 application [app] communicates with a Visual C++ dll which, in turn, communicates with a VC++ wdm operating at a ring above ring 0. The wdm communicates with the Hardware Abstraction Layer [HAL] which communicates with PC internal hardware. C++ apps communicate directly with a wdm. |
Windows 98 wdm hardware
access
Visual Basic 6.0 application [app]
The VC++ wmd can communicate directly with hardware too.
|
| A wdm is supposed to be binary
compatible between Windows 98 and 2000.
Butthis is not mean that everything in a 98 wdm will work on a win 2k wdm. Here's some examples. |
|
| Works in 98 but not on win 2k | Works in 98 and win 2k |
| m_IoPortRange3.inb(7); m_IoPortRange3.outb(5,0x40); _asm { pushad mov edx, 0x30f mov al, 34h ; mode 2, read/write least signifcant out dx, al ; byte first, then most significant byte sub edx, 3 ; point to counter 0 data mov eax, DataRows * Burst ; DataRows * Burst - compensate for Burst burst. out dx, al ; write least significant byte mov al, ah ; most signficant byte in al out dx, al ; write most significant byte popad } |
READ_PORT_UCHAR((PUCHAR)0x707);
WRITE_PORT_UCHAR((PUCHAR)0x705,0x40); These are HAL [hardware abstraction layer] library subroutines. |
Windows 3.11, 95, and 98 vxd overview Tuesday March 28, 2000 08:12
|
| vxd structure is extremely similar
to that of a 98 wdm. In fact, it appears that some of the wdm services were patterned after those in a vxd.
vxds, however, don't work with win 2k. Also All vxds need to be replaced by wdms. |
Economics of drivers is that you want a programmer to write, get working well, then document the driver.
Then you want to get rid of the programmer. The programmer is an expense.
You then start selling the hardware and associated driver to make money.
Of course, some bugs may appear in the field.
The number of bugs is usually a function of the number of lines of code in the driver.
A non-linear function. Number of bugs rises geometrically? or exponentially? with the number of lines of code.
Either the original programmer or some other programmer will have to fix bugs.
Good documentation becomes critical either to train a new programmer or refresh the original programmer's memory.
When the driver is updated it is posted on internet for download. The internet method is relatively inexpensive compared to sending out disks and manuals.
But then comes new technology. The driver must be updated in a major way.
Sixteen bit Windows software is being replaced by thirty-two bit Windows software.
Visual Basic 6.0, Visual C++ 6.0, and link 6.0 has replaced previous versions.
Sixty-four bit Visual Studio 7.0 will happen.
But let's go backwards to see where we came from.
Sixteen bit Windows 3.11, 95, and 98.
In 16 bit Windows it is possible to access hardware directly from ring 3. Here's a diagram. Thursday April 6, 2000 20:33
Driver DLL: Interrupt Handling Here's some all working code [all over the world] which sets a 16 bit Windows interrupt vector which Hazzah refers.
Here's the tools used to produce and test the above code.
Vb is Visual Basic 3.0. The Programmer's WorkBench is a DOS-based Windows app distributed with Microsoft's MASM 6.10. MASM 6.0 uses link 3.0 and is largely 16-bit oriented. Sixteen bit code running at ring 3 was replaced by a vxd running at ring 0. The vxd, in this application, worked about half the speed of the ring 3 dll and took about twice as much code! dll driver codes don't port well directly to a vxd or wdm. Redesign is required. Then came the wdm initiative. All vxds and dll mini drivers must now be replaced by wdm drivers which run both on 98 and win 2k. |