www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/11/10/00:40:45

Date: Wed, 9 Nov 1994 19:01:03 -0600 (CST)
From: ALAN L HIGHTOWER <alh AT engr DOT engr DOT uark DOT edu>
Subject: Re: Real Mode pointers.
To: Scott Deming <sad AT id DOT net>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu


On Tue, 8 Nov 1994, Scott Deming wrote:

> 
> I'm having a little difficulty getting something to work, so maybe someone 
> here can help me out. :)
> 
> What I need to do is allocate a chunk of conventional memory.
> 
> Here is what I've got right now:
> 
>     char *convBuffer;
>     _go32_dpmi_seginfo convAlloc;
> 
>     convAlloc.size = (fStat.st_size+15)/16;
>     if (_go32_dpmi_allocate_dos_memory(&convAlloc) != 0) {
>         return (NULL);
>     }
>     convBuffer = convAlloc.rm_segment;
> 
> This doesn't seem to work.  What do I need to do to make "convBuffer" point 
> to the "segment:offset" of the conventional memory allocated with 
> _go32_dpmi_allocated_dos_memory()?

   I'm by no means an expert, but I recently went through this in 
allocating real mem for dma transfers.  The rm_segment member of the passed
structure contains just that, a real mode segment value of the allocated
memory block.  First you have to get the offset into conventional mem, done
my a simple multiplication by 16.  Then add it to I believe 0xe0000000, 
the location that go32 remaps real mem into...  From there, things should
be hunky-dory...  Alternitivly, and the way I did it, is to use dosmemput 
and dosmemget to copy the info over...   

Hope this helps.

- Raw text -


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