Kernel error - Interrupts in a multitasking environment

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Kieran
Member
Member
Posts: 54
Joined: Mon Apr 11, 2005 11:00 pm

Kernel error - Interrupts in a multitasking environment

Post by Kieran »

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
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post by AJ »

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
Post Reply