Mail Archives: djgpp/2003/08/02/01:19:40
Charles Sandmann <sandmann AT clio DOT rice DOT edu> wrote in message news:<3f29ebe0 DOT sandmann AT clio DOT rice DOT edu>...
> > I'm writting some SVGA code which uses banked modes if a linear mode
> > is not availible. Now, I had an idea of, when using _farpokeb instead
> > of adding segment << 4 to the offset, which is usually A0000 + offset,
> > I would make a selector for the A000 - AFFF graphics memory buffer.
>
> SNIP. No need to map items in first megabyte.
>
> > So, is there a reliable way to make a base memory selector other than
> > just using the __djgpp_nearptr_enable() ?
>
> First allocate an ldt descriptor (__dpmi_allocate_ldt_descriptors(1))
> Set the size to be 64K.
> Set the base to be A0000
>
> You can now access it directly - no need to map the memory in 1st MB.
>
> Alternately, you can call __dpmi_segment_to_descriptor which is easier.
Yeah, while looking up dpmi functin I came across the segment to
descriptor function, but didn't like that any descriptor it made
couldn't be modified or freed, but it's nice to know that I can just
allocate a descriptor without having to map it. Thanks.
- Raw text -