User mode scheduling

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
Kamal123
Member
Member
Posts: 99
Joined: Fri Nov 01, 2019 1:17 am

User mode scheduling

Post by Kamal123 »

How to enable preemptive multitasking in user mode..any source ?? Plz help...
User avatar
eekee
Member
Member
Posts: 891
Joined: Mon May 22, 2017 5:56 am
Location: Kerbin
Discord: eekee
Contact:

Re: User mode scheduling

Post by eekee »

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.
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
Kamal123
Member
Member
Posts: 99
Joined: Fri Nov 01, 2019 1:17 am

Re: User mode scheduling

Post by Kamal123 »

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.
Thanks for your guidance...
My os support multi threading in kernel mode..now I want to multithread in user mode.. I am confused, how to set up the stack and how to tell the tss to point my user stack...
Post Reply