15. Mechanism: Address Translation
Efficiency and control together are two of the main goals of any modern operating system.
(hardware-based) address translation
: hardware transforms each memory access(e.g., an instruction fetch, load, or store), changing the virtual address provided by the instruction to a physical address where the desired information is actually located. Thus, on each and every memory reference, an address translation is performed by the hardware to redirect application memory references to their actual locations in memory.
the hardware alone cannot virtualize memory, as it just provides teh low-level mechanism for doing so efficiently. The OS must get involved at key points to set up the hardware so that the correct translations take place; it must thus manage memory, keeping track of which locations are free and which are in use,...
goal : illusion; Behind that virtual reality lies the ugly physical truth : that many programs are actually sharing memory at the same time, as the CPU(or CPUs) switches between running one program and the next.
15.1 Assumptions
- 유저의 address space는 physical address와 인접해 있다.
- address space는 크지 않다(물리 주소보다 작다)
- 각 address space는 동일한 사이즈이다.
15.2 An Example
- how can we relocate this process in memory in a way that is transparent to the process? How can provide the illusion of a virtual address space starting at 0, when in reality the address space is located at some other physical address?
15.3 Dynamic (Hardware-based) Relocation
- base and bounds
: physical address = virtual address + base
: bound to help with protection
Example Translations
그러니까, 베이스 어드레스는 버츄얼 어드레스에 더해줌으로써 물리 주소로 접근하게 하는 어드레스고 바운드 어드레스는 물리주소의 범위를 넘어가는지 등의 protection 체크를 위한 어드레스다!
-출처-
<OPERATING SYSTEMS three easy pieces>
REMZI H. ARPACI-DUSSEAU
ANDREA C. ARPACI-DUSSEAU
UNIVERSITY OF WISCONSIN-MADISON