Testing the Parallel Port Loopback Driver

< BACK  NEXT >
[oR]

At this point, a real driver is working, touching real hardware. A tester routine is included with this driver to demonstrate correct functionality and use. It verifies that the driver

  • Sends IRPs from its Dispatch routine to its StartI/O routine.

  • Responds to device interrupts.

  • Transfers data successfully.

  • Completes requests.

  • Manages requests from multiple callers.

On the other hand, this driver is far from complete. It assumes that all data transfer requests complete without error. Simply removing the parallel port loopback connector before starting the test demonstrates this problem a hung system. Subsequent chapters correct this problem as well as explain and demonstrate the correct way to locate hardware.

Testing Procedure

When testing programmed to I/O device drivers, it is advisable to follow a fixed procedure.

  1. Write a minimal Start I/O routine that simply completes each IRP as soon as it arrives. This allows the test of the linkage between the driver's Dispatch and Start I/O routines.

  2. Write the real Start I/O routine, the ISR, and the DpcForIsr routine. If the driver supports both read and write operations, implement and test each path separately.

  3. Exercise all the data transfer paths through the driver with a simple Win32 program that makes ReadFile, WriteFile, and DeviceIoControl calls.

  4. Stress test the driver with a program that generates large numbers of I/O requests as quickly as possible. Run this test on a busy system.

  5. If the device is sharable, run several copies of the test program at once to be sure the driver works with multiple open handles.

  6. If the driver supports multiple physical devices, repeat the test with each device unit.

  7. If possible, repeat steps 4 to 6 on a multiprocessor system to verify SMP synchronization.

< BACK  NEXT >


The Windows 2000 Device Driver Book(c) A Guide for Programmers
The Windows 2000 Device Driver Book: A Guide for Programmers (2nd Edition)
ISBN: 0130204315
EAN: 2147483647
Year: 2000
Pages: 156

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net