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.
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
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.