Книга: Writing Windows WDM Device Drivers

Installing NT Style Drivers in Windows 98

Installing NT Style Drivers in Windows 98

It is often possible to use an NT style driver in Windows 98. The NT style PHDIo driver described in Chapters 1.5-19 can be run in Windows 98 as well as the NT and Windows 2000 x86 platforms. PHDIo is a generic driver for handling simple devices and it is useful to be able to install it in Windows 98.

The DebugPrint driver described in Chapter 14 is currently installed as a WDM Plug and Play device. However, it would be perfectly sensible for it to be installed as an NT style driver. Quite a bit of its infrastructure would change. It would not have an AddDevice routine and it would not receive Plug and Play IRPs. This would actually make the driver quite a bit easier!

Contrary to my expectations, an NT style driver can use various kernel calls that are not supposed to be available to it (e.g., HalTranslateBusAddress for bus address translation, HalGetInterruptVector to get an interrupt vector, and IoReportResourceUsage to grab resource assignments). With these routines, an NT style driver such as PHDIo can use I/O ports and interrupts. You will have to experiment to see if DMA resources can also be used.

An NT style driver can use other techniques to talk to hardware. It could attach itself to another driver device and interact with hardware that way. Alternatively, I assume that it could use the available VxDs to interact with hardware.

You have to install an NT style driver "by hand" in Windows 98. In other words, the Add New Hardware wizard will not process an INF file nicely for you. Instead, a relatively straightforward program will be needed to copy the driver executable, set some registry values, and reboot the computer. For example, if you were trying to install a driver called AbcXyz, you would use the following steps.

• Copy the driver executable, AbcXyz.sys, to the Windows System32Drivers directory.

• Make a new registry key HKLMSystemCurrentControl SetServicesAbcXyz, replacing AbcXyz with your driver name.

• In this registry key, set the values according to Table 11.6.

• Restart Windows 98.

Table 11.6 Windows 98 registry values

Value Type Contents
Type DWORD 1
Start DWORD 2 as per Table 11.4
DisplayName REG_SZ AbcXyz" driver name
ErrorControl DWORD 1 as per Table 11.5

Оглавление книги


Генерация: 1.146. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз