Solved

DMA Transfer

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

825 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