Multitasking help
Posted: Thu Dec 21, 2006 10:36 am
I'll explain the current situation :
I have a working base OS, 3 gfx drivers, various stuff, and I'm now working on multitasking.
I found a bunch of example codes, various stuff, and managed to make some non-preemptive multitasking (each task has to explicitly tell the world when I can switch).
I've read interesting stuff about task-gade, hardware switching, etc... but it's still not quite clear.
Anyone has some documentation or example code about task switching and multitasking ?
Basically, from what I understood :
- State of each task is saved in a list
- I install an timer exception with my task-switcher
- When the exception happens, I save the current context, restore another task's context, and run it
This way, multitasking should work (from what I could read), but reality is far from theory. I tried to do that using "software task switching" but it just didn't work.
So, help is welcome!
I have a working base OS, 3 gfx drivers, various stuff, and I'm now working on multitasking.
I found a bunch of example codes, various stuff, and managed to make some non-preemptive multitasking (each task has to explicitly tell the world when I can switch).
I've read interesting stuff about task-gade, hardware switching, etc... but it's still not quite clear.
Anyone has some documentation or example code about task switching and multitasking ?
Basically, from what I understood :
- State of each task is saved in a list
- I install an timer exception with my task-switcher
- When the exception happens, I save the current context, restore another task's context, and run it
This way, multitasking should work (from what I could read), but reality is far from theory. I tried to do that using "software task switching" but it just didn't work.
So, help is welcome!