Module IV Memory Organization.

Slides:



Advertisements
Similar presentations
Memory.
Advertisements

Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 36 Virtual Memory Read.
Mobile Handset Memory Management
Memory Management Design & Implementation Segmentation Chapter 4.
Chapter 101 Virtual Memory Chapter 10 Sections and plus (Skip:10.3.2, 10.7, rest of 10.8)
Memory Management (II)
Chapter 3.2 : Virtual Memory
Chapter 9 Virtual Memory Produced by Lemlem Kebede Monday, July 16, 2001.
Chapter 91 Translation Lookaside Buffer (described later with virtual memory) Frame.
03/05/2008CSCI 315 Operating Systems Design1 Memory Management Notice: The slides for this lecture have been largely based on those accompanying the textbook.
VIRTUAL MEMORY. Virtual memory technique is used to extents the size of physical memory When a program does not completely fit into the main memory, it.
Memory Management ◦ Operating Systems ◦ CS550. Paging and Segmentation  Non-contiguous memory allocation  Fragmentation is a serious problem with contiguous.
Dr Damitha Karunaratna University of Colombo school of computing
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-7 Memory Management (1) Department of Computer Science and Software.
Cosc 3P92 Week 9 & 10 Lecture slides
1 Memory Management Memory Management COSC513 – Spring 2004 Student Name: Nan Qiao Student ID#: Professor: Dr. Morteza Anvari.
MEMORY MANAGEMENT Presented By:- Lect. Puneet Gupta G.P.C.G. Patiala.
Topics covered: Memory subsystem CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
Computer Architecture Lecture 28 Fasih ur Rehman.
1 Chapter 3.2 : Virtual Memory What is virtual memory? What is virtual memory? Virtual memory management schemes Virtual memory management schemes Paging.
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.
VIRTUAL MEMORY By Thi Nguyen. Motivation  In early time, the main memory was not large enough to store and execute complex program as higher level languages.
SOCSAMS e-learning Dept. of Computer Applications, MES College Marampally VIRTUALMEMORY.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
Chapter 4 Memory Management Virtual Memory.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 9: Virtual Memory.
Memory Management OS Fazal Rehman Shamil. swapping Swapping concept comes in terms of process scheduling. Swapping is basically implemented by Medium.
Virtual Memory Pranav Shah CS147 - Sin Min Lee. Concept of Virtual Memory Purpose of Virtual Memory - to use hard disk as an extension of RAM. Personal.
1 Contents Memory types & memory hierarchy Virtual memory (VM) Page replacement algorithms in case of VM.
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.
Chapter 8: Memory Management. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 8: Memory Management Background Swapping Contiguous.
Virtual Memory Chapter 8.
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Module 9: Memory Management
SLC/VER1.0/OS CONCEPTS/OCT'99
Computer Organization
Memory Management.
Virtual Memory CSSE 332 Operating Systems
Chapter 2 Memory and process management
Chapter 8: Main Memory.
CS703 - Advanced Operating Systems
Chapter 9: Virtual Memory
COMBINED PAGING AND SEGMENTATION
Chapter 8: Main Memory.
Operating System Concepts
O.S Lecture 13 Virtual Memory.
Segmentation Lecture November 2018.
MEMORY MANAGEMENT & their issues
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.
Computer Architecture
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
Main Memory Session - 16.
Chapter 9: Virtual Memory
Lecture 3: Main Memory.
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
Contents Memory types & memory hierarchy Virtual memory (VM)
Chapter 8: Memory Management strategies
Lecture 37 Syed Mansoor Sarwar
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
CSE 542: Operating Systems
Virtual Memory 1 1.
Module IV Memory Organization.
Page Main Memory.
Presentation transcript:

Module IV Memory Organization

Virtual Memory In a virtual memory system, the OS manages the long pro­grams. User programs can be larger than the physical main memory (2GB). OS stores the entire program on a hard disk whose capacity is much larger than the physical memory size.

Virtual Memory At a given time, only some portions of the program are brought into the main memory from the hard disk. As and when needed, a portion which is not in main memory is taken from the hard disk, and at the same time, a portion of the program which is present is released out of the main memory and stored on the hard disk. This process is known as swapping. In a virtual memory system, when a program is executed, swapping is performed as per the require­ment on a continuous basis.

Virtual Memory

Virtual Memory The CPU fetches instruction and data from the main memory. Whenever the required instruction or data is not present in main memory, the hardware raises an interrupt known as virtual memory interrupt or page fault. In response, the operating system loads a section of the program (containing the required instruction or data) from the hard disk drive to the main memory. The page fault occur within an instruction cycle. After the page fault interrupt is serviced, the CPU will continue processing the partially executed instruction.

Virtual Memory

Advantages of Virtual Memory Program size is not limited by physical memory size. User do not have to do memory allocation. Main memory allocation is done automatically according to the demands of the program. Program can be loaded in any area of physical memory It allows processes to share files easily.

Virtual Memory It is implemented using two techniques: Segmentation Paging

Segmentation This memory management technique supports user’s view of memory.

User’s view of a program

Segmentation Users prefer to view memory as a collection of variable-sized segments : Code : to store program Data : variables defined by the code are stored Stack : Used by sub-routines and interrupt service routines to hold temporary data and addresses.

Segmentation All applications need to be loaded into main memory before they can be executed. In order to do so, a temporary 'segment' is created by the memory manager

A typical segment

Segmentation There can be many segments in memory at the same time. Each one is a separate process or application and each may be a different size

Segmentation Segmentation allows the OS to do is to place each one of those segments in different parts of physical memory.

Segmentation

Segmentation In segmentation, a memory reference includes a value that identifies a segment (segment number) and an offset within that segment. A segment is associated with a flag indicating whether it is present in main memory or not information indicating where the segment is located in memory(the address of the first location in the segment)(base address) has a set of permissions Length

Segmentation If the segment is not present in main memory, an exception is raised and the OS will read the segment into memory from secondary storage.

Segmentation If a reference to a location within a segment is made, Physical address = base address +offset A memory management unit (MMU) is responsible for translating a segment and offset (logical address) into a memory address, checking to make sure the translation can be done and that the reference to that segment and offset is permitted.

Segmentation The mapping is done with help of segment table. Logical address consists of two parts: a segment number s, and offset d s is used as an index to the segment table. Each entry of segment table has base and limits. base contains starting physical address where resides in memory limit specifies length of the segments d must be between 0 and the segment limit. If not, it traps to addressing error If offset is valid, it is added to base to produce physical address

Segmentation: Hardware

Example