The information in this article applies to:
SUMMARYIn version 3.0 of the Microsoft Windows graphical environment, enhanced mode does not support the Auto-Initialize mode of the 8237 direct memory access (DMA) controller. This is due to a limitation of the virtual DMA device (VDMAD). This article discusses one possible method (short of modifying VDMAD) of partially supporting the Auto-Initialize mode. MORE INFORMATION
The VDMAD does not support the Auto-Initialize mode of the 8237 DMA
controller. If an application attempts to program the DMA controller
in Auto-Initialize mode, VDMAD terminates the application.
In VXDMAD's XDMA_Mask_Channel service, if the channel is owned by
VXDMAD, ignore the call to mask the DMA channel. See below for how
VXDMAD retrieves the mode and channel to look for.
To make things clear, the data segment for this fictitious VxD should
be defined as follows:
This brings us to the next thing VXDMAD must do. VXDMAD checks the
channel and mode to ensure that it should not let the VDMAD mask the
channel. VXDMAD can perform the check only if VXDMAD knows the channel
and mode the application uses. Therefore, VXDMAD must also implement a
communications method for the application to tell this VXDMAD the
channel and mode to monitor. The easiest way to provide a
communications method is to use the one API that a VxD can "export" to
applications. For this example, VXDMAD only needs a protected mode
API; however, there is no reason why this could not be done for the
real mode API.
The two functions VXDMAD must implement are: one to set the channel to allow Auto-DMA, and one to set the mode for that channel. These functions are implemented as follows:
The XDMA_Set_Mode function must allow the calling application to set
the state of the "auto-init" mode bit used on DMA transfers. This
function only tells VXDMAD if the DMA channel (set by
XDMA_Set_Channel) is in auto-init mode. The application still needs to
execute the OUT instruction to the mode port, with the auto-init bit
cleared, to set the physical DMA mode and have that setting reflected
in the VM's virtual state, which is held by the VDMAD that traps the
port.
The XDMA_Set_Channel function virtualizes the channel specified (in
AL) so that VXDMAD can take control when the port (physical) mode is
set.
The only function remaining is the handler for the DMA channel. This
handler is called every time the physical state of the DMA channel
that VXDMAD is virtualizing changes. This will force the DMA_AutoInit
bit to be set if the application has requested that it be set (using
XDMA_API_SET_MODE and XDMA_API_SET_CHANNEL).
Once the VXDMAD VxD is installed (from the SYSTEM.INI file), an
application must contain code similar to the following to use its
services (the Interrupt 2Fh functions are documented Appendix D of the
"Microsoft Windows Device Development Kit Virtual Device Adaptation
Guide" for Windows 3.0):
If the above code succeeds, then the VXDMAD's API can be called by the
following code:
If the above two calls succeed, the application can use auto-
initialize mode. The application must execute an OUT instruction to
set the physical mode of the channel -- WITH THE AUTO-INIT BIT
CLEARED! VXDMAD sets the Auto-Initialize bit at the right time.
The following information is from RichP in response to a customer
needing to use Loop-mode (a/k/a Auto-Initialize mode) DMA (NeilSa
had the SR; the SR number is G900612-110):
In 3.0 this auto-initialize mode isn't supported directly. The problem involves trying to track ownership of the DMA transfer. VDMAD was designed for per-VM DMA transfers, but the nature of this device sounds like it is global DMA. It would be possible for them to write a very small and simple VxD which calls VDMAD to virtualize their DMA channels. VDMAD provides services for additional VxD's to handle special types of DMA. I have already helped an OEM write a similar device for a network adapter which uses global DMA. This is the only proposed work-around at this time. Additional query words: 3.00
Keywords : |
Last Reviewed: November 1, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |