FreeBSD's monolithic kernel

j4ck

Active Member

Reaction score: 11
Messages: 113

I'm studying operating systems and kernel types. In all references that I have read, monolithic kernels are known for being cumbersome, difficult to maintain, difficult to debug, coding in kernel is very challenging, a faulty part of kernel can bring down the whole system and so on ... .
On the other hand, hybrid kernels and micro-kernels have solved these problems. I wonder why FreeBSD uses monolithic kernel? As far as I understand, advantages of a monolithic kernel is limited in 2 or 3 properties: loadable modules, powerful hardware access, easier to implement than other kernel types (I don't agree with this, please let me if iI'm wrong).
 

sidetone

Daemon

Reaction score: 942
Messages: 1,894

It's why DragonFlyBSD forked from FreeBSD. Minix 3 also has a hybrid kernel.
 

Oko

Daemon

Reaction score: 797
Messages: 1,620

Check out the mailing lists from early nineties for the discussion micro vs monolithic
 

drhowarddrfine

Son of Beastie

Reaction score: 2,492
Messages: 4,437

In all references that I have read
You need to get better references. The basis for FreeBSD came out of the same lab Dennis Ritchie and Brian Kernighan and Ken Thompson were in, ATT Labs, along with Unix. Two of those guys still work at Princeton and Google. So I'd like to know the source of your references who say those people are wrong.
 

wblock@

Beastie Himself
Developer

Reaction score: 3,752
Messages: 13,851

On the other hand, hybrid kernels and micro-kernels have solved these problems.
In theory, yes, essentially making the kernel into a tiny hypervisor. In practice, microkernels have problems and tradeoffs of their own.

Anyone who feels that the benefits of a microkernel are useful to them could work on implementing a microkernel for FreeBSD. So far that has not happened (as far as I know), but it would be a nice alternative to have. The Minix project appears to be growing, and might be influential in demonstrating a practical microkernel.
 

ANOKNUSA

Aspiring Daemon

Reaction score: 375
Messages: 675

In all references that I have read, monolithic kernels are known for being cumbersome, difficult to maintain, difficult to debug, coding in kernel is very challenging, a faulty part of kernel can bring down the whole system and so on ... .
On the other hand, hybrid kernels and micro-kernels have solved these problems.

First thing's first: I'm no hacker. I don't really understand how the internals of an operating system kernel work, so I can't offer any significant insight into how the FreeBSD kernel works relative to others, and if anything that follows is objectively wrong I hope someone will correct me. What I'm fairly certain of, though, is that every major operating system in common use today utilizes a monolithic kernel. The list of "problems" you gave aren't imminent failures that system administrators have to constantly fight off, but rather the limitations of present design. We've had decades to work within and around those limitations, and the thing about kernels is that once they're working well you only occasionally need to make any significant change to them--typically to accommodate next-generation hardware, and since it takes a while for that hardware to become common developers have time to implement drivers and such.

A microkernel design may have offset or eliminated many of the monolithic kernel's limitations, but it's probably a safe guess that since no major OS has adopted a strict microkernel, the benefits simply don't outweigh the effort needed to implement a completely new kernel. Economists and psychologists have long noted that people will stick with whatever they're used to even when something arguably better is available, because the old thing works fine and the myriad costs of adopting the new thing are believed to outweigh the supposed benefits. The QWERTY vs. Dvorak debate is a good example of this.
 

tingo

Son of Beastie

Reaction score: 653
Messages: 2,566

The point is: there is a huge difference between theory and practice / real life. Theory is what you study, practice is what you use. This is true for almost any field of study today.
Oh, and people who can convert theory into practice are heroes. :)
 

sidetone

Daemon

Reaction score: 942
Messages: 1,894

There are a few UNIXes, but they are proprietary. I'm not sure what QNX is.
 

ANOKNUSA

Aspiring Daemon

Reaction score: 375
Messages: 675

Interesting. Judging by my (admittedly lazy) web searches, though, QNX is incredibly popular in automobile dashboards, and scantly used for anything else. Which is almost certainly why I haven't heard of it, having not owned an automobile in twelve years.
 
Top