Mail Archives: djgpp/2001/03/24/03:34:02
> From: "chris tsui" <candeia99 AT hotmail DOT com>
> Date: Fri, 23 Mar 2001 13:44:03 -0800
>
> Here's my problem. I am try to map physical memory for
> my PCI card so that I can excises the 24bit DMA engine.
>
> So I did some research on the DJ FAQ and found I can
> use XMS manager to allocate extended for me and map it
> to linear.
Why didn't you use the method described in section 18.7 of the FAQ?
There's a skeleton of working code there that you could use as a
starting point. It should have saved you all the grief of going
through XMS and hitting a brick wall.
> I know I can talk to the xms driver because I got the version
> number right. The problem is I can never allocate any memory.
> function 08 or 88 kept telling me all the extended memory
> is allocated. Why??
>
> I only have device=c:\dos\himem.sys
See section 3.9 of the FAQ, specifically this fragment:
- Memory managers provide an API for allocating extended memory called
VCPI (the "Virtual Control Program Interface"). Using that API allows
CWSDPMI to allocate only as much extended memory as is needed, leaving
the rest for non-DJGPP programs, in case you invoke them from DJGPP
programs. In contrast, without a memory manager, CWSDPMI will allocate
all of the available extended memory to itself, leaving none of it to
non-DJGPP programs. This consideration is especially important if you
use some DJGPP program, like Bash or Emacs, as your primary system
interface.
For this reason, section 3.9 suggests to install a memory manager, to
avoid this side effect.
But I'd suggest to abandon this mess with XMS and use the DPMI calls
as explained in section 18.7 of the FAQ.
- Raw text -