MMU结构以及工作原理
- 格式:pdf
- 大小:131.10 KB
- 文档页数:6
MMU结构以及⼯作原理
MMU结构以及⼯作原理
2009-06-15 18:40
作者:wogoyixikexie@gliet
——————————————————————————————————————————————
MMU的⼤名,早就听说了,可是⼀直不知道它是怎么⼯作的,前⼏⽉貌似看的模模糊糊,现在快年关
了,来做个了结。在⽂中我会⼤量引⽤英⽂,并且不做翻译,因为俺觉得我的英⽂⽔平会误解别⼈。O(∩_∩)O哈哈~
One of the key services provided by an MMU is the ability to manage tasks as indepen-dent programs
running in their own private memory space. A task written to run under the control of an operating system
with an MMU does not need to know the memory
requirements of unrelated tasks. This simpli?es the design requirements of individual tasks running
under the control of an operating system.
——给每个任务提供独⽴的运⾏空间。
The MMU simpli?es the programming of application tasks because it provides the resources needed
to enable virtual memory—an additional memory space that is indepen-dent of the physical memory
attached to the system. The MMU acts as a translator, which
converts the addresses of programs and data that are compiled to run in virtual memory to the actual
physical addresses where the programs are stored in physical main memory.This translation process
allows programs to run with the same virtual addresses while being
held in different locations in physical memory.——MMU作为⼀个转换器。程序可以运⾏在同⼀块虚拟内
存,⽽各⾃存储在不同的物理内存。
We begin with a review of the protection features of an MPU and then present the additional features
provided by an MMU. We introduce relocation registers, which hold the conversion data to translate
virtual memory addresses to physical memory addresses,
and the Translation Lookaside Buffer (TLB), which is a cache of recent address relocations.We then
explain the use of pages and page tables to con?gure the behavior of the relocation registers.
——这⾥介绍重定位寄存器,它保存转换虚拟地址到物理地址的数据;介绍旁路缓冲器(TLB),它是存
放最近的的地址重定位信息的cache(⾼速缓存);介绍如是使⽤页和页表来重新配置重定位寄存器。
We then discuss how to create regions by con?guring blocks of pages in virtualmemory .We end the
overview of the MMU and its support of virtual memory by showing how tomanipulate the MMU and page
tables to support multitasking.
——讨论通过虚拟内存中的块页表来配置来创建区域。最后演⽰使⽤虚拟内存来⽀持和创建多任务操作系
统
___________________________________________________________________________
现在来看看这个MMU到底有什么东西,有什么特备的硬件结构
—————————————————————————————————————
To permit tasks to have their own virtual memory map, the MMU hardware performs address
relocation, translating the memory address output by the processor core before it reaches main memory.
The easiest way to understand the translation process is to imagine
a relocation register located in the MMU between the core and main memory.——地址重定位寄存器,其
实就是地址转换器
Figure 14.1 shows an example of a task compiled to run at a starting address of 0x4000000 in virtual
memory. The relocation register translates the virtual addresses ofTask 1 to physical addresses starting
at 0x8000000.
A second task compiled to run at the same virtual address, in this case 0x400000, can be placed in
physical memory at any other multiple of 0x10000 (64 KB) and mapped to 0x400000 simply by changing
the value in the relocation register.
——为什么⼀定要是64KB为倍数的的地址的物理存储器上?难道这个是MMU有什么特殊的硬件结构决定
了?
———————————————————————————————————
A single relocation register can only translate a single area of memory, which is set by
the number of bits in the offset portion of the virtual address. This area of virtual memory
is known as a page. The area of physical memory pointed to by the translation process is
known as a page frame.——页和页帧
———————————————上⾯虚拟内存的转换过程了———————————————
The set of relocation registers that temporarily store the translations in an ARM MMU
are really a fully associative cache of 64 relocation registers. This cache is known as a
Translation Lookaside Buffer (TLB). The TLB caches translations of recently accessed pages.
——重定位寄存器是由64个重定位寄存器cache相连成的,这个cache被称为旁路缓冲器(TLB),它缓
存最近访问页转换的数据。——我觉得是地址数据才对,因为ARM9是数据总线和地址总线分离的。
In addition to having relocation registers, theMMUuses tables inmainmemory to store
the data describing the virtualmemorymaps used in the system. These tables of translation
data are known as page tables. An entry in a page table represents all the information needed
to translate a page in virtual memory to a page frame in physical memory.
——除了使⽤重定位寄存器外,MMU还使⽤在主存中的表来存放描述虚拟内存映射的数据,这个表被称
为页表。
⽽页表的每个⼦表存储了⼀个页转换到物理存储器的⼀个页帧所需要的信息。
—————————————————————————————————
Apage table entry (PTE) in a page table contains the following information about a virtual
page: the physical base address used to translate the virtual page to the physical page frame,
the access permission assigned to the page, and the cache and write buffer con?guration for
the page. If you refer to Table 14.1, you can see that most of the region con?guration data
in an MPU is now held in a page table entry. This means access permission and cache and