We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

DMA Transfer

kayl
kayl asked
on
Medium Priority
468 Views
Last Modified: 2013-12-04
I have a data aquisition card which transfer data to the
memory with DMA transfer. The card  works in demand
mode of the DMA controller. How to program DMA transfer
from 16-bit  windows application. Is it possible from application
or should i use special device driver for that card, or new VXD.
Comment
Watch Question

Commented:
It is not directly possible from application to access physical devices.You probably want to write it as a Vxd to virtualize your device for all VM's (DOS boxes etc.).
From a 16-bit application you could use Int 2fh Fn. 1684
to call the service Interface exported from the VxD.
If you are looking for an asynchronous operation you could
also write an interrupt handler in the Vxd that traps a protected
mode software interrupt which is generated from the application.For more information read Writing Virtual device
drivers by David theilan and Bryan Woodruff


Author

Commented:
In 16-bit application for Windows 3.* you CAN use "in" and "out"
port operaration though they are virtualized by VxD. My problem is
that i CAN'T programm specific device- DMA controller and i CAN
programm specific ports on my data acquisition card (it works
quite well)
Commented:
You can still use the in and out port functions in Windows 95, but not for DMA operations. The problem is that you deal with virtual addresses and virtual machines. You cannot access a physical memory location (ring 0) from you 16 bit application
(ring 3). Each application has its own memory space and you have to map the physical DMA buffer into that space.
You have to write a VxD to do that. In your VxD you can utilize the virtual DMA services provided by Windows 95, if you are using the PC DMA controller. If your card has its own controller (e.g. PCI bus master) than you have to write your own services within the VxD.
Writing a VxD and implementing DMA is not straight forward unfortunatley.
A very good source is the book Systems Programming for Windows 95 from Walter Oney, Microsoft Press 1996. The book guides you through all the major issues developing VxDs and is accompanied with a CD full of excellent examples.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Commented:
Yeah right. You could use _inp and _outp of runtime library too
to access physical devices,PROVIDED, it is your own custom device
like the data acquisition card you mentioned. But it is not possible to directly modify the DMA controller's(there are 2 in the PC) registers (8-9?)., since the VDMAD traps these I/O ports.
To solve your problem you might have to use VDMAD services called
Virtual DMA Services(VDS)which is available thro' int 4bh .
Note also the kind of buffer you need to pass on to DMA.It should be physically contiguos,fixed and page locked and aligned on a 64-kb boundary.
(Not : All the comments above are for 16-bit driver type DLLs)


Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.