I want to update the kernel to do some more stuff when switching between tasks and for that i need to find the reason for each switch.
First, i can't find the function where schedule() is called when there is a higher priority task than the current one and they need to be switched, where does it happen?
Second, is there any reason for a task to yield the CPU rather than exiting or going to wait for something? is there a yield function or something?
Thanks!