12/5/20151 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam King,

Slides:



Advertisements
Similar presentations
Part IV: Memory Management
Advertisements

MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 3 Memory Management Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Chapter 15 Address Translation Chien-Chung Shen CIS, UD
Memory Management Questions answered in this lecture: How do processes share memory? What is static relocation? What is dynamic relocation? What is segmentation?
CS 311 – Lecture 21 Outline Memory management in UNIX
Operating Systems CMPSCI 377 Lecture 11: Memory Management
Chapter 3 Memory Management
Memory Management 1 CS502 Spring 2006 Memory Management CS-502 Spring 2006.
CS-3013 & CS-502, Summer 2006 Memory Management1 CS-3013 & CS-502 Summer 2006.
Memory ManagementCS-502 Fall Memory Management CS-502 Operating Systems Fall 2006 (Slides include materials from Operating System Concepts, 7 th.
CS 333 Introduction to Operating Systems Class 9 - Memory Management
Memory Management Five Requirements for Memory Management to satisfy: –Relocation Users generally don’t know where they will be placed in main memory May.
CS 333 Introduction to Operating Systems Class 9 - Memory Management Jonathan Walpole Computer Science Portland State University.
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
Memory Management CSE451 Andrew Whitaker. Big Picture Up till now, we’ve focused on how multiple programs share the CPU Now: how do multiple programs.
Paging. Memory Partitioning Troubles Fragmentation Need for compaction/swapping A process size is limited by the available physical memory Dynamic growth.
Review of Memory Management, Virtual Memory CS448.
CS333 Intro to Operating Systems Jonathan Walpole.
COS 598: Advanced Operating System. Operating System Review What are the two purposes of an OS? What are the two modes of execution? Why do we have two.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
Memory Management 1 Tanenbaum Ch. 3 Silberschatz Ch. 8,9.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming  To allocate scarce memory resources.
PA0 due 60 hours. Lecture 4 Memory Management OSTEP Virtualization CPU: illusion of private CPU RAM: illusion of private memory Concurrency Persistence.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
CPS110: Address translation Landon Cox February 19, 2008.
Memory Management Operating Systems CS550. Memory Manager Memory manager - manages allocation and de-allocation of main memory Plays significant impact.
12/18/20151 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam.
Processes and Virtual Memory
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Memory Management Overview.
CPS110: Intro to memory Landon Cox February 14, 2008.
NETW3005 Memory Management. Reading For this lecture, you should have read Chapter 8 (Sections 1-6). NETW3005 (Operating Systems) Lecture 07 – Memory.
Slides created by: Professor Ian G. Harris Operating Systems  Allow the processor to perform several tasks at virtually the same time Ex. Web Controlled.
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.
Memory Management Chapter 5 Advanced Operating System.
3/17/20161 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam King,
6/13/20161 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam King,
6/22/20161 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam King,
6/27/20161 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam King,
W4118 Operating Systems Instructor: Junfeng Yang.
MODERN OPERATING SYSTEMS Third Edition ANDREW S
CS 140 Lecture Notes: Virtual Memory
Paging.
Memory Management.
Virtualization Virtualize hardware resources through abstraction CPU
CSC 322 Operating Systems Concepts Lecture - 12: by
Mechanism: Address Translation
Operating Systems Design (CS 423)
Chien-Chung Shen CIS/UD
PA1 is out Best by Feb , 10:00 pm Enjoy early
Instructors: Haryadi Gunawi
Review: memory and address spaces
Chapter 8: Main Memory.
CS 140 Lecture Notes: Virtual Memory
The Operating System Memory Manager
Main Memory Background Swapping Contiguous Allocation Paging
CS399 New Beginnings Jonathan Walpole.
Introduction to Memory Management
CS 140 Lecture Notes: Virtual Memory
Memory Management Tasks
Chapter 8: Memory management
Memory Management Overview
Lecture Topics: 11/1 General Operating System Concepts Processes
CSE 451: Operating Systems Autumn 2005 Memory Management
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Lecture 7: Flexible Address Translation
CS 140 Lecture Notes: Virtual Memory
Mechanism: Address Translation
EECE.4810/EECE.5730 Operating Systems
Presentation transcript:

12/5/20151 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam King, and Andrew S Tanenbaum

Address Spaces and Memory Process = one or more threads in an address space Thread: stream of execution Unit of concurrency Address space: memory space that threads use Unit of data 12/5/20152

Address Space Abstrac2on Address space: all the memory data Program code, stack, data segment Hardware interface (physical reality) One memory, small, shared Application interface (illusion) Each process has own memory, large 12/5/20153

Illusions Provided by Address Apace Address independence Same address in different processes not conflicting with each other Eg Same address for stack Protection One process cannot access the data of another Secret data, protected code Virtual memory 64 bit address space, memory many 4 G 12/5/20154

Uni ‐ programming One process runs at a time Always load process into the same spot How do you switch processes? What abstractions does this provide? Problems? 12/5/20155 Operating System ROM User Memory

Multi ‐ programming Multi ‐ programming: more than one process in memory at a time Need address translation Need protection Address translation Avoid conflicting addresses Static: before you execute Dynamic: during execution, could change 12/5/20156

Dynamic translation Translate every memory reference from virtual address to physical address Virtual address: an address used by the user process to reference a location in memory Physical address: an address used by the physical memory 12/5/20157

Dynamic Address Translation Translation enforces protection One process can’t even refer to another process’s address space Translation enables virtual memory A virtual address only needs to be in physical memory when it is being accessed Change translations on the fly as different virtual addresses occupy physical memory Do you need hardware support? 12/5/20158 User Process Translator (MMU) Physical Memory Virtual AddPhysical Add

Address translation Lots of ways to implement, remember the big picture Tradeoffs: Flexibility (e.g., sharing, growth, virtual memory) Size of translation data Speed of translation 12/5/20159 User Process Translator (MMU) Physical Memory Virtual AddPhysical Add

Base and Limit Load each process into contiguous regions of physical memory If(virt addr > bound){ trap to kern } else { phys addr = virt addr + base } 12/5/ lim2 lim1 base 1 base2 base1 + lim1 base2 + lim2 virtual mem physical mem

Base and limit What must change during a context switch? Can a process change its own base and limit? Can you share memory with another process? How does the kernel handle the address space growing You are the OS designer, come up with an algorithm for allowing processes to grow 12/5/201511

Memory Allocation in the small 12/5/ virtual mem physical mem virtual mem physical mem virtual mem physical mem virtual mem ?

Memory Management w/ Linked Lists 12/5/ A A B B D D E E F F C C  Info for each hole  Both ends:  Size of hole  Bit saying free or allocated  Together  Next and Previous pointers to other holes  Info for each allocated “chunk:  Size and allocation bit, together, on each end

Memory Allocation Algorithms 12/5/ A A B B D D E E F F C C Allocated 2 units:  First fit A A B B D D E E F F C C A A B B D D E E F F C C G G G G A A B B D D E E F F C C G G  Best fit  Worst fit