Second: My interrupt code just pushes everything on the stack and this info is then available in the C code:
Interrupt handler:
Code: Select all
isr7: ; For example
cli
push byte 0
push byte 7
jmp isr_common_stub
isr_common_stub:
pushad
push ds
push es
push fs
push gs
mov ax, 0x10
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov eax, esp
push eax
mov eax, fault_handler
call eax
pop eax
pop gs
pop fs
pop es
pop ds
popad
add esp, 8
iret
Code: Select all
...
struct regs
{
unsigned int gs, fs, es, ds;
unsigned int edi, esi, ebp, esp, ebx, edx, ecx, eax;
unsigned int int_no, err_code;
unsigned int eip, cs, eflags, useresp, ss;
};
...
void fault_handler(struct regs *r)
{
...
Candamir