• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

mmu vs. non-mmu processors

jhu

Lifer
so what's the difference between the two? what does an mmu do for you that a lot embedded processors leave out?
 
Virtual memory support (support for virtual addresses so that every process sees itself as having the whole address space, memory protection so processes can't see/change each other's memory, and so on).
 
One of the incredibly useful things an MMU lets you do is make a bunch of discontiguous chunks of memory appear to be contiguous. So, instead of trying to find, say, 64 contiguous 4KB pages of free memory, you could allocate 64 discontiguous pages and let the MMU "massage" them so they appear to be contiguous. For example, the Linux kernel routine vmalloc() does this. I'm sure other operating systems have similar routines.

In general though, embedded applications are highly specialized and don't need things like memory protection or virtual memory so there's no need to waste power or die size on a MMU that's not going to be used.

 
The MMU basically allows the OS to define how to map the memory addresses in the registers to memory locations on the memory bus. All the other features described above are gained by using this simple feature.

Specifically, the memory space is divided into 'pages' of some size (sometimes configurable by the OS). A common page size is 4-16KB. When memory is accessed, the MMU takes the memory address, strips off the bits corresponding to the page size, and the remainder is the virtual page number. The MMU then looks in the page table assigned by the OS to see where this virtual page number maps to in terms of physical page numbers. This value is sent, along with the offset that was stripped off earlier, down the memory address lines of the CPU. The page table entry also has info such as whether reading or writing or both is allowed on that page.

In order to protect one process's memory from another's, OSes will use separate page tables for each process, with none of them sharing any pages.
 
The MMU basically allows the OS to define how to map the memory addresses in the registers to memory locations on the memory bus. All the other features described above are gained by using this simple feature. Specifically, the memory space is divided into 'pages' of some size (sometimes configurable by the OS). A common page size is 4-16KB. When memory is accessed, the MMU takes the memory address, strips off the bits corresponding to the page size, and the remainder is the virtual page number. The MMU then looks in the page table assigned by the OS to see where this virtual page number maps to in terms of physical page numbers. This value is sent, along with the offset that was stripped off earlier, down the memory address lines of the CPU. The page table entry also has info such as whether reading or writing or both is allowed on that page.
 
Back
Top