[blog] Monolithic Kernel and Microkernel

Setting aside more exotic approaches, generally, two kernel models are described: monolithic and microkernel. The crucial difference between them is the amount of system resources that run in supervisor space and user space.

Figure 1 conceptually illustrates the two approaches. In the microkernel a smaller set of processes run in kernel space. System programs, such as the file system, device drivers, etc., will be in the user domain and act as servers. In the kernel domain are the most essential modules, such as the scheduler and interprocess communication mechanisms. The primary function of the microkernel is to manage resources, and to a lesser extent to abstract the hardware. Modularity is a strong point of the architecture, normally described as a loosely coupled set of layers in the client-server model.

Figure 1. Monolithic Kernel vs. Microkernel [1]

A monolithic kernel concentrates all services in a single compilation unit, and only the application will be running in user space. In this type of system, the kernel besides being a resource manager is also an extension of the machine (“an extended machine”), because it completely abstracts the hardware for the user.

Kernel + OS

In Figure 2 a famous conceptual illustration of the GNU Operating System on the top of the Linux kernel. The fundamental glibc library is on user space. In the kernel space there is a part that is “universal” and another part that depends on the hardware platform.

Figure 2. GNU/Linux [3]

Compare it to the System V architecture from a 1986 book.

Figure 3. System V [5]

On microkernel-based systems such as those on Figure 4 and 5, most of the system is in user space. Besides modularity, another alleged advantage of this type of architecture is that, for instance, if a device driver enters a deadlock, the kernel can reset the system. On a system with a monolithic kernel this would not be possible because the system would already be locked in supervisor mode. Microkernels are however known to be slower on general-purpose systems – in addition to adding complexity to interprocess communication, which can eventually be exploited by malicious code.

Figure 4. QNX Neutrino
Figure 5. Minix 3 [4]

Different operating system flavors are possible when using a microkernel. In Figure 6a, the monolithic OS means that all servers are concentrated in a single program, and applications use clients to access these concentrated services. In Figure 6b, the servers are modularly distributed. In Figure 6c., a specialized (dedicated) application interacts directly with the microkernel, a common approach on embedded systems.

Figure 6. Systems with microkernel: a) Monolithic OS with Microkernel b) OS distributed with microkernel c) Monolithic system with microkernel [2]

[1] Ken, Yu. RTOS Model and Simulation using System C . 2010

[2] HERDER, Jorrit. Torwards a true Microkernel Operating System. 2005

[3] Anatomy of the Linux kernel – IBM Developer

[4] https://upload.wikimedia.org/wikipedia/commons/7/7d/The_MINIX_3_Microkernel_Architecture.png

[5] BACH, Maurice. The Design of the UNIX® Operating System. 1986

Author: Antonio Giacomelli de Oliveira

Embedded Systems Engineer

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: