Mail Archives: djgpp/1997/09/25/04:39:31
> At this point, it is valid to write the following:
>
> indos = _farpeekb(_dos_ds, es*16+bx);
>
> 'es' (the real mode selector, AFAIK) must be multiplied by 16 to be valid
> (I don't know why, but the info page for _far* says so, so I do it :), and
> then the offset ('bx') is added to that, resulting in a valid address in
> the _dos_ds segment.
>
No, it's alright. I understand this now, I just got a little confused. The
es:bx returned by __dpmi_int are a valid address in the segment `pointed to'
by _dos_ds.
> My question was not weather InDOS can be accessed like this; I know it can
> and have written some ISRs that in fact do it. My question was, if the
> _far* functions perform some sort of memory protection, what is the result
> when 'es' and 'bx' are garbage? Based on what you said, I now believe it
> would be a SIGSEGV.
>
Actually, I don't think so anymore. If es and bx are garbage, es*16+bx will
still be within the 1Mb segment, so it should be valid to do a a _far* call.
But the answer you get will be rubbish.
> > Could you please tell me what this InDOS flag is and how it works? I have
> > heard it mentioned a couple of times.
>
> The InDOS flag is part of the internal DOS data structures. Whenever a DOS
> function is entered (INT 0x21, other DOS interrupts) this flag is
> incremented. While this flag is nonzero, you -CANNOT- call any DOS
> function, since DOS in non-reentrant; doing so will cause Bad Things(tm).
> Therefore, whenever a properly-written, DOS-calling ISR enters, it checks
> the InDOS flag, and if it is nonzero, does not do anything.
>
> I recommend Ralf Brown's Interrupt List for more information.
>
Thanks
I've meant to read through that, but it's just soooo big! I'm getting there
though...
Brett
--
"Give me ambiguity or give me something else"
--
Brett Porter
bporter AT rabble DOT uow DOT edu DOT au
http://www.geocities.com/CollegePark/Union/3596
Humour, Programming, and more.
- Raw text -