Mail Archives: djgpp/1998/11/01/11:35:20
Eli Zaretskii wrote:
> One of the methods described in the FAQ, the one which uses the VDS API,
> can handle this, AFAIK.
Thanks for the suggestion. I looked at VDS a while back, and it didn't
really meet my needs. If I remember right, VDS will allocate contiguous
physical pages for your buffer. What I really need is to use an
application's pre-existing buffer, contiguous in virtual memory -- maybe
not contiguous in physical memory. The card's DMA engine is setup with the
virtual to physical mapping of the buffer, then the DMA is started.
Anyway, I figured out my problem with the page tables. I had used the
__djgpp_map_physical_memory() to map all of the 1st Meg into my
application's memory space to make access to that space a bit easier, and
faster(?). Aparentlly, this didn't work so well (I'm still not sure why).
So, when I thought I was reading the global descriptor table (GDT), I
really wasn't. Now I use the following to access the 1st Meg memory:
assert( __djgpp_nearptr_enable() != 0 );
dosBase= __djgpp_conventional_base;
gdtEntryAddr= dosBase + gdtPhysicalBase + gdtEntryOffset;
gdtEntry= *gdtEntryAddr;
(Caution: Using __djgpp_nearptr_enable() bypasses some very good protection
mechanisms and may be hazardous to your code's health.)
Harold Roman
- Raw text -