Chapter 8: Main Memory.

Slides:



Advertisements
Similar presentations
Part IV: Memory Management
Advertisements

Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Lecture 13: Main Memory (Chapter 8)
Chapter 7 Memory Management Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2009, Prentice.
Modified from Silberschatz, Galvin and Gagne Lecture 16 Chapter 8: Main Memory.
Module 3.0: Memory Management
CS 104 Introduction to Computer Science and Graphics Problems
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 8: Main Memory.
Memory Management Chapter 5.
Modified from Silberschatz, Galvin and Gagne Lecture 15 Chapter 8: Main Memory.
A. Frank - P. Weisberg Operating Systems Real Memory Management.
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.
Chapter 8: Main Memory.
Chapter 91 Memory Management Chapter 9   Review of process from source to executable (linking, loading, addressing)   General discussion of memory.
Chapter 8: Main Memory. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 8: Memory Management Background Swapping Contiguous.
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 Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Dr.
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).
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Memory Management. Roadmap Basic requirements of Memory Management Memory Partitioning Basic blocks of memory management –Paging –Segmentation.
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.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
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
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 31 Memory Management.
Memory Management Program must be brought (from disk) into memory and placed within a process for it to be run Main memory and registers are only storage.
1 Memory Management n In most schemes, the kernel occupies some fixed portion of main memory and the rest is shared by multiple processes.
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.
Main Memory CSSE 332 Operating Systems Rose-Hulman Institute of Technology.
Chapter 7 Memory Management
Memory Management Chapter 7.
SLC/VER1.0/OS CONCEPTS/OCT'99
Memory Management.
Chapter 2 Memory and process management
CSC 322 Operating Systems Concepts Lecture - 12: by
Real Memory Management
Chapter 8: Main Memory.
Chapter 8 Main Memory.
Main Memory Management
Chapter 8: Main Memory.
Economics, Administration & Information system
Operating System Concepts
Memory Management 11/17/2018 A. Berrached:CS4315:UHD.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Main Memory Session -15.
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.
So far… Text RO …. printf() RW link printf Linking, loading
Memory Management-I 1.
Main Memory Background Swapping Contiguous Allocation Paging
Memory Management Chapter 7.
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.
Operating System Chapter 7. Memory Management
Chapter 8: Memory Management strategies
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
Lecture 3: Main Memory.
OPERATING SYSTEMS MEMORY MANAGEMENT BY DR.V.R.ELANGOVAN.
Page Main Memory.
Presentation transcript:

Chapter 8: Main Memory

Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The Intel Pentium

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 storage CPU can access directly Register access in one CPU clock (or less) Main memory can take many cycles Cache sits between main memory and CPU registers Protection of memory required to ensure correct operation

Base and Limit Registers A pair of base and limit registers define the logical address space

Hardware Address Protection with Base and Limit Registers

Memory management Memory management and CPU scheduling are perhaps the two most central tasks of an OS Memory consists of a large array of words , each with its own address. Both program and data are stored in memory . Memory is given an address and it returns value .

Logical vs. Physical Address Space The concept of a logical address space that is bound to a separate physical address space is central to proper memory management Logical address – generated by the CPU; also referred to as virtual address Physical address – address seen by the memory unit Logical and physical addresses are the same in compile-time and load-time address-binding schemes; logical (virtual) and physical addresses differ in execution-time address-binding scheme

Memory-Management Unit (MMU) Hardware device that maps virtual to physical address In MMU scheme, the value in the relocation register is added to every address generated by a user process at the time it is sent to memory The user program deals with logical addresses; it never sees the real physical addresses

Dynamic relocation using a relocation register

Swapping A process needs to be in memory to be executed . * however , it may be temporarily swapped out of memory into a backing store . * the process can later be restarted by swapping it back into memory . * Backing is generally a fast disk. Speed is important . Swapping example :- When a process block or timeout:- 1- swap it out to disk 2- swap in anew (ready ) process from disk to memory 3- dispatch the new process . Another example :- roll out , roll in

Schematic View of Swapping

Memory Management Requirements Relocation Programmer cannot know where the program will be loaded in memory when it is executed A program may be relocated (often) in main memory due to swapping Memory references in code (for both instructions and data) must be translated to actual physical memory addresses Chapter 9

Memory Management Requirements Protection Processes should not reference memory locations in another process without permission Cannot do this at compile time, because we do not know where the program will be loaded in memory address references must be checked at run time by hardware Chapter 9

Memory Management Requirements Sharing must allow several processes to access a common portion of data or program without compromising protection cooperating processes may need to share access to the same data structure Program text can be shared by several processes executing the same program for a different user Saves memory over separate copy for each Chapter 9

Memory Management Requirements Physical Organization Memory hierarchy: (several types of memory: from slow and large to small and fast.) main memory for program and data currently in use, secondary memory is the long term store for swapping and paging moving information between levels of memory is a major concern of memory and file management (OS) should be transparent to the application programmer Chapter 9

Simple Memory Management We will look at the following simple memory management techniques : fixed partitioning dynamic partitioning Chapter 9

Fixed Partitioning (Single Process) If only one process allowed (e.g. MS-DOS): only one user partition and one for the OS Not many decisions to make: program either fits or it doesn’t I/O and Interrupt vectors “OperatingSystem” (BIOS) User space 640k Chapter 9

Fixed Partitioning Partition main memory into a set of non overlapping regions called partitions Partitions can be of equal or unequal sizes ..both pictures show partitioning of 64 Mmain memory Chapter 9

any program smaller than a partition can be loaded into the partition Fixed Partitioning any program smaller than a partition can be loaded into the partition if all partitions are occupied, the operating system can swap a process out of a partition to make room a program may be too large to fit in a partition. Chapter 9

Fixed Partitioning Main memory use is inefficient. Any program, no matter how small, occupies an entire partition. This leaves holes of unused memory inside the partitions: internal fragmentation. Unequal-size partitions can help put small programs in small partitions but there will still be holes... Equal-size partitions was used in early IBM’s OS/MFT (Multiprogramming with a Fixed number of Tasks) Chapter 9

Fixed Partitioning Examples