Confused about stack during isr calling
Posted: Sat Aug 11, 2007 2:35 am
I am confused about what happens when my isr's get called on when in both protection rings 0 and 3.
Here is what I think I know:
cpl0 no cpl change in protected mode
cpl3 to cpl0 cpl change in protected mode and everytime in long mode
Is this correct?
How do you code an isr that is going to know if a cpl change occurred or not so I can correctly get this stuff from the stack? (ie stick these regs into a threads register storage in a thread control structure for software task switching)
I see plenty of examples but none of them explain how to know whats on the stack (most just print some message and iret) and the intel docs just don't seem to clearly explain this to me.
Any help would be greatly appreciated.
Here is what I think I know:
cpl0 no cpl change in protected mode
Code: Select all
push eflags
push cs
push cip
Code: Select all
push ss
push esp
push eflags
push cs
push cip
push error code
How do you code an isr that is going to know if a cpl change occurred or not so I can correctly get this stuff from the stack? (ie stick these regs into a threads register storage in a thread control structure for software task switching)
I see plenty of examples but none of them explain how to know whats on the stack (most just print some message and iret) and the intel docs just don't seem to clearly explain this to me.
Any help would be greatly appreciated.