Solved

DMA Transfer

Posted on 1997-04-22
4
431 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem updating Access table using VB code 8 48
Enable Clear Text in Win 8.1 7 41
What is UAC Virtualization in the Process (TASK) Manager? 4 1,141
Problem to open text file 11 69
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
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…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

912 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

17 Experts available now in Live!

Get 1:1 Help Now