Kernel idea

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
afarnen
Posts: 4
Joined: Mon Dec 03, 2007 6:34 am

Kernel idea

Post 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?
-andrew
User avatar
babylon2233
Member
Member
Posts: 66
Joined: Fri May 23, 2008 5:30 pm
Location: Malaysia

Re: Kernel idea

Post by babylon2233 »

What is kernel-mode apps? Example?
afarnen
Posts: 4
Joined: Mon Dec 03, 2007 6:34 am

Re: Kernel idea

Post 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.
-andrew
User avatar
babylon2233
Member
Member
Posts: 66
Joined: Fri May 23, 2008 5:30 pm
Location: Malaysia

Re: Kernel idea

Post 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?
elfenix
Member
Member
Posts: 50
Joined: Sun Dec 02, 2007 1:24 pm
Libera.chat IRC: elfenix
Location: United States
Contact:

Re: Kernel idea

Post 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
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: Kernel idea

Post 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
dr_evil
Member
Member
Posts: 34
Joined: Mon Dec 20, 2004 12:00 am

Re: Kernel idea

Post 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.
User avatar
babylon2233
Member
Member
Posts: 66
Joined: Fri May 23, 2008 5:30 pm
Location: Malaysia

Re: Kernel idea

Post by babylon2233 »

Code: Select all

APPLICATION
      ^
VM LAYER
      ^
KERNEL
Is this what you mean?
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

Re: Kernel idea

Post 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.
afarnen
Posts: 4
Joined: Mon Dec 03, 2007 6:34 am

Re: Kernel idea

Post by afarnen »

babylon2233 wrote:

Code: Select all

APPLICATION
      ^
VM LAYER
      ^
KERNEL
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
-andrew
binarysemaphore
Posts: 11
Joined: Thu Jul 03, 2008 12:37 am

Re: Kernel idea

Post by binarysemaphore »

afarnen wrote:
babylon2233 wrote:

Code: Select all

APPLICATION
      ^
VM LAYER
      ^
KERNEL
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
User avatar
mathematician
Member
Member
Posts: 437
Joined: Fri Dec 15, 2006 5:26 pm
Location: Church Stretton Uk

Re: Kernel idea

Post 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.
The continuous image of a connected set is connected.
User avatar
Telgin
Member
Member
Posts: 72
Joined: Thu Dec 20, 2007 1:45 pm

Re: Kernel idea

Post 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?
binarysemaphore
Posts: 11
Joined: Thu Jul 03, 2008 12:37 am

Re: Kernel idea

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

:D

Tejas Kokje
Post Reply