A genda for Today What is memory management Source code to execution Address binding Logical and physical address spaces Dynamic loading, dynamic linking,

Slides:



Advertisements
Similar presentations
Part IV: Memory Management
Advertisements

Mr. D. J. Patel, AITS, Rajkot 1 Operating Systems, by Dhananjay Dhamdhere1 Static and Dynamic Memory Allocation Memory allocation is an aspect of a more.
Basic Memory Management 1. Readings r Silbershatz et al: chapters
CS 311 – Lecture 21 Outline Memory management in UNIX
Modified from Silberschatz, Galvin and Gagne Lecture 16 Chapter 8: Main Memory.
03/09/2007CSCI 315 Operating Systems Design1 Memory Management Notice: The slides for this lecture have been largely based on those accompanying the textbook.
Modified from Silberschatz, Galvin and Gagne Lecture 15 Chapter 8: Main Memory.
MEMORY MANAGEMENT By KUNAL KADAKIA RISHIT SHAH. Memory Memory is a large array of words or bytes, each with its own address. It is a repository of quickly.
A. Frank - P. Weisberg Operating Systems Real Memory Management.
Operating System Concepts
Silberschatz, Galvin and Gagne  Operating System Concepts Multistep Processing of a User Program User programs go through several steps before.
Main Memory. Background Program must be brought (from disk) into memory and placed within a process for it to be run Main memory and registers are only.
03/05/2008CSCI 315 Operating Systems Design1 Memory Management Notice: The slides for this lecture have been largely based on those accompanying the textbook.
CSCI 315 Operating Systems Design
Chapter 91 Memory Management Chapter 9   Review of process from source to executable (linking, loading, addressing)   General discussion of memory.
Chap 8 Memory Management. Background Program must be brought into memory and placed within a process for it to be run Input queue – collection of processes.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 8 Operating Systems.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-7 Memory Management (1) Department of Computer Science and Software.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 8: Main Memory.
Swapping and Contiguous Memory Allocation. Multistep Processing of a User Program User programs go through several steps before being run. Program components.
Lecture 13 L.Mohammad R.Alkafagee1.  The concept of a logical address space that is bound to a separate physical address space is central to proper 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 Memory Management.
8.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Chapter 8: Memory-Management Strategies Objectives To provide a detailed description.
CS 149: Operating Systems February 26 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
Chapter 4 Storage Management (Memory Management).
Operating Systems Memory management. Memory Management List of Topics 1. Memory Management 2. Memory In Systems Design 3. Binding Times 4. Introduction.
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
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.
Background Program must be brought into memory and placed within a process for it to be run. Input queue – collection of processes on the disk that are.
Chapter 10 Memory Management Introduction Process must be loaded into memory before being executed. Input queue – collection of processes on the.
Silberschatz and Galvin  Operating System Concepts Module 8: Memory Management Background Logical versus Physical Address Space Swapping Contiguous.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
Memory. Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation.
Memory Management. Introduction To improve both the utilization of the CPU and the speed of its response to users, the computer must keep several processes.
Main Memory. Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The.
Basic Memory Management 1. Readings r Silbershatz et al: chapters
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Mono an multiprogramming.
CS6502 Operating Systems - Dr. J. Garrido Memory Management – Part 1 Class Will Start Momentarily… Lecture 8b CS6502 Operating Systems Dr. Jose M. Garrido.
Operating Systems Lecture 31.
NETW3005 Memory Management. Reading For this lecture, you should have read Chapter 8 (Sections 1-6). NETW3005 (Operating Systems) Lecture 07 – Memory.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 31 Memory Management.
Memory Management. Background Memory consists of a large array of words or bytes, each with its own address. The CPU fetches instructions from memory.
Background Program must be brought into memory and placed within a process for it to be run. Input queue – collection of processes on the disk that are.
CHAPTER 3-1, 3-2 MEMORY MANAGEMENT. MEMORY HIERARCHY Small amount of expensive, fast, volatile cache Larger amount of still fast, but slower, volatile.
Operating Systems Lecture 31 Syed Mansoor Sarwar.
Memory Management 1. Outline Background Logical versus Physical Address Space Swapping Contiguous Allocation Paging Segmentation 2.
Memory management The main purpose of a computer system is to execute programs. These programs, together with the data they access, must be in main memory.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 8: Main Memory.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition, Chapter 8: Memory- Management Strategies.
Main Memory CSSE 332 Operating Systems Rose-Hulman Institute of Technology.
Chapter 9: Memory Management
SLC/VER1.0/OS CONCEPTS/OCT'99
CSC 322 Operating Systems Concepts Lecture - 12: by
Main Memory Management
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy 11/12/2018.
Memory Management 11/17/2018 A. Berrached:CS4315:UHD.
MEMORY MANAGEMENT & their issues
Chapter 8: Main Memory.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Background Program must be brought into memory and placed within a process for it to be run. Input queue – collection of processes on the disk that are.
Multistep Processing of a User Program
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 12/1/2018.
Memory Management Tasks
Chapter 8: Memory management
Outline Module 1 and 2 dealt with processes, scheduling and synchronization Next two modules will deal with memory and storage Processes require data to.
Lecture 30 Syed Mansoor Sarwar
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
OPERATING SYSTEMS MEMORY MANAGEMENT BY DR.V.R.ELANGOVAN.
Presentation transcript:

