Review: Program Memory Addresses Program addresses are fixed at the time the source file is compiled and linked يتم إصلاحها عناوين البرنامج في الوقت يتم.

Slides:



Advertisements
Similar presentations
Part IV: Memory Management
Advertisements

Memory Protection: Kernel and User Address Spaces  Background  Address binding  How memory protection is achieved.
ITEC 352 Lecture 25 Memory(3). Review Questions RAM –What is the difference between register memory, cache memory, and main memory? –What connects the.
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.
Operating Systems Lecture Notes Memory Management Matthew Dailey Some material © Silberschatz, Galvin, and Gagne, 2002.
ITEC 352 Lecture 27 Memory(4). Review Questions? Cache control –L1/L2  Main memory example –Formulas for hits.
Basic Memory Management 1. Readings r Silbershatz et al: chapters
Memory Management Chapter 7.
03/09/2007CSCI 315 Operating Systems Design1 Memory Management Notice: The slides for this lecture have been largely based on those accompanying the textbook.
CS 104 Introduction to Computer Science and Graphics Problems
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.
Memory Management Chapter 5.
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.
Lecture 9: SHELL PROGRAMMING (continued) Creating shell scripts!
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.
03/05/2008CSCI 315 Operating Systems Design1 Memory Management Notice: The slides for this lecture have been largely based on those accompanying the textbook.
Chapter 91 Memory Management Chapter 9   Review of process from source to executable (linking, loading, addressing)   General discussion of memory.
Operating System Chapter 7. Memory Management Lynn Choi School of Electrical Engineering.
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.
1 Memory Management Memory Management COSC513 – Spring 2004 Student Name: Nan Qiao Student ID#: Professor: Dr. Morteza Anvari.
Memory Management. Process must be loaded into memory before being executed. Memory needs to be allocated to ensure a reasonable supply of ready processes.
A genda for Today What is memory management Source code to execution Address binding Logical and physical address spaces Dynamic loading, dynamic linking,
8.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Chapter 8: Memory-Management Strategies Objectives To provide a detailed description.
Chapter 4 Storage Management (Memory Management).
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 8 – Main Memory (Pgs ). Overview  Everything to do with memory is complicated by the fact that more than 1 program can be in memory.
© 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.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
Memory Management Operating Systems CS550. Memory Manager Memory manager - manages allocation and de-allocation of main memory Plays significant impact.
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.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
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
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.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 31 Memory Management.
COMP091 – Operating Systems 1 Memory Management. Memory Management Terms Physical address –Actual address as seen by memory unit Logical address –Address.
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 3-1, 3-2 MEMORY MANAGEMENT. MEMORY HIERARCHY Small amount of expensive, fast, volatile cache Larger amount of still fast, but slower, volatile.
Slide 11-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 11.
Operating Systems Lecture 31 Syed Mansoor Sarwar.
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.
Chapter 8: Memory Management. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 8: Memory Management Background Swapping Contiguous.
Binding & Dynamic Linking Presented by: Raunak Sulekh(1013) Pooja Kapoor(1008)
Main Memory CSSE 332 Operating Systems Rose-Hulman Institute of Technology.
SLC/VER1.0/OS CONCEPTS/OCT'99
Chapter 8: Main Memory.
Chapter 8 Main Memory.
Main Memory Management
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
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.
Main Memory Background Swapping Contiguous Allocation Paging
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.
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.
Chapter 7 Memory Management
Presentation transcript:

Review: Program Memory Addresses Program addresses are fixed at the time the source file is compiled and linked يتم إصلاحها عناوين البرنامج في الوقت يتم ترجمة الملف المصدر وترتبط Small, simple systems can use program addresses as the physical address in memory يمكن، أنظمة بسيطة صغيرة تستخدم عناوين البرنامج كما العنوان الفعلي في الذاكرة Modern systems usually much more complex النظم الحديثة عادة أكثر تعقيدا – program address space very large – other programs running at the same time – operating system is in memory too

Absolute Code Compile time: if it can be known in advance the starting address of a program in memory, then absolute code can be generated..com-format programs (MSDOS) Output: a.exe, a.o, or an object module Q:In a multiprogrammed environment, can I run two of these synchronously? Q: Can I relocate this code (say, to coalesce memory gaps when dealing with fragmentation)

