Date: Tue, 4 Nov 1997 13:25:17 +0200 (IST) From: Eli Zaretskii To: satoh AT asd DOT tnes DOT nec DOT co DOT jp cc: djgpp AT delorie DOT com Subject: Re: DMA transfer In-Reply-To: <199711040117.KAA11803@asd.tnes.nec.co.jp> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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.