Hi,
Im doing fine progress on my OS but now I started thinking...
Would it be possible to have a program in user space - a daemon of some sort - that has privileges that would allow it to handle some of the things that normally must run in kernel space?
I was thinking of letting user space programs implement their own scheduling algorithms and for them to work they have to contact the daemon that is the only program that has the privileges to actually trigger certain interrupts.
How would you go about doing this?
A privileged userland program
A privileged userland program
Fudge - Simplicity, clarity and speed.
http://github.com/Jezze/fudge/
http://github.com/Jezze/fudge/
Re: A privileged userland program
On intel processors:
If you put it say in ring 1 or 2 and make sure applications in that ring can do the specific functions you want it to be able to do you can run "userland" applications with certain elevated privileges.
If you put it say in ring 1 or 2 and make sure applications in that ring can do the specific functions you want it to be able to do you can run "userland" applications with certain elevated privileges.
Modular Interface Kernel With a lot of bugs
- NickJohnson
- Member
- Posts: 1249
- Joined: Tue Mar 24, 2009 8:11 pm
- Location: Sunnyvale, California
Re: A privileged userland program
There are a couple of ways you could do that.
First, you could have that process run in ring 1/2. That allows you to actually mask certain interrupts so only that process can use them at all. Problems with this are portability (specifically to x86_64), and the fact that you need more stuff in your TSS.
Second, you could allow all processes to do interrupts, but have some code in the handler that rejects requests from unprivileged processes by PID. This would probably be easiest, but would still take time in the context switch even though it didn't need to.
How exactly are you trying to let processes create their own scheduling algorithms?
First, you could have that process run in ring 1/2. That allows you to actually mask certain interrupts so only that process can use them at all. Problems with this are portability (specifically to x86_64), and the fact that you need more stuff in your TSS.
Second, you could allow all processes to do interrupts, but have some code in the handler that rejects requests from unprivileged processes by PID. This would probably be easiest, but would still take time in the context switch even though it didn't need to.
How exactly are you trying to let processes create their own scheduling algorithms?