www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/09/18/23:15:17

From: alaric AT abwillms DOT demon DOT co DOT uk (Alaric B. Williams)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Physical Memory Addresses
Date: Wed, 18 Sep 1996 20:06:24 GMT
Lines: 40
Message-ID: <843077144.28180.2@abwillms.demon.co.uk>
References: <323EB4A0 DOT 22CA AT cybernet DOT com>
NNTP-Posting-Host: abwillms.demon.co.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


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