Kernel Architecture

Compare kernel designs through privilege boundaries, IPC, and driver placement, using Linux 6.12, seL4 16.0.0, and Windows 11 24H2.

published: reading time: 21 min read author: Geek Workbench
Quick Summary

Compare kernel designs through privilege boundaries, IPC, and driver placement, using Linux 6.12, seL4 16.0.0, and Windows 11 24H2.

Kernel Architecture

The kernel manages privileged operations such as scheduling, memory, devices, and system calls. Where each service runs affects how components communicate and what a failure can reach.

The labels monolithic, microkernel, and hybrid are useful starting points, not performance or safety guarantees. Linux 6.12, seL4 16.0.0, and Windows 11 24H2 illustrate different boundary choices; the actual driver model, configuration, and hardware matter more than the label.

Introduction

Kernel architecture describes which services run with kernel privilege and how they communicate. Two systems called “microkernels” can place different services on each side of the boundary; two systems called “monolithic” can also differ in modules, isolation mechanisms, and driver frameworks.

The categories below are shorthand. Use them to ask where a component runs, what privileges it has, and how a failure is contained. They do not predict speed or reliability on their own.

When kernel architecture matters

When to examine it

  • Real-time workloads: Measure worst-case latency on the target hardware and configuration. A kernel family alone does not establish a deadline bound.
  • Security-sensitive systems: Check which components run in privileged mode, what they can access, and which configurations have been verified or certified.
  • Systems with recoverable services: Moving a service to user space can contain some failures, but recovery depends on supervision, dependencies, and device placement.
  • Embedded systems: Compare actual memory use, device support, boot path, and update process for the target board.

When it is not the first question

  • Application-level bottlenecks: Start with profiling the application and its I/O path; a kernel redesign is rarely the first fix.
  • Cloud VMs: The hypervisor adds a boundary between guests, but the guest kernel still controls processes, memory, and devices presented to it.
  • Ordinary desktop workloads: Driver support, configuration, and measured workload behavior usually matter more than the category name.

Architecture diagrams

Monolithic kernel architecture

graph TB
    subgraph "Kernel Space"
        A[System Call Interface] --> B[Process Manager]
        A --> C[Memory Manager]
        A --> D[File System]
        A --> E[Device Drivers]
        A --> F[Network Stack]
        B --> C
        C --> D
        D --> E
        E --> F
        F --> B
    end

    G[User Space Applications] --> A
    H[Device Hardware] --> E

    style A stroke:#ff00ff,stroke-width:2px
    style G stroke:#00fff9,stroke-width:2px

In this simplified monolithic model, many core services, including drivers, run in privileged mode. Components in the kernel can call one another directly; the exact structure varies by operating system.

Microkernel architecture

graph TB
    subgraph "User Space"
        G[Applications] --> H[File Service]
        G --> I[Network Service]
        G --> J[Device Driver Service]
    end

    subgraph "Microkernel"
        K[Minimal Kernel] --> L[IPC]
        K --> M[Scheduling]
        K --> N[Memory Management]
    end

    H --> L
    I --> L
    J --> L

    style K stroke:#ff00ff,stroke-width:2px
    style G stroke:#00fff9,stroke-width:2px

A microkernel keeps a small set of mechanisms, such as IPC and scheduling, in privileged mode. Many designs move file systems and other services to user space, but driver placement and memory-management responsibilities vary by system.

Layered kernel example (Windows NT)

graph TB
    subgraph "Kernel Mode"
        A[NT Kernel] --> B[Executive components]
        B --> C[Kernel-mode drivers]
        A --> D[HAL]
        C --> E[Hardware]
    end

    G[User-mode applications] --> A

    style A stroke:#ff00ff,stroke-width:2px
    style G stroke:#00fff9,stroke-width:2px

Windows 11 24H2 (build 26100) uses the Windows NT kernel, Executive components, a Hardware Abstraction Layer, and kernel-mode drivers. “Hybrid” is often used as a broad label for this layered design, but the label does not mean that every subsystem or driver runs outside the kernel.

Core concepts

Linux 6.12: many services in kernel mode

Linux 6.12 is a monolithic kernel with loadable modules. The scheduler, memory manager, networking stack, file systems, and most device drivers run in kernel mode. A driver compiled as a module can be loaded separately, but it still shares the kernel’s privilege and address space. A fault in that code can affect the whole kernel.

This arrangement allows in-kernel components to call one another directly. That avoids an IPC boundary for those calls, but it does not prove that Linux is faster for a particular workload. System calls, device access, locking, cache behavior, and the workload itself still contribute to cost. Linux also supports user-space services and interfaces such as FUSE; “monolithic” does not mean every service must live in the kernel.

