Code Example: Parallel Port Loopback Driver
This example shows how to write a basic programmed I/O driver for the parallel port. The code for this example is in the Chap8 directory on the disk that accompanies this book. Several code fragments follow.
Purpose of Driver
The purpose of this driver is to allow a test program to output nibbles (4-bit quantities) to the parallel port with the loopback connector attached. The data returned by the connector is stored in a temporary pool buffer within the driver. Thus, subsequent reads to the device should return the same nibble data that was output. Just to keep things interesting, the driver returns the nibble data shifted left by four bits.
Since the loopback connector is wired in a non-straightforward ...
Get Windows® 2000 Device Driver Book: A Guide for Programmers, Second Edition, The now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.