Mail Archives: djgpp/1996/12/16/16:37:51
On Mon, 16 Dec 1996 19:03:03 +0200 (IST) Eli Zaretskii
<eliz AT is DOT elta DOT co DOT il> writes:
>The address of __tb is a real-mode seg:off address, that's why it
>GPFed on you.
Ok, lets see if I really understand all this. If a buffer such
as __tb resides in conventional memory, it has a rmode seg:off, so trying
to access it by normal methods (ie *(__tb +1) = 5) will cause a GPF. So
I should use functions like movedata, which can copy data into conv mem
buffers.
But if I have a buffer that resides above the first meg, I can
either use a selector to access it, or access it directly? And if I can
just access it directly, I really wouldn't need to use a selector. And
doesn't a selector just contain the adress of a buffer, like a pointer?
And static arrays, dynamic arrays created with malloc(), and
blocks of memory allocated with __dpmi_allocate_memory() all exist above
conv mem, so trying to access these _doesn't_ GPF.
Wouldn't it be grand if there was a good source of info on
general pmode programming?
>What's wrong with using seg:off way and call dosmemget/dosmemput and
>all the other functions discussed in the FAQ? Why do you at all need
the
>selector?
I'd love to, it'd be alot easier... but I'm using some library
that requires I pass it not only the seg:off of a buffer in conventional
mem, but also the selector and pmode offset. So I passed it the seg:off
using ((__tb >> 4) & 0xFFFF) for the seg, and (__tb & 0x0F) for the
offset. I assume that works. But I still need to pass it __tb's
selector and pmode offset. But I've yet to find some file or another
that tells you how to get those, or expains them, so that why I asked
here.
- Raw text -