>>
> I know that in NT4 it was possible to use 16-bit drivers, but i thought
> that went away with Win2K, about 14 years ago. Trapping reads and rites
> to I/O ports sounds so completely bizarre in a modern system (well, any
> ststem) that I can’t see the point to it. Besides, if the ports simply
> don’t exist, how can you trap operations on them at all?
>
I don’t believe the OP mentioned the words “modern system” anywhere.
*****
Actually, it was implied. The issue is how to rediect physical LPT
operations to a USB printer interface. It may have been possible in
Win2K, but my memory says that USB was not supported in Windows until XP.
XP will not run at all on legacy hardware, so it is an XP+ OS running on a
modern system.
*****
> It seems to me that it would be more effective to define a device that
> supports the abstract interface and talks to USBD.
Given the choice between adding USB access to a 16 bit app or trapping
writes to a hardware port to make it think it was poking the ports of a
real LPT interface, I’d go with the latter.
*****
I will admit that it has been many years since I looked at the debug
registers that trapped port operations. So I don’t know if they support
trapping operations to nonexistent ports. The te question arises about
how much of MS-DOS is /really/ implemented in NTVDM. I know that a lot of
hairy operations I would do with disk and video INT calls, and most of INT
21h are explicitly NOT supported. Now, if we put an NTVDM running under a
hypervisor, exactly how much of the old MS-DOS is supported? If 20% of
the operations are not trapped, that might be because (a) that feature was
deliberately unsupported (b) it was supposed to be supported, but this is
the first time someone has exercised it on the parallel port adresses If
(b) it could be a bug in NTVDM, in which case (a) 16-bit support is dead,
and it will never be fixed, and (b)… wait a moment…I don’t think there
is a (b) here!
Then, of course, if it is being run under a hypervisor, we have a whole
new world of hurt, and what are the chances the hypervisor would be fixed
to support 16-bit apps…
If you have a printer driver that supports te full XXX capability of a
legacy printer card that supports XXX (and I have forgotten te TLA that
designates such drivers, then simply opening LPT and sending te right
commands (most likely, DeviceIoControl) to it should have the correct
effect whether it s a real, physical port with one of te “well-known”
hardware port address ranges, or something tat has a USB interface. My
memory is that MS-DOS only supported a very limited set of operations on
parallel ports, and you could not read or write all status bits, ad could
not read data bits. So a VDD (which I always thought of as te positive
voltage supply to a NMOS chip) would have been required to get these
capabilities. Then users started needing to handle messages being sent
back by printers, and a third-party market for XXX interface boards and
fully-compatible XXX drivers grew around the needs. I stopped worrying
about parallel ports when I discovered tat all my printers only supported
serial interfaces (well, OK, two were 10-baseT and one is 100-baseT serial
iterfaces) and lost interest in the problem, but I have this menory that
Microsoft started supporting the full XXX capabilities for Win2K, or maybe
XP–perhaps someone who cares about parallel ports can confirm or deny
this memory. That being so, the need for a complex driver to support what
is already supported seems to be a lot of work for no particular gain.
And it does raise the question about whether or not te USB-to-parralel
adapter supports te XXX featured.
Now, if I’m running NTVDM and open LPT, and te “real” LPT device is a USB
adapter, what happens?
So te question I would ask of this group, if I had this problem, would be:
“I have a legacy app that uses a VDD under NTVDM to manipulate the full
capabilities of an XXX parallel port. I need to change this so te app,
running under NTVDM, can access the device capabilities for a
USB-to-parallel interface. The operations I need to support are operations here>. What is the best way to achieve this?”
Note that nowhere did I refer to an implementation detail such as port
traps. That may be how MS-DOS had to implement it, but I’m working in a
richer environment. The solution may be far easier than trying to
discover why port writes are not being trapped. Yes, quarter-round and
putty can disguise a multitude of sins, but it may not be necessary to
commit them in te first place.
*****
>
> Have a think about how you would write a dos emulator if it took your
> fancy to do so. Any program that wants to directly fiddle with the bits of
> a parallel port is going to use io port access. The BIOS calls might do
> for simple unidirectional printing but for anything else it’s io ports.
> Are you going to trap that access and then simulate the action over the
> USB parallel port, or are you going to dig up the developers of the
> application (maybe even literally dig them up!) and ask them to rewrite
> their app to conform with your idea of how the world should work?
>
****
Since we have no actual description of the problem, except one that says
“port trapping does not appear to work”, we don’t know what the VDD specs
are, so it is very hard to guess at te correct answer. We don’t know if
an app is writing to physical ports and the purpose of te VDD is to trap
such actions, or what the interface is that is attempting to be supported.
Too many times in my life I have been in the “We can’t change te app”
constraint, only to discover, after many weeks of stressful effort (read:
90-hour weeks) I expended to solve the problem, that the actual source
code required only FOUR LINES be changed. No mention of this as a
parameter of the problem space appeared.
Sort of like “What’s the best way to glue wings to a pig” fails to specify
that the “wings” are a 20-foot aluminum wing from a small aircraft and the
pig is one of those miniature pigs. In that case, the answer might be
“use bungee cords to strap the pig on the top of the wing” (which may
cause problems with airflow and change the stall speed or L/D ratio, or
annoy the pig), or “cut a hole in the center, create a cockpit for te pig,
and make a cover for the hole that does not affect the aerodynamic
properties”.
So your above description is just guesswork, anf may or may not reflect
the actual situation. In addition, if the VDD intercepts 100% of the port
operations, how does it call the host OS USB support (and by “host” I mean
“the 32-bit OS which is running the NTVDM”)
joe
> James
>
>
> —
> NTDEV is sponsored by OSR
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> 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
>