Книга: Writing Windows WDM Device Drivers

Testing PHDIo

Testing PHDIo

Installing PHDIo

The PHDIo driver was initially aimed just at the NT and Windows 2000 platforms. However, I found that it works fine in Windows 98. These installation instructions are for both types of platform. You do not need to remove or disable existing drivers yet. Installing and running PHDIo does not make it use any resources. It only asks for resources when a Win32 program, such as PHDIoTest, runs.

These instructions describe how to install PHDIo by hand, by copying files and making registry entries. See Chapter 11 for details of how to automate this process.

Start by copying the driver executable PHDIo.sys to the Windows System32Drivers directory. Use the checked build version of PHDIo.sys if you want to view its DebugPrint output. The version of DebugPrint supplied with this book does not run under Windows NT 3.51 or NT 4.

Make a registry key for PHDIo at HKLMSYSTEMCurrentControlSetServicesPHDIo. Make the values specified in Table 15.6. The Start value of 2 indicates that the PHDIo driver should be loaded once the system is up and running. In Windows 98, also add an ImagePath REG_SZ value with SystemRootSystem32DriversPHDIo.sys.

Table 15.6 PHDIo driver registry values

Name Type Contents
Type DWORD 1
Start DWORD 2
DisplayName REG_SZ "PHDIo"
ErrorControl DWORD 1

Now reboot your system. The PHDIo driver should now be running. Check the DebugPrint output to see that it has generated a few start-up trace messages.

If you change the driver, the actions you must take to use the new version vary from platform to platform. In Windows 98, you must reboot the system. In NT 3.51 and NT 4, use the Control Panel Devices applet to stop the old driver and start the new one. In Windows 2000, use the book software Servicer utility to do the same job.

The PHDIo driver is started in all Hardware profiles.

Running PHDIoTest

The PHDIoTest software is in subdirectory PHDIoExe of the book software. As mentioned previously, PHDIoTest opens the PHDIo device with this filename: .PHDIoisaio378,3irq7override. This filename tells PHDIo which resources to use. In this case, an I/O port of 0x0378-0x037A (length 3) and IRQ7 are specified. Change these values if your parallel port is configured differently. The override specifier means that PHDIo should go ahead and use these resources even if they conflict with another device.

In a similar way to WdmIoTest, you must disable any existing devices that talk to the parallel port. In Windows 98, use the WdmIo hardware profile, with the WdmIo driver removed. In W2000, NT 3.51, and NT 4, you must change "parport" driver startup option to Manual (3) and reboot. The override specifier is usually needed to make PHDIoTest work in Windows 2000.

You should now be able to run PHDIoTest successfully on all these Windows platforms.

As with WdmIo, if you use PHDIo to talk to some of your own custom hardware, you should not need to do any clever hardware configuration, as only you will know where your device lives.

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


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