A privileged userland program

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
User avatar
Jezze
Member
Member
Posts: 395
Joined: Thu Jul 26, 2007 1:53 am
Libera.chat IRC: jfu
Contact:

A privileged userland program

Post by Jezze »

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?
Fudge - Simplicity, clarity and speed.
http://github.com/Jezze/fudge/
Ferrarius
Member
Member
Posts: 69
Joined: Sun Oct 28, 2007 4:10 pm

Re: A privileged userland program

Post by Ferrarius »

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.
Modular Interface Kernel With a lot of bugs ;)
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: A privileged userland program

Post by NickJohnson »

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?
Post Reply