Page 1 of 2
what kind of kernel is this?
Posted: Fri Feb 20, 2009 8:38 am
by yemista
I attached a picture of how I designed my kernel, but Im not sure if its a micro or mono kernel. It seems to be both actually. Any thoughts?
Re: what kind of kernel is this?
Posted: Fri Feb 20, 2009 8:45 am
by JamesM
Hi,
It depends - it looks modular monolithic to me, but that all depends on whether the filesystem drivers are in user space or not.
And also, what about functionality like networking? Where does it go? does it go inside the kernel? does it go in user space? does it go in a module?
That sort of thing helps "define" your architecture.
Cheers,
James
Re: what kind of kernel is this?
Posted: Fri Feb 20, 2009 8:50 am
by yemista
I see. I have not considered networking yet because I have a long way to go before even getting done what the picture shows, but my basic idea is that everything runs in kernel space except user programs. Programs can only access things through system calls. The file system is really just another interface, thought it is its own module. This way I can support multiple file systems. A filesystem will ultimately look like a device, but the filesystem module is responsible for setting up a filesystem device. Reading from a file system essentially will be the same as reading directly from a disk, but when you use the file system to get to the disk, the data gets read and written in an organized way. I guess its more of a layered approach.
Re: what kind of kernel is this?
Posted: Fri Feb 20, 2009 9:05 am
by JamesM
Hi,
In which case you have designed a monolithic kernel.
Cheers,
James
Re: what kind of kernel is this?
Posted: Fri Feb 20, 2009 9:37 am
by yemista
Conceptually they seem the same. Internally I call everything modules because all the kernel has to do is say "open this filesystem", and the fs module will know how to figure out what filesystem it is and take care of dealing with it, so the os will make uniform calls to all file systems such as open/close and read/write. The same happens with devices. The kernel just needs to know, initialize device x, or read from device y, and the driver interface will take care of all the details, all the kernel needs to know is the number assigned to the device to access it.
So how do you technically classify the difference between a mono and micro kernel?
Does it have to do with how much code runs in user space?
Re: what kind of kernel is this?
Posted: Fri Feb 20, 2009 10:41 am
by JamesM
In a microkernel, services such as the VFS, networking etc are handled by servers running in userspace. The kernel is extremely small, and everything relies on IPC.
They're not similar at all.
Re: what kind of kernel is this?
Posted: Fri Feb 20, 2009 10:55 am
by Colonel Kernel
yemista wrote:So how do you technically classify the difference between a mono and micro kernel?
Does it have to do with how much code runs in user space?
There is actually some controversy over what the correct answer is.
I think it doesn't necessarily have to do with running code in user space, but this is how it's been implemented in nearly all microkernels until recently.
I would define a microkernel architecture as one where the major OS services (file systems, drivers, etc.) run in separate processes and applications invoke those services via IPC. For some OSes like Singularity, processes are implemented with software isolation instead of hardware isolation, but they are still processes. Singularity is the one example of a microkernel that I know of where everything (usually) runs in kernel mode.
Re: what kind of kernel is this?
Posted: Fri Feb 20, 2009 12:37 pm
by Craze Frog
I agree with James M here.
For some OSes like Singularity
...which is not a microkernel!
A microkernel is a computer kernel which provides the mechanisms needed to implement an operating system. The actual operating system is written on top of the microkernel. A microkernel needs to allow a variety of policies, so that any operating system you fancy can be written on top of it. The policymaking is part of the operating system, not the microkernel, and that's the main difference between microkernels and monolithic kernels: Microkernels have as little policy as possible in kernel space.
Singularity has
literally everything (both all code and all policy) in kernel space, and thus is the complete opposite of a microkernel.
Re: what kind of kernel is this?
Posted: Fri Feb 20, 2009 1:18 pm
by JohnnyTheDon
Singularity has literally everything (both all code and all policy) in kernel space, and thus is the complete opposite of a microkernel.
Since Singularity uses software protection, the conventional notions of 'kernel' and 'user' space don't apply. Under your logic, even applications would be part of the kernel, making this not an operating system but just a huge blob program that runs on base hardware. User space is anything that is created in the managed language singularity uses and checked at compile time, and kernel space is any code that isn't checked.
Re: what kind of kernel is this?
Posted: Fri Feb 20, 2009 3:14 pm
by Craze Frog
Since Singularity uses software protection, the conventional notions of 'kernel' and 'user' space don't apply.
Using software protection was a very big policy decision. The hallmark of microkernels is that they force as little policy as possible. The microkernel just provides the means to build an operating system atop. Singularity
is an operating system, thus it can't be a microkernel, since a microkernel is the kernel
without the operating system.
Re: what kind of kernel is this?
Posted: Fri Feb 20, 2009 3:34 pm
by JohnnyTheDon
Craze Frog wrote:Using software protection was a very big policy decision.
Using hardware protection is a very big policy decision. That means there are no microkernels.
EDIT: grammar
Re: what kind of kernel is this?
Posted: Fri Feb 20, 2009 4:08 pm
by Combuster
And lets not feed the troll, 'kay. He has a record on that.
Re: what kind of kernel is this?
Posted: Fri Feb 20, 2009 5:00 pm
by JohnnyTheDon
Combuster wrote:And lets not feed the troll, 'kay. He has a record on that.
Sorry, I didn't think I was insulting anyone...
In any case all we're doing is arguing semantics. It just depends how you define microkernel.
Re: what kind of kernel is this?
Posted: Sat Feb 21, 2009 10:54 am
by Brynet-Inc
berkus wrote:Luke, there is no spoon.
You're getting your movies mixed up, bad berkus.
Re: what kind of kernel is this?
Posted: Sat Feb 21, 2009 11:24 am
by Troy Martin
Brynet-Inc wrote:berkus wrote:Luke, there is no spoon.
You're getting your movies mixed up, bad berkus.
Chuck Norris can't mix up his movies, his movies mixed him up.
Seriously, get the trial for WoW and spend some time in The Barrens or city trade chat if you're horde. It starts to hurt after a while.