anyway ive deciced upon the following piece of code as a short cut and was
wondering if there would be any major problems with this. so far it works, but thats only for 2 processes.
my irq nasm stub and the bit im concered with
Code: Select all
irq_stub:
pushad
push ds
push es
push fs
push gs
mov ax, KERNEL_DS
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
push esp ;; push the current stack
call irq_handler
add esp, 4 ;; remove previous call?
mov esp, eax ;;; get the new stack
pop gs
pop fs
pop es
pop ds
popad
add esp, 8 ;; remove int num and error code
iret
Code: Select all
void *irq_handler(struct regs *r)
{
void *sp = r;
return sp;
}
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;
};