Page 1 of 1
Kernel idea
Posted: Sun Aug 10, 2008 2:27 pm
by afarnen
I have an idea for a kernel. First of all, there is the kernel, there are user-mode apps, there are kernel-mode apps, and of course, there is hardware. Here's a diagram I made:
Code: Select all
user-mode apps
^
kernel
^
kernel-mode apps
^
hardware
As you can see, only the kernel-mode apps deal directly with hardware (such as a keyboard, or monitor). They provide services to the kernel such as keyboard input, or monitor output. The kernel then compiles every kernel-mode service and provides thems to the user-mode apps, but in a very high-level way, such as "standard input", "standard output", etc.
All kernel-mode apps are run by the kernel in machine language. User-mode apps, however, are run by the kernel like a virtual machine, in a specific high-level bytecode, which allows them only to communicate (directly) with the kernel. This also makes all user-mode apps completely machine-portable, without the need to compile from source when installing.
I looked up different types of kernels on Wikipedia, and found that there was no kernel-type like this. The closest was hybrid, which was still a bit different.
So, overall, what do you think? Any comments, suggestions, misunderstandings?
Re: Kernel idea
Posted: Sun Aug 10, 2008 2:56 pm
by babylon2233
What is kernel-mode apps? Example?
Re: Kernel idea
Posted: Sun Aug 10, 2008 3:10 pm
by afarnen
babylon2233 wrote:What is kernel-mode apps? Example?
An example would be a driver for a specific hardware. They are the equivalent of daemons in the Unix world.
Re: Kernel idea
Posted: Sun Aug 10, 2008 3:18 pm
by babylon2233
afarnen wrote:babylon2233 wrote:What is kernel-mode apps? Example?
An example would be a driver for a specific hardware. They are the equivalent of daemons in the Unix world.
Monolithic kernels have drivers running in kernel-mode. So, what's the difference?
Re: Kernel idea
Posted: Sun Aug 10, 2008 7:50 pm
by elfenix
Based on your description, I'd say you are basically talking about virtualization. The host kernel provides interfaces for basic hardware (your kernel apps), then you're kernel provides a standardized interface. Not a bad idea, and lots of research being done on this right now.
See:
http://en.wikipedia.org/wiki/Kernel-bas ... al_Machine
Re: Kernel idea
Posted: Mon Aug 11, 2008 1:33 am
by AJ
Hi,
I'm not really sure quite what your kernel-mode apps are, but if they abstract away the hardware for the kernel, they sound like drivers to me. As far as virtualisation for your user apps, not a bad idea - you may want to have a look at
SharpOS, where they provide this level of protection via managed code.
Cheers,
Adam
Re: Kernel idea
Posted: Mon Aug 11, 2008 1:33 am
by dr_evil
This is a monolithic kernel. There are already operating systems like this.
Check
http://en.wikipedia.org/wiki/Inferno_%2 ... _system%29 for example. Here's
http://doc.cat-v.org/inferno/4th_edition/inferno_OS an introduction.
Re: Kernel idea
Posted: Mon Aug 11, 2008 2:15 am
by babylon2233
Re: Kernel idea
Posted: Mon Aug 11, 2008 9:26 am
by iammisc
You're OS is a modular kernel because your drivers are running in kernel mode. If your drivers were userspace processes then you would have a microkernel.
Re: Kernel idea
Posted: Tue Aug 12, 2008 11:35 pm
by afarnen
babylon2233 wrote:
Is this what you mean?
The "kernel-mode apps" are more like modules to the kernel. So it might actually be more like this:
Code: Select all
user-mode
^
interpreter
^
kernel /modules
^
hardware
Re: Kernel idea
Posted: Wed Aug 13, 2008 6:12 pm
by binarysemaphore
afarnen wrote:babylon2233 wrote:
Is this what you mean?
The "kernel-mode apps" are more like modules to the kernel. So it might actually be more like this:
Code: Select all
user-mode
^
interpreter
^
kernel /modules
^
hardware
From what I understand (or misunderstand), this interpreter is something like Java virtual machine. Also are modules in kernel memory space or user space ?
Tejas Kokje
Re: Kernel idea
Posted: Sat Aug 16, 2008 7:15 am
by mathematician
afarnen wrote:
The "kernel-mode apps" are more like modules to the kernel. So it might actually be more like this:
Code: Select all
user-mode
^
interpreter
^
kernel /modules
^
hardware
To my ears an interpreter just sounds like a good way to slow everything down. Even with modern processor speeds that doesn't necessarily sound like a good idea. Interpreters are ok in applications, and maybe even in systems style software running on top of the OS, but not in the OS itself. Applications have a right to expect that the OS will gobble up as few processor cycles as possible, leaving them to utilise most of the processor's power.
Come the day we have 32 cores on one chip it may be ok to have the OS taking over one of them for its exclusive use.
Re: Kernel idea
Posted: Tue Aug 19, 2008 6:23 am
by Telgin
mathematician wrote:afarnen wrote:
The "kernel-mode apps" are more like modules to the kernel. So it might actually be more like this:
Code: Select all
user-mode
^
interpreter
^
kernel /modules
^
hardware
To my ears an interpreter just sounds like a good way to slow everything down. Even with modern processor speeds that doesn't necessarily sound like a good idea. Interpreters are ok in applications, and maybe even in systems style software running on top of the OS, but not in the OS itself. Applications have a right to expect that the OS will gobble up as few processor cycles as possible, leaving them to utilise most of the processor's power.
Come the day we have 32 cores on one chip it may be ok to have the OS taking over one of them for its exclusive use.
An interpreter would definitely slow it down. Perhaps JIT compiling could be applied to fix that?
Re: Kernel idea
Posted: Tue Aug 19, 2008 3:23 pm
by binarysemaphore
mathematician wrote:afarnen wrote:
Come the day we have 32 cores on one chip it may be ok to have the OS taking over one of them for its exclusive use.
Don't forget laws of computer programming
1) Any program will expand to fill any available memory.
2) Any program will expand to consume any available CPU and still be deemed slow.
Tejas Kokje