Mail Archives: djgpp/1997/11/04/06:26:23
On Tue, 4 Nov 1997 satoh AT asd DOT tnes DOT nec DOT co DOT jp wrote:
> But malloc() function returns virtual memory address, and I
> have no idea to translate malloc'ed virtual memory address into
> physical address.
Your best bet is to allocate DOS memory (below the 1MB mark) by using
the `__dpmi_allocate_dos_memory' library function. That area is
mapped 1:1, so the linear address you get (segment*16 + offset) is
also the physical address you can pass to the DMA controller. The
disadvantage of this method is that you will need to move the data
from and to your program's data buffer, which incurs additional
overhead.
The other alternative is to use the VDS (Virtual DMA Services), which
is implemented as a few functions of interrupt 4Bh. But CWSDPMI
doesn't currently support VDS, so your program will not work when run
on machines with no memory manager (EMM386, QEMM, Windows, etc.)
installed.
- Raw text -