Mail Archives: djgpp/1996/09/18/23:15:17
Derek Smith <dsmith AT cybernet DOT com> wrote:
>I am trying to get the physical address of a block of memory returned by
>doing a malloc (or some other memory allocation function) to pass to the
>DMA controller. I cannot figure how to obtain this physical address.
>Can anyone provide some insight for me.
Don't try - it is theoretically possible to do some DMA transfers
between 1Mb and 16Mb (I think?) of physical RAM, but far safer to
stick to the first meg.
Use the DPMI functions to obtain a block of RAM below 1 Meg (DOS ram).
Fill it with your choice of method (dosmem[pu|ge]t, farptr, nearptr)
Use the good old Segment*16+Offset formula to create a physical
pointer for it...
...and pass to the DMA chip.
Examples: Find that DJGPP v2 sound blaster library, wherever it's
gone.
>Thanks,
>Derek
Regards,
ABW
---
COMPUTER: We are in position over the Rebel homeworld.
VADAR: Engage the Death Star primary weapon, let those rebel worms die!
COMPUTER: Sorry, your evaluation version of Battle Computer 3.0 has expired.
Please send 2.6 billion dollars to the address in REGISTER.TXT
Alaric B. Williams Internet : alaric AT abwillms DOT demon DOT co DOT uk
<A HREF="http://www.abwillms.demon.co.uk/">Hello :-)</A>
- Raw text -