architecture - Why is Linux called a monolithic kernel? - Stack Overflow
261 captures
25 Jan 2013 - 21 Feb 2026
Sep
OCT
Nov
17
2012
2013
2014
success
fail
About this capture
COLLECTED BY
Organization:
Internet Archive
These crawls are part of an effort to archive pages as they are created and archive the pages that they refer to. That way, as the pages that are referenced are changed or taken from the web, a link to the version that was live when the page was written will be preserved.
Then the Internet Archive hopes that references to these archived pages will be put in place of a link that would be otherwise be broken, or a companion link to allow people to see what was originally intended by a page's authors.
The goal is to
fix all broken links on the web
Crawls of supported "No More 404" sites.
Collection:
Wikipedia Near Real Time (from IRC)
This is a collection of web page captures from links added to, or changed on, Wikipedia pages. The idea is to bring a reliability to Wikipedia outlinks so that if the pages referenced by Wikipedia articles are changed, or go away, a reader can permanently find what was originally referred to.
This is part of the Internet Archive's attempt to
rid the web of broken links
TIMESTAMPS
The Wayback Machine - https://web.archive.org/web/20131017065550/http://stackoverflow.com/questions/1806585/why-is-linux-called-a-monolithic-kernel
Stack Exchange
careers 2.0
Stack Overflow
Questions
Tags
Tour
Users
Ask Question
Tell me more
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
Why is Linux called a monolithic kernel?
up vote
68
down vote
favorite
42
I read that Linux is a monolithic kernel. Does monolithic kernel mean compiling and linking the complete kernel code into an executable?
If Linux is able to support modules, why not break all the subsystems into modules and load them when necessary? In that case, the kernel doesn't have to load all modules initially and could maintain an index of the functions in the module and load them when necessary.
architecture
operating-system
linux-kernel
share
improve this question
edited
Sep 20 '11 at 6:19
Peter Mortensen
6,515
43
73
asked
Nov 27 '09 at 3:16
Raccha
2,563
39
84
4 Answers
active
oldest
votes
up vote
125
down vote
accepted
A monolithic kernel is a kernel where all services (file system, VFS, device drivers, etc) as well as core functionality (scheduling, memory allocation, etc.) are a tight knit group sharing the same space. This directly opposes a
microkernel
A microkernel prefers an approach where core functionality is isolated from system services and device drivers (which are basically just system services). For instance, VFS (virtual file system) and block device file systems (i.e. minixfs) are separate processes that run outside of the kernel's space, using IPC to communicate with the kernel, other services and user processes. In short, if it's a
module
in Linux, it's a
service
in a microkernel, indicating an isolated process.
Do not confuse the term
modular
kernel to be anything but monolithic. Some monolithic kernels can be compiled to be modular (e.g Linux), what matters is that the module is inserted to and runs from the same space that handles core functionality.
The advantage to a microkernel is that any failed service can be easily restarted, for instance, there is no kernel halt if the root file system throws an abort.
The disadvantage to a microkernel is that asynchronous IPC messaging can become very difficult to debug, especially if
fibrils
are implemented. Additionally, just tracking down a FS/write issue means examining the user space process, the block device service, VFS service, file system service and (possibly) the PCI service. If you get a blank on that, its time to look at the IPC service. This is often easier in a monolithic kernel.
GNU Hurd
suffers from these debugging problems (
reference
). I'm not even going to go into checkpointing when dealing with complex message queues. Microkernels are not for the faint of heart.
The shortest path to a working, stable kernel is the monolithic approach. Either approach can offer a POSIX interface, where the design of the kernel becomes of little interest to someone simply wanting to write code to run on any given design.
I use Linux (monolithic) in production. However, most of my learning, hacking or tinkering with kernel development goes into a microkernel, specifically
HelenOS
Edit
If you got this far through my very long-winded answer, you will probably have some fun reading the '
Great Torvalds-Tanenbaum debate on kernel design
'. It's even funnier to read in 2013, more than 20 years after it transpired. The funniest part was Linus' signature in one of the last messages:
Linus "my first, and hopefully last flamefest" Torvalds
Obviously, that did not come true any more than Tanenbaum's prediction that x86 would soon be obsolete.
NB:
When I say "Minix", I do not imply Minix 3. Additionally, when I mention The HURD, I am referencing (mostly) the Mach microkernel. It is not my intent to disparage the recent work of others.
share
improve this answer
edited
May 21 at 19:17
community wiki
18 revs, 5 users 79%
Tim Post
Interestingly Linus Torvalds was greatly influenced by Andew Tanenbaum's MINIX when he created Linux. However, MINIX is based on a micro kernel design while Linux uses a monolithic kernel.
Martin Liversage
Nov 27 '09 at 8:12
@Martin Liversage: More frustrated than influenced :) I edited my answer to reflect that.
Tim Post
Nov 27 '09 at 12:28
Hehe, yes, LT developed into one of the net's most consistent flamers...
DigitalRoss
Nov 28 '09 at 0:05
12
@DigitalRoss: You should see my inbox after answering this, Linus is tame compared to Minix and Mach enthusiasts.
Tim Post
Nov 29 '09 at 17:05
Tangentially related:
Why was Tanenbaum wrong in the Tanenbaum-Torvalds debates?
Yannis
Oct 22 '12 at 15:03
show
more comments
up vote
down vote
From
wikipedia
A monolithic kernel is a kernel architecture where the entire operating system is working in the kernel space and alone as supervisor mode. In difference with other architectures,
the monolithic kernel defines alone a high-level virtual interface over computer hardware, with a set of primitives or system calls to implement all operating system services such as process management, concurrency, and memory management itself and one or more device drivers as modules.
Recent versions of Windows on the other hand use a
Hybric kernel
A hybrid kernel is a kernel architecture based on combining aspects of microkernel and monolithic kernel architectures used in computer operating systems. The category is controversial due to the similarity to monolithic kernel; the term has been dismissed by some as simple marketing. The traditional kernel categories are monolithic kernels and microkernels (with nanokernels and exokernels seen as more extreme versions of microkernels).
share
improve this answer
edited
Jan 28 at 15:40
Reno
19.3k
39
62
answered
Nov 27 '09 at 3:19
Bob
28.5k
11
73
92
If I ever do anything in kernel space, I have to remember to use "hybric kerkel" somewhere. SCNR ;-)
Jürgen A. Erhard
Dec 26 '09 at 19:15
Windows NT was
always
a hybrid system. The kernel might be not exactly hybrid, but you run into question of what you count as part of it (winapi, for example, is implemented as user-space service)
p_l
Jan 9 at 12:12
up vote
down vote
Monolithic kernel means that the whole operating system runs in kernel mode (i.e. highly privileged by the hardware). That is, no part of the OS runs in user mode (lower privilege). Only applications on top of the OS run in user mode.
In non-monolithic kernel operating systems, such as Windows, a large part of the OS itself runs in user mode.
In either case, the OS can be highly modular.
share
improve this answer
answered
Nov 27 '09 at 3:19
CesarGon
8,068
20
53
Windows is most definitely a monolithic kernel.
Adam Rosenfield
Nov 27 '09 at 3:51
@Adam: I disagree. The old-style 16-bit Windows
was
monolithic kernel, as was Windows 95 and the like. But NT-based editions of Windows, including all Server versions plus Vista and 7, are clearly microkernel or perhaps hybrid, depending on what definition of "microkernel" you use.
CesarGon
Nov 27 '09 at 3:59
Just because the printer drivers don't run in ring0 doesn't make it a microkernel :)
caf
Nov 27 '09 at 5:40
@caf: I suggest you take a look at
en.wikipedia.org/wiki/Windows_NT_kernel
and
en.wikipedia.org/wiki/Comparison_of_operating_system_kernels
. You'll see that Windows NT and their successors, including Vista, 7 and the Servers, are described as "hybrid kernel". Two large subsystems of the OS run fully in user mode, not just a printer driver. :-)
CesarGon
Nov 27 '09 at 15:23
My comment was somewhat tongue-in-cheek - the "hybrid" designation seems so information-free as to be useless.
caf
Nov 28 '09 at 1:31
show
more comments
up vote
down vote
'Monolithic' in this context does not refer to there being a single large executable, and as you say, there Linux supports the dynamic loading of kernel modules at runtime. When talking about kernels, 'monolithic' means that the entire operating system runs in 'privileged' or 'supervisor' mode, as opposed to other types of operating systems that use a type of kernel such as a 'microkernel', where only a minimal set of functionality runs in privileged mode, and most of the operating system runs in user space.
Proponents of microkernels say that this is better because smaller code means less bugs, and bugs running in supervisor mode can cause much greater problems than in user space code (such as a greater chance of having security vulnerabilities or total system crashes in the form of a 'kernel panic'). Some microkernels are sufficiently minimal that they can be 'formally verified', which means you can mathematically prove that the kernel is 'correct' according to a specification.
L4
is a good example of this.
share
improve this answer
edited
Sep 20 '11 at 6:22
Peter Mortensen
6,515
43
73
answered
Nov 27 '09 at 3:20
David Claridge
1,948
18
Check your sources. The wikipage is uncited.
www2.cs.uh.edu/~rzheng/course/COSC6397sp2008/…
monksy
Nov 27 '09 at 3:29
Not the answer you're looking for? Browse other questions tagged
architecture
operating-system
linux-kernel
or
ask your own question
tagged
architecture
7628
linux-kernel
4534
operating-system
3933
asked
3 years ago
viewed
13537 times
active
4 months ago
Linked
Is it easier to write filesystem drivers in userspace than in kernel space?
What kind of kernel does MS Windows have?
Difference between monolithic and microkernel
Related
Question Regarding Linux kernel book
Where the system call function “sys_getpid” is located in the linux kernel?
Static call graph generation for the Linux kernel
Cross-compiled kernel unable to boot because of a strange module loop
Why processes are deprived of CPU for TOO long while busy looping in Linux kernel?
understanding priority arrays in linux kernel
-2
Suggestions on starting my own linux OS (very basic)
Is number of compiled modules affecting size of linux kernel in RAM?
Building system calls in Linux. Kernel > 3.x.x
ioctl kernel call failing - ioctl module is in kernel, Ubuntu Linux VM in Oracle's Virtual Box
question feed
about
help
badges
blog
chat
data
legal
jobs
advertising info
mobile
feedback
Technology
Life / Arts
Culture / Recreation
Science
Other
Stack Overflow
Server Fault
Super User
Web Applications
Ask Ubuntu
Webmasters
Game Development
TeX - LaTeX
Programmers
Unix & Linux
Ask Different (Apple)
WordPress Answers
Geographic Information Systems
Electrical Engineering
Android Enthusiasts
Information Security
Database Administrators
Drupal Answers
SharePoint
User Experience
Mathematica
more (13)
Photography
Science Fiction & Fantasy
Seasoned Advice (cooking)
Home Improvement
more (13)
English Language & Usage
Skeptics
Mi Yodeya (Judaism)
Travel
Christianity
Arqade (gaming)
Bicycles
Role-playing Games
more (21)
Mathematics
Cross Validated (stats)
Theoretical Computer Science
Physics
MathOverflow
more (7)
Stack Apps
Meta Stack Overflow
Area 51
Stack Overflow Careers
site design / logo © 2013 stack exchange inc; user contributions licensed under
cc-wiki
with
attribution required
rev 2013.10.17.1075