Kernel service

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
yee1
Member
Member
Posts: 42
Joined: Sun Feb 10, 2013 4:02 pm

Kernel service

Post by yee1 »

Hey,

I would like to improve my kernel. Now I'd like to add a new feature to it based on kernel's level privilege.

At the moment all my tasks are running with 0 level. I'd like to run something with 3 level, like it would be user that has downloaded some application and he want to tun it at my OS. He can but how to allow his application do some sort of things like accessing ports etc ? I have been reading a little about kernel's services, but how to implement such thing that would allow task with 3rd level of privilege to access procedure that is owned by kernel and allow to read data from port, hmm ?

Accessing ports is only an example, maybe accessing any other thing that is accessible by 0lvl and not accessible by 3rd lvl, I hope you understood my problem, thank you ;)
User avatar
Jezze
Member
Member
Posts: 395
Joined: Thu Jul 26, 2007 1:53 am
Libera.chat IRC: jfu
Contact:

Re: Kernel service

Post by Jezze »

If you are on an x86 architecture the only way to move to userspace (or ring 3) is to fake an interrupt that when it returns will start executing code with a lower privilege level which in your case would be the user application. Before this you probably want to set up Paging with a page directory for each user space application. In order for a userspace application to communicate with the kernel it will use Syscalls which basically is a software interrupt that can be handled by the kernel.

These are quite a few steps you need to do, it's hard to easily explain it all but the wiki is your friend in this case.
Fudge - Simplicity, clarity and speed.
http://github.com/Jezze/fudge/
User avatar
iansjack
Member
Member
Posts: 4954
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Kernel service

Post by iansjack »

If I understand correctly what you are saying, that's exactly what system calls are for.
Post Reply