When a interrupt occurs, in what sequence CPU push the registers???
In the bochs I traced the stacks: before "int 3" excution and before "cli" in a isr stub function. I found it just pushed eflags(first), cs(second), eip(third) registers into the stack.
Is it right?
Maybe you can tell me in what sequence "pushad" push the general registers by the way.
The sequence of CPU's pushing register when interrupt occur?
That's right. When it does a ring change it also pushes SS (first) and ESP (second), followed by the rest as normal.
Pusha pushes eax, ecx, edx, ebx, esp, ebp, esi, edi in that order.
More info available here.
Cheers,
James
Pusha pushes eax, ecx, edx, ebx, esp, ebp, esi, edi in that order.
More info available here.
Cheers,
James
OK. 3Q.
JamesM, I am reading your tutorial and got the problem.
maybe you can add some information about the "struct resgisters" because I found the member sequence in this struct is according to the sequence of "ring change pushing" , "pushing int_no and errcode" and "pushad".
It was my confused problem yesterday. I drawed a long stack diagram to understand it.
JamesM, I am reading your tutorial and got the problem.
maybe you can add some information about the "struct resgisters" because I found the member sequence in this struct is according to the sequence of "ring change pushing" , "pushing int_no and errcode" and "pushad".
It was my confused problem yesterday. I drawed a long stack diagram to understand it.
http://www.sandpile.org/
Really nice reference for all stackframes, other "CPU-structs" and some more stuff...
Really nice reference for all stackframes, other "CPU-structs" and some more stuff...
21 is only half the truth...
Hi,oohayulin wrote:OK. 3Q.
JamesM, I am reading your tutorial and got the problem.
maybe you can add some information about the "struct resgisters" because I found the member sequence in this struct is according to the sequence of "ring change pushing" , "pushing int_no and errcode" and "pushad".
It was my confused problem yesterday. I drawed a long stack diagram to understand it.
You're right, the registers structure is tailored to the stack frame created in my tutorials. It works for inter ring changes and non ring changes, because in the second case the last two members actually just point to junk, but the rest are good. Draw a diagram and work out why