heap program stack physical memory heap program stack heap program stack program addresses physical addresses memory mapping disk Memory Mapping

Address Binding Symbolic Addresses Relocatable Code Absolute Code Loader produces the final address binding(no dynamic relocation) Run-time environment produces the final address binding (with dynamic relocation)

Intro to Address Bindings Compiler/assembler Symbolic -> Absolute Symbolic -> Relocatable Loader Relocatable-> final binding Runtime environment Relocatable-> final binding

Address Transformations Load Time Loader: ties in other libraries and… If we couldn’t deduce our starting address statically, our compiler would generate instead relocatable code “14 bytes from the beginning of this file” All address bindings would be delayed until loading, at which point a starting offset defines every address in the program (like absolute).

Final Address Binding Done at runtime Rather than x, which is our second word in the data section, we might call it “+4bytes from start” If the starting address isn’t known in advance, then the relocatable->logical binding is delayed… Binding at run time, if to be dynamically relocated during execution This more complex binding scheme is the only in which the logical address space and the physical address space differ!

Relocatable Code An O.S. today will dynamically relocate processes from one section of the memory space to another. نظام التشغيل سوف يقوم تلقائيا بتغيير مكان العملية من قسم فالذاكرة لقسم اخر Delay binding of the relocatable addresses till runtime تأخير ربط عناوين المنقولة حتى وقت التشغيل Addresses up to this stage will be in some intermediary form, and then will be bound dynamically العناوين تصل إلى هذه المرحلة ستكون في شكل وسيط، وبعد ذلك سوف تكون ملزمة تلقائياُ MS-DOS, x86: 4 relocation registers

swapping Swapping may be used to increase the number of processes sharing the Cpu. In addition to the processes stored in the main memory, one or more processes may be temporarily copied out of memory to a backing store. As space becomes available in main memory (possibly because a process is swapped out explicitly to make room for a process to be swapped in), swapped-out processes may be returned to memory. To execute on the CPU, a process must be in main memory. Decisions on which process to swap out and which process to swap in are made by the operating system's process scheduler. عملية التبادل تستخدم لزيادة عدد العمليات المعالجة في المعالج والمخزنة في الذاكرة الرئيسية عملية او عمليتين ربما يخزنون خارج ئاكرة المعالج وبمجرد وجود مساحة يتم إستبدال العملية القديمة بالجديدة ويجب للعملية كي تتم ان تكون داخل ذاكرة المعالج

overlaying In all the previous memory management schemes, the amount of memory available to a process is limited by the amount of physical memory. Overlaying allows a process to execute despite the system having insufficient physical memory. Theprogrammer defines two or more overlay segments within the program such that no two overlay segments need be in the operating systemwould then manage swapping overlay segments, reducing the amount of physical memory required by the program.The major disadvantage of overlaying is the extensive programmer involvement in the process. Identifying overlay segments is neither a simple nor a reliable process. A far superior solution is to use a memory management scheme that frees the user from the limitations of physical memory. Such systems are called virtual memory at the same time. في كل المخططات السابقة لإدارة الذاكرة، مقدار الذاكرة المتاحة لعملية محدودة بسبب مقدار الذاكرة الفعلية. تغشية تسمح عملية لتنفيذ الرغم من وجود نظام الذاكرة الفعلية غير كافية. يعرف مبرمج اثنين أو أكثر من شرائح تراكب ضمن برنامج من هذا القبيل أن لا جزأين تراكب ضرورة أن يكون في نظام التشغيل عندئذ إدارة مبادلة قطاعات تراكب، وتقليل كمية من الذاكرة الفعلية التي يتطلبها العيب الرئيسي من تغشية هو مبرمج واسعة النطاق تورط في هذه العملية. تحديد قطاعات تراكب ليست بسيطة ولا عملية يمكن الاعتماد عليها. وهناك حل أفضل بكثير لاستخدام نظام إدارة الذاكرة التي تطلق المستخدم من القيود المفروضة على الذاكرة الفعلية. ويطلق على هذه الأنظمة الذاكرة الظاهرية في نفس الوقت.