OK, I have been working on a very "simple" OS for a wile now, currently I have a small "command prompt" but everything so far is in the kernel.
I am looking for documentation, information, or examples of how to get the "command prompt" or any "program" in general separated from the kernel
I want the kernel to handle all the keyboard input and video output, but I have not been able to find any information on how to get a "program" to communicate with the kernel rather than rewriting the "driver" per "program".
Any information is greatly appreciated.
Thanks in advance,
BASICFreak
I am sorry if this question has been asked before, I searched the WiKi but I think I just did not know what terms to look for. I am still very new to OS development.
Separating the kernel
- BASICFreak
- Member
- Posts: 284
- Joined: Fri Jan 16, 2009 8:34 pm
- Location: Louisiana, USA
Separating the kernel
BOS Source Thanks to GitHub
BOS Expanded Commentary
Both under active development!
BOS Expanded Commentary
Both under active development!
Sortie wrote:
- Don't play the role of an operating systems developer, be one.
- Be truly afraid of undefined [behavior].
- Your operating system should be itself, not fight what it is.
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
Re: Separating the kernel
Well, the programs would be executable files that the kernel loads and runs. The programs interface with the kernel by use of system calls (its on the wiki).
-JL
-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
Re: Separating the kernel
You need a kernel/system API. For example, in the Posix world, your 'shell' would be a user-space program. It will do something like this.
At the 'system/kernel' interface you need to implement open/read/write etc. for each device type.
I should stress that Posix is just one OS interface. You can make your own.
Code: Select all
fdin = open("/dev/console", ...); // or /dev/kbd etc.
fdout = open("/dev/console", ...); // or /dev/screen etc.
while (1) {
char ch;
write(fdout, "$ ", 2);
read(fdin, &ch, 1);
switch (ch) {
// process text input etc.
}
}
I should stress that Posix is just one OS interface. You can make your own.
If a trainstation is where trains stop, what is a workstation ?