Chapter 15 Address Translation Chien-Chung Shen CIS/UD

Slides:



Advertisements
Similar presentations
Part IV: Memory Management
Advertisements

Memory Protection: Kernel and User Address Spaces  Background  Address binding  How memory protection is achieved.
PA0 due today Anyone tried to submit?. Scheduling Workload assumptions Arrive time, run time, I/O, etc. Policies: FIFO, SJF, STCF, RR, MLFQ, and lottery.
Chapter 15 Address Translation Chien-Chung Shen CIS, UD
Memory Management Chapter 7.
Memory Management Questions answered in this lecture: How do processes share memory? What is static relocation? What is dynamic relocation? What is segmentation?
Chapter 6 Limited Direct Execution
CS 311 – Lecture 21 Outline Memory management in UNIX
CS 153 Design of Operating Systems Spring 2015
1 Operating Systems and Protection CS Goals of Today’s Lecture How multiple programs can run at once  Processes  Context switching  Process.
Operating Systems CMPSCI 377 Lecture 11: Memory Management
X86 segmentation, page tables, and interrupts 3/17/08 Frans Kaashoek MIT
Virtual Memory Operating Systems Lecture # 8. Multi-tasking OS OS Excel MS Word Outlook 0x0000 0x7000 0x4000 0x8000 0x9000.
Multiprocessing Memory Management
Memory Management CSCI 3753 Operating Systems Spring 2005 Prof. Rick Han.
Memory Management. 2 How to create a process? On Unix systems, executable read by loader Compiler: generates one object file per source file Linker: combines.
Chapter 8 Operating System Support
Computer Organization and Architecture
Virtual Memory Deung young, Moon ELEC 5200/6200 Computer Architecture and Design Lectured by Dr. V. Agrawal Lectured by Dr. V.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
Chapter 91 Memory Management Chapter 9   Review of process from source to executable (linking, loading, addressing)   General discussion of memory.
Memory Management. Process must be loaded into memory before being executed. Memory needs to be allocated to ensure a reasonable supply of ready processes.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
Chapter 4 Storage Management (Memory Management).
CIS250 OPERATING SYSTEMS Memory Management Since we share memory, we need to manage it Memory manager only sees the address A program counter value indicates.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming  To allocate scarce memory resources.
Chapter 18 Paging Chien-Chung Shen CIS, UD
CE Operating Systems Lecture 14 Memory management.
PA0 due 60 hours. Lecture 4 Memory Management OSTEP Virtualization CPU: illusion of private CPU RAM: illusion of private memory Concurrency Persistence.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
Operating Systems Lecture 14 Segments Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of Software Engineering.
12/5/20151 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam King,
NETW3005 Memory Management. Reading For this lecture, you should have read Chapter 8 (Sections 1-6). NETW3005 (Operating Systems) Lecture 07 – Memory.
Memory Management Chapter 5 Advanced Operating System.
Chapter 6 Limited Direct Execution Chien-Chung Shen CIS/UD
Chapter 8: Memory Management. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 8: Memory Management Background Swapping Contiguous.
Chapter 18 Paging Chien-Chung Shen CIS/UD
Computer Security: Chapter 5 Operating Systems Security.
CS703 - Advanced Operating Systems By Mr. Farhan Zaidi.
Chapter 7 Memory Management
Non Contiguous Memory Allocation
Virtualization Virtualize hardware resources through abstraction CPU
Segmentation COMP 755.
Memory management.
Chapter 8: Main Memory.
Memory Protection: Kernel and User Address Spaces
CSE 120 Principles of Operating
Chien-Chung Shen CIS/UD
Mechanism: Address Translation
Outline Paging Swapping and demand paging Virtual memory.
Today How was the midterm review? Lab4 due today.
Chien-Chung Shen CIS/UD
PA1 is out Best by Feb , 10:00 pm Enjoy early
x86 segmentation, page tables, and interrupts
Lecture 28: Virtual Memory-Address Translation
Memory Protection: Kernel and User Address Spaces
Memory Management 11/17/2018 A. Berrached:CS4315:UHD.
The Operating System Memory Manager
Multistep Processing of a User Program
CS399 New Beginnings Jonathan Walpole.
Memory Management Tasks
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
Lecture 3: Main Memory.
Computer System Structures
COMP3221: Microprocessors and Embedded Systems
Mechanism: Address Translation
EECE.4810/EECE.5730 Operating Systems
Presentation transcript:

Chapter 15 Address Translation Chien-Chung Shen CIS/UD

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 interrupt), OS retains control over hardware for efficient virtualization (OS is out of the way of application programs most of the time) Mechanism of memory virtualization - goals –efficiency – via hardware support –control – protection between processes via hardware support –flexibility – make system easier to program and to use address space How to efficiently and flexibly virtualize memory?  (hardware-based) address translation

Address Translation Hardware does [virtual address (provided by instruction)  physical address] translation –translate each and every memory reference 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

Example Assumptions: –process’ 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

Interposition for Transparency x = x + 3; 128: movl 0x0(%ebx), %eax 132: addl $0x03, %eax 135: movl %eax, 0x0(%ebx) (virtual) 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 interposes on each memory access, and translates each virtual address issued by the process to a physical address where the desired information is actually stored

Transparent Address Relocation

Dynamic (H/W-based) Relocation Base and bounds registers (parts of Memory management unit (MMU) inside CPU) 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 base register to that value Address translation physical address = virtual address + base What is Bounds for? –protection Happen at runtime

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., movl 1000,%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 ( movl 4000,%eax ) does NOT provide protection Happen at load time

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 (only OS can change them) Exception raised for out-of-bound reference

Limited direct execution with dynamic relocation: OS and hwardware interaction illegal reference

Summary LDE plus address translation –efficiency via hardware –transparent to process Base and bounds: dynamic relocation for virtualization and protection Problem? –internal fragmentation Solution: segmentation