Winter Semester 2026–27 · VIT-AP · BACSE106 · Operating Systems · Dr. Krithika L.B

Modular and hybrid kernels

Loadable kernel modules, the module life cycle, and how Linux, Windows, macOS and Android mix structures.

Module 1 Session 1.2 Lesson 3 of 3

Modular and hybrid kernels

How Linux adds drivers and file systems while it is running, and why every real OS mixes structures.

The modular idea

A modular kernel has a small set of core components — scheduling, memory management, the module loader — and links in other services as loadable kernel modules (LKMs), at boot time or at run time.

Scheduling classesFile systems (ext4, vfat, nfs)Device drivers
Core kernel + module loader
Network protocolsSecurity modulesExecutable formats

Each module plugs into a defined interface of the core — and may call any other module directly.

The developer writes a module in C with an init and an exit function and compiles it against the kernel headers into a .ko (kernel object) file.

sudo modprobe ext4 (or insmod file.ko). The kernel checks the module, resolves its symbols against exported kernel functions, links it into kernel memory and calls its init function. Dependencies are loaded first by modprobe.

The module registers itself — e.g. a file system registers with the virtual file system (VFS); a driver registers for a USB vendor/device id. From now on it runs in kernel mode exactly like built-in code; calls into it are plain function calls.

lsmod lists loaded modules with their size and how many users each has; modinfo shows file, licence, description and parameters.

sudo rmmod name calls the module's exit function and frees its memory. The kernel refuses if the module is still in use (use count > 0).

Terminal — the module life cycle
$ lsmod | grep -w loop          # not loaded yet: no output
$ sudo modprobe loop            # load
$ lsmod | grep -w loop
loop                   32768  0
$ modinfo loop | grep description
description:    Loopback device support
$ sudo rmmod loop               # unload

Modular vs layered vs microkernel

vs layered

Both use defined, protected interfaces. But a layered system forces calls to go only downward; any module may call any other module.

vs microkernel

Both have a small core. But modules run inside the kernel's address space, so there is no message passing — faster, but a bad module can crash the kernel.

Hybrid systems in practice

SystemStructureWhy
LinuxMonolithic kernel + loadable modulesSpeed of one address space; flexibility of modules for thousands of drivers.
WindowsLargely monolithic, with microkernel-style subsystems and loadable driversPerformance, plus the ability to support several API “personalities”.
macOS / iOSDarwin/XNU: Mach microkernel + BSD UNIX in one address space + kernel extensionsMach's IPC and memory model with BSD's POSIX services, without message-passing cost between them.
AndroidLinux kernel + HAL + native libraries + ART runtimeRe-use Linux drivers; run apps in a managed runtime; vendors plug in hardware through the HAL.
Quick check

A new Wi-Fi adapter works after `sudo modprobe` without a reboot. Which property of the kernel made that possible?

The driver was linked into the running kernel as a module.

Why can a buggy loadable module still crash Linux?

Unlike microkernel servers, modules are not isolated — they have full kernel privilege.

macOS combines Mach and BSD in one kernel address space. That makes it a…

It mixes microkernel heritage with a monolithic UNIX layer for performance.