User mode scheduling
Posted: Wed Mar 11, 2020 10:46 am
How to enable preemptive multitasking in user mode..any source ?? Plz help...
The Place to Start for Operating System Developers
https://f.osdev.org/
Thanks for your guidance...eekee wrote:Clarification required. You need interrupts for preemptive multitasking; I don't think it's possible to configure and handle interrupts in user mode, so what do you want? Do you mean the normal case, where you want to implement preemptive multitasking in your kernel so that your user-mode programs may be multi-tasked? Multi-threading is an extension of the latter, if I understand right.
The basic idea is to have a timer interrupt. When it fires, save the state of the currently runnning process, decide which process to run next, restore its state, and return to it. EDIT: huh... you could do this in userspace if you can get a regular signal and can save state. The latter may be the hard part.