Microkernel or Monolithic

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!

What os are you designing?

Microkernel
34
56%
Monolithic kernel
14
23%
Other design
10
16%
I'm unsure at the moment...
3
5%
 
Total votes: 61

User avatar
liquid.silver
Member
Member
Posts: 46
Joined: Sat Jun 30, 2007 12:07 pm
Location: South Africa
Contact:

Microkernel or Monolithic

Post by liquid.silver »

Personally i've decided to write a microkernel based on 3 main reasons (besides the already well-known advantages):

1. Microkernel design is largely unexplored, at least when compared to monolithic. More room for research.
2. The microkernel's main disadvantage is more processing power is required, but nowadays there is often ample power available.
3. There is no possible way i can compete with pre-existing monolithic kernels, especially as i'm developing solo.

Please don't start a flame war. This is just meant to see what your personal views on the possible designs are.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

I'm writing a microkernel but with the VFS in the kernel to try and alleviate some overhead. It's only the virtual part in the kernel, all the drivers are in userspace.
The microkernel's main disadvantage is more processing power is required, but nowadays there is often ample power available.
Actually the main disadvantage is all the context switches, during which the main pipeline of the CPU (ALU, instruction decoders etc) are inactive, and said pipeline is flushed completely. Which causes efficiency problems.
Please don't start a flame war. This is just meant to see what your personal views on the possible designs are.
Good thing you mentioned this!
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post by AJ »

I'm going for modular monolithic, but have not finalised quite how the drivers interact with the kernel yet. There will certainly be a level of dynamic linking involved as you would expect for a monolithic kernel but I have yet to look at whether going down the hybrid route fits in with everything else I want to achieve, so there may be support for userland drivers too.

Certainly the VFS, graphics and disk access will be done from kernel-space.

Cheers,
Adam
User avatar
panchex
Posts: 2
Joined: Fri Jun 01, 2007 9:36 am
Location: Buenos Aires - Argentina

Post by panchex »

I think that a combination of both approaches is the best way to go.
Panchex
User avatar
AndrewAPrice
Member
Member
Posts: 2299
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Post by AndrewAPrice »

AJ wrote:I'm going for modular monolithic, but have not finalised quite how the drivers interact with the kernel yet. There will certainly be a level of dynamic linking involved as you would expect for a monolithic kernel but I have yet to look at whether going down the hybrid route fits in with everything else I want to achieve, so there may be support for userland drivers too.

Certainly the VFS, graphics and disk access will be done from kernel-space.

Cheers,
Adam
So am I. Mostly for performance and I can also include select modules in the kernel (e.g. a floppy, DMA, and FAT12 controller!) My modules are event based, which means they sit in memory and do nothing until requested. I'm thinking about having the kernel ping each module that is doing heavy processing every few seconds to make sure it hasn't crashed, and if the module doesn't respond, then it is automatically destroyed and reloaded.
My OS is Perception.
User avatar
liquid.silver
Member
Member
Posts: 46
Joined: Sat Jun 30, 2007 12:07 pm
Location: South Africa
Contact:

Post by liquid.silver »

JamesM wrote:I'm writing a microkernel but with the VFS in the kernel to try and alleviate some overhead. It's only the virtual part in the kernel, all the drivers are in userspace.
I plan on putting the vfs in user space at first. This should allow development thereof to be easier as i can first do some other stuff. Also i just don't feel like doing the vfs yet. Then in a later version i plan on moving it into the kernel for performance issues. Everything else i want to put in user space.

My kernel has/will have a scheduler, memory manager and ipc. Later the vfs too.
User avatar
mystran
Member
Member
Posts: 670
Joined: Thu Mar 08, 2007 11:08 am

Post by mystran »

I started OSdev writing a microkernel... then after third redesign I decided it's sensible to move more stuff to the kernel.. and essentially started writing a monolith. Now that my monolith is getting to the point of actually doing something, I'm considering pieces to be moved outside again.

The result will probably be some sort of a hybrid. We'll see.
The real problem with goto is not with the control transfer, but with environments. Properly tail-recursive closures get both right.
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: Microkernel or Monolithic

Post by jal »

I like microkernels for their possible cleanliness. Monolithic gets messy very quickly. The overhead is of no importance to me, as I'm not making an OS to actually be used (chance of succeeding: 0%) by anyone but myself for research purposes, I like to try out new concepts in the design, rather than improve speed. An example: in our current design, we have even the memory manager in user space, the apps requesting memory by sending a message to the MM, via the kernel, that must map the message into the address space of the MM by sending a message to... the MM. Indeed very inefficient, with loads of overhead, but I like it :).

EDIT: As for the VFS, we have none as such. Our native FS is database oriented (like WinFS, but not on top of another FS), 'foreign' FSes like ext2 and NTFS are mapped to that.


JAL
User avatar
mystran
Member
Member
Posts: 670
Joined: Thu Mar 08, 2007 11:08 am

Re: Microkernel or Monolithic

Post by mystran »

jal wrote:I like microkernels for their possible cleanliness. Monolithic gets messy very quickly.
My experience suggests kinda otherwise. The core is highly interdependant in both cases, which can be seen as complexity, but in a monolith you can build clean modules on top of that that do one part of the system. In a microkernel you build a fully-generic-handle-everything-and-kitchen-sinks-IPC system, which not only tends to get pretty damn complex, but what's worse, tends to make userspace servers complex as well.
The real problem with goto is not with the control transfer, but with environments. Properly tail-recursive closures get both right.
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: Microkernel or Monolithic

Post by jal »

mystran wrote:My experience suggests kinda otherwise. The core is highly interdependant in both cases, which can be seen as complexity, but in a monolith you can build clean modules on top of that that do one part of the system. In a microkernel you build a fully-generic-handle-everything-and-kitchen-sinks-IPC system, which not only tends to get pretty damn complex, but what's worse, tends to make userspace servers complex as well.
I don't see why building clean modules on top of a microkernel wouldn't be possible, especially when defining interfaces and having the IPC call on those interfaces. Not much difference with having APIs that are called directly by the kernel. However, I must admit the OS I'm working on is in its infant stages, so maybe I'll experience otherwise when actually developing those modules further than the definition phase.


JAL
xyzzy
Member
Member
Posts: 391
Joined: Wed Jul 25, 2007 8:45 am
Libera.chat IRC: aejsmith
Location: London, UK
Contact:

Post by xyzzy »

JamesM wrote:I'm writing a microkernel but with the VFS in the kernel to try and alleviate some overhead. It's only the virtual part in the kernel, all the drivers are in userspace.
Is this the entire FS system, or just the VFS part and have the actual FS drivers (ext2, fat, whatever) in userspace?

Before I switched my OS to a monolithic kernel I planned to do the latter, but to be honest I got lazy and switched to monolithic, because back then I didn't know much about microkernel design and the current IPC system was a hack. Although I may switch back to a microkernel at some point in the future, who knows? :)
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

Just the VFS. The VFS has nodes that contain information about the server that handles those nodes (ext2 server etc). Actually more specifically it contains a pointer to a resource that could be "remote", i.e. in a different address space. The VFS can pass a call to that resource and intrinsically an IPC call is made if needed.
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Post by bewing »

Intellectual purity gets in the way of writing pretty code, so I'm going for a hybrid right from the start -- no purity for me.
Craze Frog
Member
Member
Posts: 368
Joined: Sun Sep 23, 2007 4:52 am

Post by Craze Frog »

Those of you who are writing a microkernel, are putting the scheduler inside or outside the kernel?
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

Inside. Mine is more along the hybrid lines.
Post Reply