delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/21/07:11:49

Date: Wed, 21 Jul 1999 11:01:56 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Sahab Yazdani <beyonder69 AT geocities DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: low memory allocation
In-Reply-To: <379493EB.EA1C3898@geocities.com>
Message-ID: <Pine.SUN.3.91.990721110138.7757L-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Tue, 20 Jul 1999, Sahab Yazdani wrote:

> In one of the functions: 
> init_mixing, it calls a  function called low_malloc (which is prototyped
> in a header file called lowmalloc.h) which allocates the mixing buffer
> depending on the style of the SoundBlaster (8bit or 16bit).  I don't
> understand why this memory block has to be in a convensional(?) space
> rather than the upper blocks?

What's the difference?  Both conventional memory and UMBs can be
accessed by real-mode code, so you shouldn't be bothered.  It's really
up to DOS to decide which block it returns to you.

> If it has to be in the conventional space, then I have found the
> function:  __dpmi_allocate_dos_memory (is this what I'm looking for)

Yes, it seems like this is the DJGPP equivalent.

> and
> how do I get the pointer to the memory, cause all it returns is the
> segment and a pointer to a selector, which I have no clue what to do
> with!! 

The segment and the selector give you two ways of addressing the
same allocated block.  Check out section 18.4 of the FAQ for a
description of how to move data between your program and conventional
memory, just disregard all the first part that tells you howe to get a
selector, since you already got one.  Section 18.2 has a complete
working example of a function that moves data from a conventional
memory buffer, use that as a starting point.

- Raw text -


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