www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/04/06:26:23

Date: Tue, 4 Nov 1997 13:25:17 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
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: <Pine.SUN.3.91.971104132457.19533E-100000@is>
MIME-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019