Page 1 of 1

Multitasking stack switching problems

Posted: Sat Feb 17, 2024 8:40 pm
by darkavengr
I'm having a problem with multitasking in my monolithic kernel. I have implemented pre-emptive multitasking using stack switching
where an IRQ 0 handler saves the registers onto the stack, calls switch_task and then restores the registers.
However, when switching from a second user-mode process back to the first, the stack values are not the saved values that
were saved when switching from the first to the second process.
It's been tested using two kernel-mode processes, and it works fine using the test code.

I would appreciate any input.

https://github.com/darkavengr/CCP/blob/ ... 86/pic.asm
https://github.com/darkavengr/CCP/blob/ ... /sched.asm
https://github.com/darkavengr/CCP/blob/ ... testcode.c

Re: Multitasking stack switching problems

Posted: Tue Jun 11, 2024 11:48 pm
by Octocontrabass
Since you've deleted this file, does that mean you fixed it?

Re: Multitasking stack switching problems

Posted: Sat Jun 29, 2024 11:04 am
by darkavengr
Yes, the problem has been fixed.