Mail Archives: djgpp/1994/11/10/00:40:45
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 -