VXD, KMD, WDM Basic Concept
Author: Lu Lin
Come come, join this black-black driver world. :) Here you must talk about some basic questions from VXD, Kernel Mode Driver, and WDM.
What is VXD? VXD is Virtual X Driver. Hey, I said that it is also white. In fact, it is a virtual equipment driver. It is the system for extension of various hardware resources identification, management, maintenance operations .vxd and VMM (virtual machine management Work together to maintain the operation of the system. Thevxd mode begins with the Win3X era. Altead that Win98 has always dominated the MS Win series operating system. VXD operations in the Intel series CPU protection mode RING0. Has The highest control of hardware.
What is KERNEL MODE DRIVER (KMD)? Kernel Mode Driver is the management of the management and maintenance of hardware operations. This Driver is running in NT's kernel mode, similar to RING0. However, a KMD operates in different It is time that the running environment when the equipment requests is very likely to receive the device request, and the operating environment requested by the device is different. This is also NT, Driver's operation is also limited by NT, one accident, Driver and NT is attributed to the same, to a BSOD (Blue Screen of Death).
What is WDM? WDM is short of Win32 Driver Model. With Win95 OSR2.1, it is compatible with Win2000. It is the "new 'driver mode of MS". The current online WDM has a lot of articles, but there are not many books. Basically Since the 98 support is limited, the WIN2000 does not have a formal version, WDM is still not much. But very quickly, WDM will become mainstream Driver mode. In my opinion, WDM is just a PNP KMD. (Maybe I didn't understand the essence :))
Early Win3X, the core is VMM, and the VMM has some characteristics of the basic operating system. But Win3X driver mode is confused. Hardware is driven by VXD driver, network and file system, by real mode driver, multimedia hardware And the printer has a Ring3 DLL driver, and the system service is mostly turned to the V86 mode DOS DOS. It is converted to the Win95 large part of the system service is converted to the protection mode. However, the confusing drive mode does not change .Win95 main attack The direction is ease of use, and it is indeed a little progress in the user interface. When the 95 development group strives to develop, NT is also launched. This is the title C2 pole OS. Of course, I don't believe the strongness of the system, If its source code is open, it is likely to hit. Of course, the NT is still in a routine point. It is a true 32-bit system. And, 5 applications: Win32, VDM, POSIX.WOW, OS / 2. These five environments are independent of each other, and the operating system only provides interfaces for Win32 environments. Win32 provides other environmental interfaces, and other environmental API calls are finally converted to Win32, enter the OS core. In other words: Win32 is The owner of the screen, mouse, keyboard, other environments are to be applied to the Win32 subsystem. The current Win98 is a large hybrid. It contains all 95 driver mode, plus WDM. It is difficult to imagine. If there is a hardware requires an open driver. You must first look at it, what model is suitable. MINIPORT? NDIS? HID? Ring0? Ring3? Almost every hardware corresponds to a mode.: Undocumented Hint NT hidden an environment. It is a native environment. This environment can be said that there is basically no in the document. There is no support. Only a small part of the Native API.Native environment is especially important in the system startup. Native application is a Native application. Program. When running the program, there is no Win32 environment at all, there is no WOW, POSIX environment. This time only the Native API is available. And MS is in many cases, relying on the Native API to get a higher application efficiency. Get Unfair competitive advantage. Some Native APIs can even have to complete the system's security check to complete the original task that cannot be completed.
The biggest difference between VXD and KMD is that VXD does not need to consider multi-CPU issues. The KMD needs to call spin locks to synchronize data access between multi-CPUs. Of course, if necessary, increase the support for multi-CPU through VXD should not It is difficult because VMM provides a very open environment: VXD can block the VMM call entry. Similar to the DOS era intercept INT21 to extend system service. And if it is to expand the system is difficult. Because this is not open (Of course, the method is still there. Waiting for a period of time again :)) Another important difference is that VXD can get the system's control when the CPU is in real mode. And KMD can't. Wait for the first one Start timing, the CPU is already in protection mode, and even if you replace HAL or NTOSKRNL. Because the CPU mode switch is NTLDR: (How do I decide whether to use VXD or KMD or WDM? Of course, first should consider Application platform. If it is nt4.x, you have not gotten it, it is definitely KMD. If it is Win95, there is only VXD a choice. When the target platform is 98 or Win2000, you can choose more. But also Limited by the OS specification. If you want to develop FSD, you must use VXD. Although 98 has a WDMFS.SYS, but it is not a real WDM file system driver .98 supported FSD is based on IFSMGR .Vxd is based on VXD. If you want to engage in a series of Driver, you have to write vxd. Because 98 does not provide WDM support for this class. So 98 What can I use WDM? HID, Network class, multimedia hardware support has been transformed to WDM. You can already discover these types of drivers from DDK. Under NT2000. I am not very familiar. But it is clear. More support for WDM will be more Old KMD will gradually exit the stage. Of course, KMD has his unhakable advantage. (In NT, KMD is much more vxd than 9X. But there are still some active rooms. For example, the Disk driver can access video hardware Other resources, but with the development of NT, these active rooms in the morning and evening will also be canceled.) WDM needs to register themselves to the corresponding class. There is a corresponding routine must be output. Some is similar to minidriver. In order to consider Driver author's habits. Which model is more familiar, writing is more convenient, which one is used. I personally developed 98/95 platforms. So it is more inclined to VXD: Safe limit. And, I like compilation. :)?
Some stuff in ntkern.vxd