DMA Transfer

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.
kaylAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

agopalCommented:
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


0
kaylAuthor 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)
0
bigGCommented:
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.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
agopalCommented:
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)


0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.