I have based my kernel on the OSD tutorial kernel.
I am having a problem with executing interrupts while the kernel is in multitasking mode, however when multitasking is disabled, I get no errors.
The errors I do get show that my EIP value is way off after the return from the interrupt handler, which sometimes causes an invalid opcode error.
Has anyone played with the OSD tutorials befor and come accross such an error?
Any ideas would be greatly appreciated.
Thanks in advance, Kieran Foot
Kernel error - Interrupts in a multitasking environment
Hi,
It sounds very much like your stack is getting mangled. I would suggest re-checking your multitasking code.
Are you running ring 3 tasks? If so, your scheduler needs to know that when a ring 3 task executes a system call, it will look like a ring 0 task.
Are you ring 0 stacks big enough that when a task in syscall state is preempted, all the values can be pushed to the stack as usual?
I think it is probably a case of going through what happens when a task interrupted by, say, the keyboard IRQ is then also preempted.
Cheers,
Adam
It sounds very much like your stack is getting mangled. I would suggest re-checking your multitasking code.
Are you running ring 3 tasks? If so, your scheduler needs to know that when a ring 3 task executes a system call, it will look like a ring 0 task.
Are you ring 0 stacks big enough that when a task in syscall state is preempted, all the values can be pushed to the stack as usual?
I think it is probably a case of going through what happens when a task interrupted by, say, the keyboard IRQ is then also preempted.
Cheers,
Adam