Kernel stack = 0x0009FFFF
App stack = 0x008FFFFF
before start the test app, I set ESP to 0x008FFFFF, then use INT IRET instructions to switch.
Code: Select all
InterruptHandler_42: pop dword [_eip]
pop ecx
pop dword [_eflags]
push 0 ;placeholder
push dword [_eflags]
push dword ecx
push dword 0x00800000
mov al,EOI
out PIC8259B_Port_Command,al
out PIC8259A_Port_Command,al
iret
Code: Select all
InterruptHandler_00: pushad
push gs
push fs
push ss
push es
push ds
call IDT_00 ;display registers
pop eax
pop eax
pop eax
pop eax
pop eax
popad
push dword [_eflags]
push dword 0x8
push dword [_eip]
iret