From a4b7700871ed9f0f1b55b83d5e05cbe32a880fcf Mon Sep 17 00:00:00 2001 From: Adam Green Date: Sun, 18 Nov 2018 00:10:35 -0800 Subject: [PATCH] Change 'thread' to 'process' Section 3 discusses how the MMU on desktop machines is used to protect one **thread** from accessing the memory of another thread. On most desktop operating systems, the MMU is used to protect one **process** from accessing another process' memory. Threads within a process can typically access the memory used by other threads in the same process. --- src/peripherals/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/peripherals/index.md b/src/peripherals/index.md index b5a01a1..6b6a192 100644 --- a/src/peripherals/index.md +++ b/src/peripherals/index.md @@ -21,7 +21,7 @@ However, unlike graphics cards, which typically have a Software API like Vulkan, On a microcontroller, writing some data to some other arbitrary address, such as `0x4000_0000` or `0x0000_0000`, may also be a completely valid action. -On a desktop system, access to memory is tightly controlled by the MMU, or Memory Management Unit. This component has two major responsibilities: enforcing access permission to sections of memory (preventing one thread from reading or modifying the memory of another thread); and re-mapping segments of the physical memory to virtual memory ranges used in software. Microcontrollers do not typically have an MMU, and instead only use real physical addresses in software. +On a desktop system, access to memory is tightly controlled by the MMU, or Memory Management Unit. This component has two major responsibilities: enforcing access permission to sections of memory (preventing one process from reading or modifying the memory of another process); and re-mapping segments of the physical memory to virtual memory ranges used in software. Microcontrollers do not typically have an MMU, and instead only use real physical addresses in software. Although 32 bit microcontrollers have a real and linear address space from `0x0000_0000`, and `0xFFFF_FFFF`, they generally only use a few hundred kilobytes of that range for actual memory. This leaves a significant amount of address space remaining. In earlier chapters, we were talking about RAM being located at address `0x2000_0000`. If our RAM was 64 KiB long (i.e. with a maximum address of 0xFFFF) then addresses `0x2000_0000` to `0x2000_FFFF` would correspond to our RAM. When we write to a variable which lives at address `0x2000_1234`, what happens internally is that some logic detects the upper portion of the address (0x2000 in this example) and then activates the RAM so that it can act upon the lower portion of the address (0x1234 in this case). On a Cortex-M we also have our Flash ROM mapped in at address `0x0000_0000` up to, say, address `0x0007_FFFF` (if we have a 512 KiB Flash ROM). Rather than ignore all remaining space between these two regions, Microcontroller designers instead mapped the interface for peripherals in certain memory locations. This ends up looking something like this: