what kind of kernel is this?

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!
User avatar
yemista
Member
Member
Posts: 299
Joined: Fri Dec 26, 2008 12:31 pm
Location: Boston
Contact:

what kind of kernel is this?

Post 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?
Attachments
kernel.GIF
kernel.GIF (6.47 KiB) Viewed 5676 times
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: what kind of kernel is this?

Post 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
User avatar
yemista
Member
Member
Posts: 299
Joined: Fri Dec 26, 2008 12:31 pm
Location: Boston
Contact:

Re: what kind of kernel is this?

Post 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.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: what kind of kernel is this?

Post by JamesM »

Hi,

In which case you have designed a monolithic kernel.

Cheers,

James
User avatar
yemista
Member
Member
Posts: 299
Joined: Fri Dec 26, 2008 12:31 pm
Location: Boston
Contact:

Re: what kind of kernel is this?

Post 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?
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: what kind of kernel is this?

Post 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.
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Re: what kind of kernel is this?

Post 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.
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
Craze Frog
Member
Member
Posts: 368
Joined: Sun Sep 23, 2007 4:52 am

Re: what kind of kernel is this?

Post 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.
JohnnyTheDon
Member
Member
Posts: 524
Joined: Sun Nov 09, 2008 2:55 am
Location: Pennsylvania, USA

Re: what kind of kernel is this?

Post 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.
Craze Frog
Member
Member
Posts: 368
Joined: Sun Sep 23, 2007 4:52 am

Re: what kind of kernel is this?

Post 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.
JohnnyTheDon
Member
Member
Posts: 524
Joined: Sun Nov 09, 2008 2:55 am
Location: Pennsylvania, USA

Re: what kind of kernel is this?

Post 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
Last edited by JohnnyTheDon on Fri Feb 20, 2009 4:57 pm, edited 1 time in total.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: what kind of kernel is this?

Post by Combuster »

And lets not feed the troll, 'kay. He has a record on that.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
JohnnyTheDon
Member
Member
Posts: 524
Joined: Sun Nov 09, 2008 2:55 am
Location: Pennsylvania, USA

Re: what kind of kernel is this?

Post 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.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: what kind of kernel is this?

Post by Brynet-Inc »

berkus wrote:Luke, there is no spoon.
You're getting your movies mixed up, bad berkus.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: what kind of kernel is this?

Post 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. :(
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
Post Reply