[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dma transfers



>   I am trying to move data from a buffer in main memory
> into the PCI device using an on chip dma controller (i960RP).
>   
>   I wrote the code to work under dos and compiled it with borlandc 3.1.
> The program works fine in dos mode.
> 
>   When I try to run the program in a dos window under win'95, the 
> transfered data is not as it should be. I guess the win'95 is switching
> the tasks so that the address I delivered to the dma controller as a 
> parameter that is pointing to the begining of the block, is not always
> containing my buffer.

>   How can I tell the win'95 that the buffer should be locked in memory?
> Is it possible (given the fact that the code is a standard dos exe)?

Um... You need to dig in and find the documentation on the "Virtual DMA
Services" or VDS.  It provides an interface for 'dma scatter lock' whereby your
logical buffer address becomes a list of page addresses [and the appropriate
pages are locked down].   You will of course have to modify your 960 code to
deal with this concept of 'scatter-gather' dma, i.e. each 4K block could (and
will) be somewhere else in physical memory.

VDS is invoked via Int 4B calls from your application.  A copy of the VDS 1.0
specs is included on the latest MSDN Library CD.

Under win95, a VxD (Virtual device Driver) is a MUCH better IO driver
interface... processing memory, i/o, and interrupts from a dos job invokes
massive amounts of overhead, as many things are trapped and emulated.  Writing
and debugging VxD's however is not easy.

-jrp
í
ð