Mail Archives: djgpp/1999/04/08/14:20:32
Michael Bukin (bukinm AT inp DOT nsk DOT su) wrote:
: ams AT ludd DOT luth DOT se (Martin Str|mberg) writes:
: > Hmm. Yes that seems like a correct diagnose. At what offset of %esp
: > are the flags upon the entry of my interrupt handler (%esp+x, what is
: > x)?
:
: You will need to calculate it yourself, for example, if you push the
: following registers in stack in your interrupt handler
:
: push %%eax
: push %%ebx
: push %%ecx
:
: Then stack will look like this
:
: %flags
: selector
: offset
: %eax
: %ebx
: %ecx
Yes. But you missed the point where I said upon entry of my
handler. Hence x = 8!
Anyway I _really_ appreciate your helping comments.
Another question: teh selector is 16 bits, right? But when pushed or
popped stack changes by 32 bits?
[Klippa, klapp, kluppit some more stack manipulations.]
: BTW, you can use selector from stack to determine DPL or anything
: else necessary for allocated selector (though all allocated selectors
: will usually have the same DPL as your interrupt handler DPL).
Hmm. What is DPL? Something Priviledge Level?
So how can I determine DPL from selector? And what should I have it
for?
: Processor only blocks hardware interrupts (it does not pay attention
: to the interrupt request line), but you can generate software
: interrupts even if interrupts are disabled. I don't know restrictions
: of DPMI environment (libc reference for
: __dpmi_set_protected_mode_interrupt_vector says to use sti before
: iret), but it is generally advisable to not enable interrupts inside
: interrupt handler, because then interrupts might pile up and trash
: stack. According to some documentation on i486, it is safe to do sti
: right before iret, it says that processor reacts on external
: interrupts after executing next instruction after sti.
Aha! Thanks.
Marillion, Script for a Jester's Tear,
MartinS
- Raw text -