Solved

DMA Transfer

Posted on 1997-04-22
4
427 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.
0
Comment
Question by:kayl
  • 2
4 Comments
 

Expert Comment

by:agopal
ID: 1334721
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
 

Author Comment

by:kayl
ID: 1334722
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
 

Accepted Solution

by:
bigG earned 150 total points
ID: 1334723
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
 

Expert Comment

by:agopal
ID: 1334724
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

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video discusses moving either the default database or any database to a new volume.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now