DOS/4G and DOS/4GW FAQ: Hardware I/O
[Previous Section] *
[Index of FAQ] *
[Next Section]
-
Can I virtualize I/O ports under DOS/4G?
-
Is there any restriction on using the I/O address
space access functions, such as
inp(), with DOS/4G?
1.
Can I virtualize I/O ports under DOS/4G?
We've been approached about this several times, so we have a pretty
good idea about what's involved and it isn't pretty.
You would need to set up a TSS that had an IOPL that caused trapping
for accesses to your I/O ports. Unfortunately, DOS/4G doesn't normally
use a TSS, although it has at various times. What's worse, we're not sure
how you would switch from the 4G TSS (if it existed) to yours. This is
complicated by the fact that DOS/4G programs run in ring 0 under native
DOS or a VCPI host, and at ring 3 under a DPMI host like Windows or Win 95
or NT or OS/2. Also, DPMI doesn't allow for more than one extender, so
you can't even set up something to trap the references before 4G comes
into play.
Seriously, doing what you want is definitely possible, but it is also
definitely not easy. You would need to replace a bit of the extender,
which isn't too hard but makes the packaging issues a bit sticky.
So far, we have not decided to do I/O port virtualization.
2.
Is there any restriction on using the I/O address
space access functions, such as inp(), with DOS/4G?
No. We neither add nor subtract from the I/O address space that can
be addressed. This is controlled by the operating system that you are
using.
For example, using plain DOS will let you address all 65K I/O ports,
while in a Windows/NT DOS box, you will probably not have access to very
many ports (although NT does simulate some)!
|