seL4 16.0.0: a small privileged kernel

seL4 keeps the privileged kernel focused on mechanisms such as scheduling, address spaces, capabilities, and IPC. A system built on seL4 can place device drivers and other services in user-level components, but the exact system depends on its configuration and user-level software. A user-level server can fail without directly corrupting kernel memory; dependent services may still stop until a supervisor or operator recovers them.

IPC crosses between components and has a cost. Its size depends on the processor, data path, and implementation. Batching or shared memory can change that cost, so compare measured operations on the target system instead of assuming that message passing is always slower.

Windows 11 24H2: layered kernel-mode components

Windows 11 24H2 (build 26100) includes the NT kernel, Executive managers, the HAL, and kernel-mode drivers. Microsoft documents these as kernel-mode components. Some services and subsystems run in user mode, but a kernel-mode driver fault can still bug-check the operating system. “Hybrid” is a common summary of this arrangement, not a promise of microkernel-style driver isolation.

What the seL4 proof covers

Formal verification applies to named seL4 configurations and properties, not to every build or to an entire product made with seL4. For example, the project lists C-level functional correctness for its ARM verified configuration and identifies the corresponding ARMv7-A assumptions. Other configurations have different proof coverage. The C proof excludes the machine interface and boot code; hardware behavior and configuration assumptions also matter. Applications, drivers, and user-level services are outside the kernel proof unless they have separate verification.

Before making a claim about a deployed system, match its release, architecture, platform, and build options to the verified configuration list. The seL4 FAQ explains assumptions and proof boundaries.

Comparing implementations

Question Linux 6.12 seL4 16.0.0 Windows 11 24H2 (build 26100)
Privilege boundary Core services and most drivers run in kernel mode. Kernel mechanisms run privileged; many services can run as user-level components. NT kernel, Executive components, HAL, and kernel-mode drivers are privileged; other services run in user mode.
IPC and communication cost In-kernel calls avoid an IPC boundary; user/kernel transitions and other IPC still have costs. Components communicate through capability-mediated IPC or shared memory; measure on target hardware. Components use kernel interfaces and user-mode IPC as needed; cost depends on the path.
Driver placement Most drivers run in kernel mode, whether built in or loaded as modules. Drivers may run at user level depending on the system and hardware support. Many drivers run in kernel mode; user-mode driver frameworks exist for supported devices.
Failure containment A kernel-mode driver fault can crash or corrupt the kernel. A user-level service fault can be isolated from kernel memory, but recovery and dependent services need separate design. A kernel-mode driver fault can bug-check Windows; user-mode failures have a narrower boundary.

These are implementation examples, not benchmark results. For latency, reliability, or security decisions, compare the exact build and workload, including drivers and recovery behavior.

Production failure scenarios

Scenario 1: Linux module load failure

What happens: A module may fail to load because it was built for a different kernel, a dependency is missing, or a required symbol is unavailable. The device may not work; boot is affected only if the system depends on that module during startup.

Detection:

# Check loaded modules
lsmod

# View module info and dependencies
modinfo nvidia
modprobe --show-depends nvidia

# View module loading logs
dmesg | grep -i "module\|firmware"
journalctl -b | grep -i module

Mitigation:

  • Check that the module was built for the running kernel: compare uname -r with the module’s build target.
  • Use DKMS (Dynamic Kernel Module Support) for automatic rebuilds on kernel updates
  • Blacklist problematic modules in /etc/modprobe.d/blacklist.conf

Scenario 2: IPC cost dominates a service path

What happens: A service path may spend a measurable share of its time sending messages between components. Whether that matters depends on message size, batching, memory sharing, scheduler behavior, and the processor. The kernel category alone does not tell you the cost.

Mitigation:

  • Profile the request path and count IPC calls before changing the design.
  • Batch small requests or use shared memory for bulk data when the system’s API supports it.
  • Compare latency and throughput on the target hardware with the same workload.

Scenario 3: Windows kernel-mode driver failure

What happens: A fault in a Windows kernel-mode driver can corrupt kernel state or trigger a bug check. A user-mode driver has a different failure boundary, but device availability and dependent services can still be affected.

Mitigation:

  • Enable Driver Verifier on Windows for development
  • Use WHQL-certified drivers where possible
  • Enable crash dump collection for post-mortem analysis
  • Implement kernel debugging with WinDbg when investigating

What to measure before choosing

The useful comparison depends on the system you plan to ship. Record the exact release, hardware, driver model, and configuration, then measure the workload that matters.

Decision Evidence to collect
Latency End-to-end and worst-case latency for the target workload, including IPC, device access, scheduling, and I/O.
Failure containment Which processes or kernel components fail under a driver or service fault, and how the system recovers.
Security boundary Privileges and capabilities granted to drivers, services, and applications; enabled hardening options; proof or certification scope.
Operational fit Device support, update and rollback process, observability, and the skills needed to maintain the system.

Implementation snippets

Listing kernel modules (Linux)

#!/bin/bash
# List loaded kernel modules and their dependencies

echo "=== Currently Loaded Modules ==="
lsmod

echo -e "\n=== Module Details ==="
for mod in $(lsmod | awk 'NR>1 {print $1}'); do
    echo "Module: $mod"
    modinfo "$mod" 2>/dev/null | grep -E "^description|^author|^license" || true
    echo "---"
done

echo -e "\n=== Memory Used by Modules ==="
cat /proc/modules | awk '{print $1, $2*1024 " bytes"}'

Checking kernel configuration (Linux)

#!/bin/bash
# Check kernel configuration options relevant to security and performance

echo "=== Kernel Security Options ==="
grep -E "^CONFIG_(KPROBES|SECCOMP|STRICT_DEVMEM|DEBUG_KMEMLEAK)" /boot/config-$(uname -r) 2>/dev/null || \
    grep -E "^CONFIG_(KPROBES|SECCOMP|STRICT_DEVMEM)" /proc/config.gz 2>/dev/null || \
    echo "Kernel config not accessible"

echo -e "\n=== Preemption Config ==="
grep -E "^CONFIG_(PREEMPT|PREEMPT_RT|NO_HZ)" /boot/config-$(uname -r) 2>/dev/null || echo "N/A"

echo -e "\n=== Memory Management ==="
grep -E "^CONFIG_(HUGETLB|PAGE_TABLE|TRANSPARENT_HUGEPAGE)" /boot/config-$(uname -r) 2>/dev/null || echo "N/A"

Exploring macOS kernel details

# Check XNU version and build
sw_vers
uname -a

# View loaded kernel extensions
kextstat | head -30

# Check Mach IPC primitives
# (requires admin privileges)
ipcs

Reading seL4 verification claims

Do not infer proof coverage from the name “seL4” alone. The project lists proof properties by architecture and configuration. For example, its ARM verified configuration lists C-level functional correctness, integrity, confidentiality, and binary correctness for the covered C functions. Other configurations have different proof coverage.

The C proof does not cover the machine interface or boot code. Hardware behavior, configuration assumptions, drivers, user-level services, and applications also sit outside that claim unless they have separate verification. Match the release, platform, architecture, and build options to the verified configuration list; read the seL4 FAQ for the assumptions behind the proofs.

Observability checklist

Linux kernel observability

# System call tracing
strace -c -p <pid>  # Summarize syscalls for a process

# Kernel function tracing (requires tracing support and suitable permissions)
cat /sys/kernel/tracing/available_tracers
echo function > /sys/kernel/tracing/current_tracer

# Kernel memory allocation tracing
slabtop -o
cat /proc/meminfo

# Scheduler latency analysis
perf sched latency

macOS kernel observability

# DTrace probes
dtrace -l | head -20

# Kernel extensions
kextstat -l -b com.apple.driver.ExampleDriver

# Mach kernel statistics
vm_stat 1  # Virtual memory stats, sampled every 1 second

Windows kernel observability

# Check kernel version
systeminfo | findstr /C:"OS Name" /C:"OS Version"

# Driver verifier status
verifier /query

# Event viewer for kernel errors
Get-WinEvent -FilterHashtable @{LogName='System'; Level=1,2,3} -MaxEvents 20

Common pitfalls

Security and attack surface

Kernel-mode code has broad access, so review the interfaces and components that can reach it:

  • System calls: An important user/kernel boundary; handlers must validate untrusted inputs.
  • Device drivers: Third-party drivers often have lower security standards
  • Kernel modules: Loadable code extends the kernel’s attack surface
  • Transient-execution vulnerabilities: Spectre and Meltdown affected some processors and operating-system configurations.

Defense mechanisms that mitigate these threats:

  • KASLR (Kernel Address Space Layout Randomization): Randomizes kernel memory addresses
  • KPTI (Kernel Page-Table Isolation): Mitigates some Meltdown exposure by separating user and kernel page tables on affected systems.
  • SMEP (Supervisor Mode Execution Prevention): Prevents executing user-space code from kernel mode
  • SMAP (Supervisor Mode Access Prevention): Prevents kernel from accessing user-space memory
  • seccomp: Filters allowed system calls for specific programs

Architectural pitfalls

  1. Assuming a component label guarantees isolation: A Linux or Windows kernel-mode driver can affect the kernel. A user-level driver or service may have a narrower memory boundary, but recovery depends on the surrounding system and its device dependencies.

  2. Ignoring module-signing policy: Some distributions enforce trusted module signatures, especially when Secure Boot is enabled. Follow the target distribution’s signing and enrollment process; do not disable the policy to make a test module load.

  3. Granting containers unnecessary privileges: --privileged and broad capabilities weaken container isolation by granting access to host devices and kernel interfaces. Use only the permissions the workload needs.

  4. Forgetting about kernel version skew: eBPF programs, kernel modules, and container runtimes can depend on kernel features. Check their compatibility information before upgrading.

  5. Assuming a kernel family guarantees real-time behavior: Deadline guarantees depend on the full system, configuration, hardware, and workload. Measure worst-case behavior and validate the required operating conditions.

  6. Overlooking kernel memory use: Reclaimable caches and other allocations compete for memory with applications. Monitor the target system before tuning /proc/sys/vm/ settings.

Compliance considerations

For regulated systems, check the exact policy and validation scope that applies to the product:

  • FIPS 140-3 applies to cryptographic modules submitted for validation.
  • Common Criteria certification evaluates kernel security features
  • Government systems may require specific kernel configurations
  • Audit logging for kernel-level events (syscall audit on Linux)

Quick recap

  • Kernel architecture describes privilege boundaries and communication paths; it does not predict a workload’s performance or reliability.
  • Linux 6.12 loadable modules still run in kernel mode.
  • seL4 verification applies to named configurations and stated properties under assumptions.
  • Windows 11 24H2 includes kernel-mode managers, the HAL, and kernel-mode drivers; some services and driver frameworks run in user mode.
  • Driver placement and recovery design affect how much a component failure can disrupt.
  • Kernel observability requires specialized tools: perf, strace, dtrace, bpftrace
  • Security features such as KASLR, SMEP, KPTI, and seccomp address different risks and depend on platform support and configuration.
  • Real-time behavior must be measured and validated for the complete target system.

Interview questions

1. What are the main differences between monolithic and microkernel architectures?

These labels describe common designs, but they do not determine performance or isolation on their own. In Linux 6.12, most drivers share kernel privilege; seL4 can place services in user space, with proof coverage tied to a specific configuration; Windows 11 24H2 also has kernel-mode drivers. Check the boundary that matters in the system you are evaluating.

2. What does Linux 6.12's monolithic design mean for driver placement?

Linux 6.12 puts many services, including the scheduler, memory manager, network stack, file systems, and most drivers, in kernel mode. Loadable modules make parts of that code easier to package and update, but they do not lower its privilege. The design has direct in-kernel calls; whether that helps a workload is a measurement question.

3. What is a kernel module and why does Linux support them?

A kernel module adds code to a running kernel without rebuilding the whole kernel image. Linux can load and remove modules at runtime, but they still run with kernel privilege. That makes modules operationally convenient, not isolated from kernel faults.

4. What is IPC in the context of microkernels?

IPC is communication between processes or protection domains. A microkernel-based system often uses kernel-mediated messages for service calls, and may use shared memory for bulk data. The number of transitions and their cost depend on the API, hardware, and system design.

5. How does macOS's XNU combine microkernel and monolithic approaches?

XNU combines Mach, BSD, and I/O Kit components in one kernel. Calling it a hybrid can be a useful shorthand, but it does not mean those components behave like independently isolated user-space servers. Check the privilege boundary and driver model for the macOS release in question.

6. What are the key differences between kernel modules and user-space servers in a microkernel architecture?

A Linux kernel module runs in kernel mode and can access kernel data structures. A user-space server runs with user-space privileges and is separated from kernel memory, but its failure can still stop services that depend on it. Neither placement alone says how well the full system recovers.

7. What does formal verification establish about an seL4 system?

seL4 proofs cover named properties for specific architecture and build configurations. The project's ARM configuration, for example, lists C-level functional correctness; proof assumptions include hardware and low-level machine-interface behavior, and the C proof excludes boot code. Applications and drivers need separate evidence. See the verified configuration list before making a claim about a product.

8. What is the Zircon kernel used in Fuchsia and how does its architecture differ from Linux?

Zircon is Fuchsia's kernel. Fuchsia uses user-mode components and capability-based handles around it, but that does not make every driver or service failure harmless. Component placement, permissions, and restart behavior determine the boundary in a particular system.

9. What evidence is needed to claim real-time deadline behavior?

Real-time behavior is an end-to-end property of the configured system. The kernel, drivers, firmware, hardware, workload, and scheduling policy all affect worst-case response time. A "real-time" kernel option is not by itself evidence that a product will meet a deadline.

10. How does the Windows NT kernel's architecture differ from Linux's, particularly in its use of the Executive and HAL?

Windows 11 24H2 (build 26100) uses the NT kernel, Executive components, the HAL, and kernel-mode drivers. Some services and supported driver frameworks run in user mode. Microsoft's kernel documentation describes these components; the "hybrid" label does not promise that kernel-mode failures are isolated.

11. What is the role of the kernel's system call interface and how does it differ from a regular function call?

A system call crosses from user mode into a kernel service. The exact transition depends on the processor architecture. Some library calls, such as supported clock_gettime() paths, can use the vDSO and avoid a full system call; that is a specific fast path, not a property of all system calls.

12. What is kernel preemption and how does the PREEMPT_RT patch improve Linux's real-time capabilities?

Linux 6.12 includes PREEMPT_RT support. It changes locking and interrupt handling to make more kernel execution preemptible, but firmware delays, drivers, hardware, and workload still affect worst-case latency. Validate the complete configuration under the conditions the application will face.

13. How does a kernel oops differ from a panic?

An oops reports a kernel fault. Depending on where it occurs and how the kernel is configured, the kernel may continue or panic; panic_on_oops changes that policy. A panic stops normal operation. Neither term describes an ordinary application error.

14. What is the difference between a monolithic kernel and a modular kernel like Linux with loadable modules?

"Monolithic" describes where services run; "modular" describes how kernel code can be packaged and loaded. Linux 6.12 is both monolithic in this architectural sense and modular in its support for loadable modules. A module still shares kernel privilege.

15. How does the kernel handle the transition from kernel space to user space and why must this be done carefully?

Returning from kernel mode to user mode restores processor state and switches privilege according to the architecture. The entry and return instructions differ across CPUs and kernel paths. KASLR randomizes kernel addresses; it is separate from enforcing the user/kernel memory boundary.

16. What is the relationship between a microkernel's IPC and its security model?

In seL4, capabilities control access to kernel objects, including IPC endpoints. A system can use those checks to limit which components may communicate. It is not accurate to say that every privileged operation in every microkernel design is an IPC call, or that IPC alone guarantees system security.

17. Which scheduler policy does Linux 6.12 use for fair tasks?

In Linux 6.12, the fair scheduling class uses EEVDF, which began replacing the earlier CFS algorithm in Linux 6.6. Real-time and deadline classes use different policies. Scheduler behavior depends on kernel version, configuration, and task settings.

18. What is the role of the kernel's virtual file system (VFS) layer in supporting multiple filesystems?

The Virtual File System (VFS) gives Linux file-system implementations a common interface to operations such as open, read, and write. The VFS dispatches those operations to the mounted file system; it does not make their storage or performance behavior identical.

19. What is the relationship between the kernel's memory management unit (MMU) and the TLB (Translation Lookaside Buffer)?

The MMU translates virtual addresses using page tables. The TLB caches recent translations so the processor can avoid repeating page-table walks. Some architectures use address-space tags such as PCIDs or ASIDs to reduce flushes; the exact cost of a miss or context switch depends on the processor and workload.

20. What should a team weigh when considering user-space services?

Some systems put more services in user space to limit what a service fault can corrupt. That can help with containment, but a component may still take dependent functions offline, and recovery needs its own design. Compare measured latency and failure recovery on the target hardware rather than assuming a fixed IPC penalty.

Further reading

Conclusion

Start with the boundary you care about: which components run with kernel privilege, which calls cross protection domains, and what happens when a driver or service fails. Then check the exact release and build options, and measure the target workload. The architecture diagram helps frame those questions; drivers, configuration, and recovery behavior answer them.

Category

Related Posts

ASLR & Stack Protection

Explore ASLR, PIE, stack canaries, and NX on Linux with GCC, then inspect a harmless C program to see what each mitigation does and where it falls short.

#operating-systems #aslr-stack-protection #computer-science

Assembly Language Basics: Writing Code the CPU Understands

Learn x86-64 Linux assembly with the System V ABI: track registers, assemble and run a small program, debug it in GDB, then compare AArch64.

#operating-systems #assembly-language-basics #computer-science

Boolean Logic & Gates

Understanding AND, OR, NOT gates and how they combine into arithmetic logic units — the building blocks of every processor.

#operating-systems #boolean-logic-gates #computer-science