OSDev Ramblings: Part 3
This article is a draft, and not entirely finished.
Synopsis
Some of the core principles of operating systems centre around, resource allocation and resource isolation. In the case of memory, this is enabled via dedicated hardware on the processor, namely the MMU (Memory Management Unit), which allows 'privileged' parts of the operating system, to provide an isolated (and often contiguous) address space, specific to a particular process. Whilst providing access controls to specific regions of memory. In this article I will talk about how to configure and enable the MMU. I will briefly mention some other related concepts such as caching although that is not the main purpose of this writing.
Virtual Memory overview
Up until now (with the MMU disabled), the only types of addresses that we have had to manage are physical addresses. Where a particular address directly maps to somewhere in DRAM or a piece of hardware (via MMIO). This works OK for a collection of privileged processes. However, we have no mitigations against errant (or malicious) processes.
AArch64 Virtual Memory model
High level description of the virtual memory model under AArch64
Table + Descriptor formats
Assembly stub
References
- The ARM Architecture Reference Manual, an authoritative manual on the behaviors of an ARM processor.
- ARM Developer documentation on the virtual memory subsystem