|
Packit |
d36e9b |
Notes on libieee1284 on Windows NT/2k/XP
|
|
Packit |
d36e9b |
----------------------------------------
|
|
Packit |
d36e9b |
|
|
Packit |
d36e9b |
The support for parallel ports in NT kernels is sub-optimal. The port API
|
|
Packit |
d36e9b |
specifies capabilities such as ECP Hardware support, but ports that show up
|
|
Packit |
d36e9b |
as using the ECP driver don't actually return this capability. Secondly,
|
|
Packit |
d36e9b |
data writes are not supported in non-ECP modes (ie, the only modes ever
|
|
Packit |
d36e9b |
available). To top it all off, control lines can be set to anything you want,
|
|
Packit |
d36e9b |
as long as it's the initialisation state. We end up with essentially no way of
|
|
Packit |
d36e9b |
transferring data in through the parallel port.
|
|
Packit |
d36e9b |
|
|
Packit |
d36e9b |
To work around these problems there are two possible solutions:
|
|
Packit |
d36e9b |
|
|
Packit |
d36e9b |
1) Use a driver such as PortTalk to give inb/outb permission to the
|
|
Packit |
d36e9b |
application (http://www.beyondlogic.org/porttalk/porttalk.htm)
|
|
Packit |
d36e9b |
|
|
Packit |
d36e9b |
This appears an ideal solution, but requires the writing, compilation,
|
|
Packit |
d36e9b |
and installation of a driver. Compiling a driver requires the DDK, which
|
|
Packit |
d36e9b |
is well beyond what most people have handy in NT.
|
|
Packit |
d36e9b |
|
|
Packit |
d36e9b |
2) Reverse-engineer the (undocumented) ParallelVdm driver used by the
|
|
Packit |
d36e9b |
Virtual DOS Machine to provide printer compatibility.
|
|
Packit |
d36e9b |
|
|
Packit |
d36e9b |
This option is suprisingly much simpler to implement, but has the
|
|
Packit |
d36e9b |
disadvantage that like the Solaris/x86 driver, every single read and write
|
|
Packit |
d36e9b |
requires a syscall (and reads only transfer 4 bits in nibble mode), which
|
|
Packit |
d36e9b |
adds up to very slow operation indeed.
|
|
Packit |
d36e9b |
|
|
Packit |
d36e9b |
|
|
Packit |
d36e9b |
I opted for option number 2 as it took advantage of existing capabilities of
|
|
Packit |
d36e9b |
the OS. Unfortunately this means amazingly slow operation, even on fast
|
|
Packit |
d36e9b |
machines. If you are keen to write a driver and installation routine for NT
|
|
Packit |
d36e9b |
which does essentially what PortTalk does and doesn't require the DDK for
|
|
Packit |
d36e9b |
compilation, please do!
|
|
Packit |
d36e9b |
|
|
Packit |
d36e9b |
Also note that F1284_EXCL is implicit in every use of the port in NT, as this
|
|
Packit |
d36e9b |
driver only provides one process with access at a time.
|
|
Packit |
d36e9b |
|
|
Packit |
d36e9b |
Enjoy,
|
|
Packit |
d36e9b |
|
|
Packit |
d36e9b |
- Matthew Duggan
|
|
Packit |
d36e9b |
stauff1@users.sourceforge.net
|