It is going to be a Very Bad Idea to go for the port directly. It is
generally a Very Bad Idea to assume there is even a parallel port
available on most modern computers. The interface is, as far as I
remember, officially deprecated.
If there is a parallel port, it has already been claimed by parport.sys
and it is therefore not available to you.
In the past, I’ve usually been asked this question by someone who has
hacked together some device, often homebuilt, but frighteningly frquently,
some proposed product. Often the question arises because the device has
some critical timing constraint (either input rate or response time) which
must be met. The prototype was tested on some old MS-DOS machine in the
hardware lab.
I would first suggest that plugging anything at all into the parallel port
(including printing devices) should be considered A Really, Really Bad
Idea. Among other very real problems, the problem of Fried Motherboard
Syndrome from improperly-designed static discharge protection is
significant. Decades ago, when we thought about doing a student hardware
lab with a $15,000 minicomputer, we looked into building an opto-isolated
bus interface so there was never an actual electrical connection between
the external device and the backplane. The optoisolators would be
socketed so if they were fried they could be easily replaced. But we
never got the budget for the lab, so the board was never built.
If you are comfortable with the idea of using the parallel port, then you
will want to look at IoAttachDeviceToDeviceStack, or whatever it is called
in KMDF, to establish your device as a device that wants to communicate to
the lower-level driver. I have no idea what can go wrong here, but the
failure modes (such as what happens if a user tells Windows that a printer
is attached to that port) are going to be profoundly ugly.
I’d suggest buying some generic parallel I/O card and using its driver.
You will save much pain and agony.
joe
Hi All,
I am working on a virtualization product where I need to access the
parallel port hardware from VM.
Based on the porttalk.sys sample driver, I can access parallel port and
use READ_PORT_UCHAR and WRITE_PORT_UCHAR calls for reading and writing to
the hardware…
But now comes into picture parport.sys parallel port driver provided in
Windows… According to MS documentation this driver should be used to
interact with the hardware… How can I use it ?
Is there any problem with using a simple driver that calls READ_PORT_UCHAR
and WRITE_PORT_UCHAR calls ?
Please suggest…
Thanks
Anshul Makkar
www.justkernel.com
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer