Operating Systems and Embedded Software · System architecture
Memory Isolation
Also known as memory protection, spatial isolation, address-space separation, memory partitioning
Preventing one software component from reading or corrupting another's memory, enforced by hardware such as an MMU or MPU and configured by the OS or hypervisor. It is a key basis for freedom from interference in mixed-criticality systems.
Explanation
Without isolation, any defective or malicious component can overwrite data that belongs to others, including the kernel. Memory protection units (MPUs) on microcontrollers define a small number of address regions with access rights. Memory management units (MMUs) on application processors translate virtual addresses and give each process its own address space.
Operating systems build on this hardware. Zephyr treats user-mode threads as untrusted and confines them to memory domains, blocking access to kernel objects that have not been explicitly granted and detecting stack overflows. QNX uses the MMU to run drivers and services as separate protected processes. Hypervisors extend the same idea to whole virtual machines. DMA-capable peripherals also need to be constrained, because they can access memory without going through the CPU's protection.
Memory isolation addresses spatial interference only. Timing interference through shared caches, buses or CPU time, and interference through communication, need separate measures, and safety analyses treat them separately.
How it works
Each partition (a thread group, process or virtual machine) is assigned memory regions with read, write and execute permissions. On every context switch, the OS or hypervisor loads the matching MPU regions or page tables. Any access outside the permitted regions raises a hardware fault, and the kernel responds by terminating or restarting the offending partition and, where required, reporting the error to a safety monitor.
Automotive applications
- Separating ASIL-rated and QM software on one ECU
- Sandboxing protocol parsers and third-party apps
- Isolating virtual machines on a cockpit SoC
- Detecting stack overflows on microcontrollers
Example
On a zonal-controller MCU, an ASIL B lighting function and a QM diagnostics parser run in separate MPU-protected partitions. When a malformed request makes the parser write past its buffer, the MPU raises a fault and only the parser partition is restarted.
An illustrative example: any figures in it are worked numbers, not measurements.
References
- User Mode: Overview (opens in a new tab)
“User mode threads are considered to be untrusted by Zephyr and are therefore isolated from other user mode threads and from the kernel.”
- QNX SDP 8.0 System Architecture: The Philosophy of the QNX OS (opens in a new tab)
Definitions are original summaries. Standards text is not reproduced; follow the links for the official publications.