Computer Organization Cs 147 Prof. Lee Azita Keshmiri.

Slides:



Advertisements
Similar presentations
Memory.
Advertisements

16.317: Microprocessor System Design I
Segmentation and Paging Considerations
Allocating Memory.
Memory Management (II)
Memory Management and Paging CSCI 3753 Operating Systems Spring 2005 Prof. Rick Han.
Multiprocessing Memory Management
CS 104 Introduction to Computer Science and Graphics Problems
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.2 : Virtual Memory
1 Chapter 8 Virtual Memory Virtual memory is a storage allocation scheme in which secondary memory can be addressed as though it were part of main memory.
Chapter 9 Virtual Memory Produced by Lemlem Kebede Monday, July 16, 2001.
Computer Organization and Architecture
Virtual Memory I Chapter 8.
Chapter 91 Translation Lookaside Buffer (described later with virtual memory) Frame.
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.
Virtual Memory By: Dinouje Fahih. Definition of Virtual Memory Virtual memory is a concept that, allows a computer and its operating system, to use a.
Virtual Memory Chantha Thoeun. Overview  Purpose:  Use the hard disk as an extension of RAM.  Increase the available address space of a process. 
Lecture 21 Last lecture Today’s lecture Cache Memory Virtual memory
SOCSAMS e-learning Dept. of Computer Applications, MES College Marampally MEMORYMANAGEMNT.
Topics covered: Memory subsystem CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
Computer Architecture Lecture 28 Fasih ur Rehman.
Cosc 2150: Computer Organization Chapter 6, Part 2 Virtual Memory.
1 Chapter 3.2 : Virtual Memory What is virtual memory? What is virtual memory? Virtual memory management schemes Virtual memory management schemes Paging.
IT253: Computer Organization
Memory Management. Roadmap Basic requirements of Memory Management Memory Partitioning Basic blocks of memory management –Paging –Segmentation.
Fall 2000M.B. Ibáñez Lecture 17 Paging Hardware Support.
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.
CS 149: Operating Systems March 3 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
Fundamentals of Programming Languages-II Subject Code: Teaching SchemeExamination Scheme Theory: 1 Hr./WeekOnline Examination: 50 Marks Practical:
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
Virtual Memory 1 1.
1 Memory Management. 2 Fixed Partitions Legend Free Space 0k 4k 16k 64k 128k Internal fragmentation (cannot be reallocated) Divide memory into n (possible.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
Operating Systems Unit 7: – Virtual Memory organization Operating Systems.
Swap Space and Other Memory Management Issues Operating Systems: Internals and Design Principles.
Introduction: Memory Management 2 Ideally programmers want memory that is large fast non volatile Memory hierarchy small amount of fast, expensive memory.
Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.
Informationsteknologi Wednesday, October 3, 2007Computer Systems/Operating Systems - Class 121 Today’s class Memory management Virtual memory.
Copyright ©: Nahrstedt, Angrave, Abdelzaher, Caccamo 1 Memory management & paging.
Memory Management Continued Questions answered in this lecture: What is paging? How can segmentation and paging be combined? How can one speed up address.
Lectures 8 & 9 Virtual Memory - Paging & Segmentation System Design.
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.
Operating Systems Session 7: – Virtual Memory organization Operating Systems.
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.
CS203 – Advanced Computer Architecture Virtual Memory.
Virtual Memory By CS147 Maheshpriya Venkata. Agenda Review Cache Memory Virtual Memory Paging Segmentation Configuration Of Virtual Memory Cache Memory.
Virtual Memory (Section 9.3). The Need For Virtual Memory Many computers don’t have enough memory in RAM to accommodate all the programs a user wants.
CS161 – Design and Architecture of Computer
Computer Organization
Memory Management.
Chapter 2 Memory and process management
Chapter 8: Main Memory.
CS161 – Design and Architecture of Computer
CSI 400/500 Operating Systems Spring 2009
Chapter 8: Main Memory.
Operating System Concepts
Computer Architecture
Main Memory Background Swapping Contiguous Allocation Paging
CPSC 457 Operating Systems
Lecture 3: Main Memory.
Virtual Memory Virtual memory is a technique which gives an application program the impression that it has contiguous working memory, while in fact it.
Contents Memory types & memory hierarchy Virtual memory (VM)
Chapter 8: Memory Management strategies
COMP755 Advanced Operating Systems
Operating Systems: Internals and Design Principles, 6/E
Virtual Memory 1 1.
Page Main Memory.
Presentation transcript:

Computer Organization Cs 147 Prof. Lee Azita Keshmiri

Virtual memory What is virtual memory? - A memory management unit that swaps data in and out of physical memory. - virtual memory makes it appear to the CPU that there is more physical memory than is actually presents.

Virtual Memory How does virtual memory works? - Virtual memory uses auxiliary storage, such as a disk, to expand the memory space available to the processor. To understand how virtual memory works, compare it to cache memory.

Cache memory A cache memory works by moving data to and from physical memory. When the CPU request data that is stored in cache, it receives this data faster than if it had to retrieve the data from physical memory.

Virtual memory and physically indexed caches Cache page frames. notion of bin -region of cache that may contain cache blocks from a page. - random vs careful mapping -selection of physical page frame dictates cache index. - overall goal is to minimize cache misses

Virtual memory A virtual memory system may use paging or segmentation. A paging system moves frames of fixed size between physical memory and virtual memory.

Virtual Memory Organization The virtual address space is divided into pieces of the same size Main memory is divided into pieces of the same size as pages called page frames. real memory virtual address space Page Page 6 page0 Page 2 Page 0 Page 1 Page 2 Page 3 Page Page 5 Page 6

Virtual Memory Memory that a single process “sees” - for example: 4 GB/process Real/physi cal memory Process 1 Process 2

memory management unit (MMU) A memory management unit moves data between physical memory and some slower storage device, usually a disk. This storage area may be referred to as a swap disk or swap file, depending on its implementation.

Paging In paging, the entire range of logical addresses those addresses that can be output by the CPU, is divided into blocks called pages. Each page is the same size. each logical address takes exactly one page.

Paging -1 Paging moves pages from the swap disk to frames of the physical memory so data can be accessed by the processor. Any page can occupy any frame. A page is small enough to fit in main memory.

Practical paging: Segmentation Based on the observation the most processes use only a small portion of the 4 GB addr space. Segmentation: partition the address space into large manageable chunks. Segment # page # offset Phy Addr. Index 4 Segment table page table

One possible memory configuration for the Relatively Simple CPU Address Space Physical memory Page F. Page 2 Page 1 Page 0 Frame 3 Frame 2 Frame 1 Frame 0

frames Physical memory is divided into non overlapping frames. the size of each frame is the same as the size of one page.

Page fault If the data is not located in physical memory,it generate a page fault and moves the page from the swap disk to a frame. - removes another page if necessary.

MMU configuration within the memory hierarchy CPU MMU Physical Memory Swap Disk logical address Physica l address control signals

Memory Hierarchy Memory is used to store programs and data. The lowest level of the memory hierarchy is a small, fast and costly memory called cache, usually implemented by static RAM chips. - primary Cache is located on the CPU chip. - Secondary cache is placed between the primary cache and main memory.

Memory Hierarchy(cont) Main Memory can be built by tens of megabytes at a reasonable cost. The affordable size is still small compared to the demands of very large programs.

Memory hierarchy The memory hierarchy of most computer systems includes not only physical memory, but also cache and virtual memory. Cache memory is a high-speed memory situated between the CPU and physical memory. - one level of cache is often located within the CPU chip.

Segmentation Segmentation is another method of allocating memory that can be used instead of or in conjunction with paging. A program is divided into several segments, each of which is a self- contained unit, such as a subroutine or data structure.

Segmentation-1 A segmented memory management unit (MMU) includes a segment table to keep track of the segments resident in memory. Since a segment can start at one of many addresses and can be of any size. each segment table entry must include the start address and segment size.

Memory management unit A memory management unit maps the logical addresses issued by the processor to their corresponding physical addresses.

Memory management unit The memory management unit uses page tables and translation look aside buffers to keep track of which frame corresponds.

Page tables Virtual page Hash table 1 entry per Page frame Full table: 1 entry Per page Page frame # index hash

Conversion of logical address to physical address using segmentation segmentoffset Segment table compare + Out of bounds Error (if offset >= size) Physical memory address Fault (if not in memory) Logical Address: size Address of Start of segment

Internal fragmentation In the paged memory implementation, each page is of size 4k. A program of size 4k+1 would require the memory management unit (MMU) to allocate two pages of memory, even though the second page would use only one of its 4k locations. This is referred to as internal fragmentation.

Protection bits A preferable option is to protect the segment or page, rather than individual locations. This produces the desired memory protection at an acceptable cost in terms of overhead. To accomplish this, protection bits are added to each entry in the segment or page table.

Page directory The Pentium microprocessor can use either segmentation or paging. the windows NT virtual memory manager uses paging. The 10 high-order bits of the 32-bit virtual address select an entry in the page directory, which is stored in physical memory.

THE END