Multitasking stack switching problems

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
darkavengr
Posts: 2
Joined: Sat Feb 17, 2024 1:11 pm
Location: Here, there and everywhere
Contact:

Multitasking stack switching problems

Post 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
Octocontrabass
Member
Member
Posts: 5418
Joined: Mon Mar 25, 2013 7:01 pm

Re: Multitasking stack switching problems

Post by Octocontrabass »

Since you've deleted this file, does that mean you fixed it?
darkavengr
Posts: 2
Joined: Sat Feb 17, 2024 1:11 pm
Location: Here, there and everywhere
Contact:

Re: Multitasking stack switching problems

Post by darkavengr »

Yes, the problem has been fixed.
Post Reply