1 / 10

Chapter 15 Address Translation

Chapter 15 Address Translation. Chien -Chung Shen CIS, UD cshen@cis.udel.edu. Mechanism. Mechanism of CPU virtualization : limited direct execution (LDE)

kamea
Download Presentation

Chapter 15 Address Translation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 15Address Translation Chien-Chung Shen CIS, UD cshen@cis.udel.edu

  2. Mechanism • Mechanism of CPU virtualization: limited direct execution (LDE) • Let program run directed on hardware; at certain key points in time (e.g., system call or inter interrupt), OS retains controlover hardware for efficient virtualization • Mechanism of memory virtualization • efficiency – via hardware support • control – protection via hardware support • flexibility – make system easier to program and to use address space (hardware-based) address translation

  3. Address Translation • Hardware does [virtual address (provided by instruction)  physical address] • OS manages memory by setting up hardware • to create illusion that each program has its own private memory, even though many programs are sharing memory at the same time • Create useful, powerful, and easy to use abstraction

  4. Example • Assumptions: user’s address space must be placed contiguously in physical memory; its size is less than the size of physical memory; each address space is exactly the same size

  5. Interposition for Transparency x = x + 3; 128: movl 0x0(%ebx), %eax 132: addl $0x03, %eax 135: movl %eax, 0x0(%ebx) • Address space starts from address 0 • To virtualize memory, OS needs to place the process somewhere else in physical memory • Problem: how can OS relocate process in memory that is transparent to the process? • Solution: hardware interposeson each memory access, and translates each virtual address issued by the process to a physical address where the desired information is actually stored

  6. Dynamic (H/W-based) Relocation • Base and bounds registers • Each program is written and compiled as if it is loaded at address 0 • When a program starts running, OS decides where in physical memory it should be loaded and sets the baseregister to that value • Address translation physicaladdress = virtual address + base • Bounds for protection • Memory management unit (MMU) inside CPU

  7. Static (S/W-based) Relocation • Loader • take an executable that is about to be run and rewrites its addresses to the desired offset in physical memory • e.g., movl1000,%eax, and the address space of the program was loaded starting at address 3000 (and not 0, as the program thinks), the loader would rewrite the instruction to offset each address by 3000 (movl4000,%eax).

  8. OS Issues • OS must take action when a process is created, finding space for its address space in memory • OS must take action when a process is terminated, reclaiming all of its memory for use in other processes or the OS • OS must also take action when a context switch occurs (save/restore base-bounds register values to/from PCB) • Access to base and bounds registers is privileged

  9. Summary • LDE address translation • efficiency via hardware • transparent • Base and bounds: protection • Problem: internal fragmentation • Solution: segmentation

More Related