A genda for Today What is memory management Source code to execution Address binding Logical and physical address spaces Dynamic loading, dynamic linking, and overlays

Memory Hierarchy  Very small, extremely fast, extremely expensive, and volatile CPU registers  Small, very fast, expensive, and volatile cache  Hundreds of megabytes of medium- speed, medium-price, volatile main memory  Hundreds of gigabytes of slow, cheap, and non-volatile secondary storage

Purpose of Memory Management  To ensure fair, secure, orderly, and efficient use of memory

Memory Management  Keeping track of used and free memory space  When, where, and how much memory to allocate and deallocate  Swapping processes in and out of main memory

Source to Execution Compile/Assemble ↓ Link ↓ Load ↓ Execute

 Binding instructions and data to memory addresses  Compile time  Load time  Execution time A ddress Binding

 Compile time  Compile time: If you know at compile time where the process will reside in memory, the absolute code can be generated. Process must reside in the same memory region for it to execute correctly. A ddress Binding

 Load time  Load time: If the location of a process in memory is not known at compile time, then the compiler must generate re- locatable code. In this case the final binding is delayed until load time. Process can be loaded in different memory regions. A ddress Binding

 Execution time  Execution time: If the process can be moved during its execution from one memory region to another, then binding must be delayed until run time. Special hardware must be available for this to work.

Logical and Physical A ddresses  Logical address: An address generated by the process/CPU; refers to an instruction or data in the process  Physical address: An address for a main memory location where instruction or data resides

Logical and Physical A ddress Spaces  The set of all logical addresses generated by a process comprises its logical address space.  The set of physical addresses corresponding to these logical addresses comprises the physical address space for the process.

Logical and Physical A ddress Spaces  The run-time mapping from logical to physical addresses is done by a piece of the CPU hardware, called the memory management unit (MMU).

Example  The base register is called the relocation register.  The value in the relocation register is added to every address generated by a user process at the time it is sent to memory.

Example Process

Example  In i8086, the logical address of the next instruction is specified by the value of instruction pointer (IP). The physical address for the instruction is computed by shifting the code segment register (CS) left by four bits and adding IP to it.

Example CPU CS * MMU Logical address Physical address

Example  Logical address (16-bit) IP = 0B10h CS = D000h  Physical address (20-bit) CS * IP = D0B10h  Sizes of logical and physical address spaces?

Dynamic Loading  With dynamic loading, a routine is not loaded into the main memory until it is called.  All routines are kept on the disk in a re-locatable format.  The main program is loaded into memory and is executed

Dynamic Loading  Advantages  Potentially less time needed to load a program  Potentially less memory space needed  Disadvantage  Run-time activity

Dynamic Linking  In static linking, system language libraries are linked at compile time and, like any other object module, are combined by the loader into the binary image

Dynamic Linking  In dynamic linking, linking is postponed until run-time.  A library call is replaced by a piece of code, called stub, which is used to locate memory-resident library routine

Dynamic Linking  During execution of a process, stub is replaced by the address of the relevant library code and the code is executed  If library code is not in memory, it is loaded at this time

Dynamic Linking  Advantages  Potentially less time needed to load a program  Potentially less memory space needed  Less disk space needed to store binaries

Dynamic Linking  Disadvantages  Time-consuming run-time activity, resulting in slower program execution  gcc compiler  Dynamic linking by default  -static option allows static linking

What is memory management From source code to execution Address binding Logical and physical address spaces Dynamic loading Dynamic linking