CS 300 – Lecture 22 Intro to Computer Architecture / Assembly Language Virtual Memory.

Slides:



Advertisements
Similar presentations
May 7, A Real Problem  What if you wanted to run a program that needs more memory than you have?
Advertisements

Computer Organization CS224 Fall 2012 Lesson 44. Virtual Memory  Use main memory as a “cache” for secondary (disk) storage l Managed jointly by CPU hardware.
1 A Real Problem  What if you wanted to run a program that needs more memory than you have?
Memory Management Norman White Stern School of Business.
Architectural Support for OS March 29, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
Memory Design Example. Selecting Memory Chip Selecting SRAM Memory Chip.
Operating System Support Focus on Architecture
Multiprocessing Memory Management
Disco Running Commodity Operating Systems on Scalable Multiprocessors.
CS 300 – Lecture 20 Intro to Computer Architecture / Assembly Language Caches.
Chapter 3.2 : Virtual Memory
Virtual Memory. Why do we need VM? Program address space: 0 – 2^32 bytes –4GB of space Physical memory available –256MB or so Multiprogramming systems.
CS 300 – Lecture 23 Intro to Computer Architecture / Assembly Language Virtual Memory Pipelining.
©UCB CS 162 Ch 7: Virtual Memory LECTURE 13 Instructor: L.N. Bhuyan
Computer Organization and Architecture
Virtual Memory Deung young, Moon ELEC 5200/6200 Computer Architecture and Design Lectured by Dr. V. Agrawal Lectured by Dr. V.
EECE476: Computer Architecture Lecture 27: Virtual Memory, TLBs, and Caches Chapter 7 The University of British ColumbiaEECE 476© 2005 Guy Lemieux.
CS364 CH08 Operating System Support TECH Computer Science Operating System Overview Scheduling Memory Management Pentium II and PowerPC Memory Management.
Layers and Views of a Computer System Operating System Services Program creation Program execution Access to I/O devices Controlled access to files System.
Computer Organization and Architecture Operating System Support Chapter 8.
Computer Organization
Review of Memory Management, Virtual Memory CS448.
Chapter 5 Operating System Support. Outline Operating system - Objective and function - types of OS Scheduling - Long term scheduling - Medium term scheduling.
Virtual Memory CS Introduction to Operating Systems.
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 – Page 1 of 49CSCI 4717 – Computer Architecture Memory Management Uni-program – memory split into two parts –One for Operating System.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming  To allocate scarce memory resources.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui COMP 203 / NWEN 201 Computer Organisation / Computer Architectures Virtual.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-8 Memory Management (2) Department of Computer Science and Software.
Computers Operating System Essentials. Operating Systems PROGRAM HARDWARE OPERATING SYSTEM.
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.
1 Some Real Problem  What if a program needs more memory than the machine has? —even if individual programs fit in memory, how can we run multiple programs?
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 CSE451 Architectural Supports for Operating Systems Autumn 2002 Gary Kimura Lecture #2 October 2, 2002.
4.3 Virtual Memory. Virtual memory  Want to run programs (code+stack+data) larger than available memory.  Overlays programmer divides program into pieces.
ICOM Noack Memory management Virtual memory Paging and segmentation Demand paging Memory management hardware.
CS2100 Computer Organisation Virtual Memory – Own reading only (AY2015/6) Semester 1.
Protection of Processes Security and privacy of data is challenging currently. Protecting information – Not limited to hardware. – Depends on innovation.
Copyright © 2007 by Curt Hill Interrupts How the system responds.
CS203 – Advanced Computer Architecture Virtual Memory.
CS161 – Design and Architecture of Computer
Virtual Memory So, how is this possible?
Vivek Seshadri 15740/18740 Computer Architecture
ECE232: Hardware Organization and Design
Memory COMPUTER ARCHITECTURE
Process Management Process Concept Why only the global variables?
CS161 – Design and Architecture of Computer
Memory Caches & TLB Virtual Memory
A Real Problem What if you wanted to run a program that needs more memory than you have? September 11, 2018.
CS703 - Advanced Operating Systems
Paging COMP 755.
Some Real Problem What if a program needs more memory than the machine has? even if individual programs fit in memory, how can we run multiple programs?
Chapter 9 – Real Memory Organization and Management
William Stallings Computer Organization and Architecture
Lecture 28: Virtual Memory-Address Translation
CS399 New Beginnings Jonathan Walpole.
Morgan Kaufmann Publishers Memory Hierarchy: Virtual Memory
CSE 451: Operating Systems Autumn 2005 Memory Management
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
CSE451 Virtual Memory Paging Autumn 2002
Virtual Memory Prof. Eric Rotenberg
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Cache writes and examples
4.3 Virtual Memory.
Presentation transcript:

CS 300 – Lecture 22 Intro to Computer Architecture / Assembly Language Virtual Memory

Homework Questions!

The Bad Old Days Applications were directly coupled to the physical memory of the computer. If you wanted to run something, you would load the program you want and run it until it stops, then load a new program. Each program used the same physical memory addresses.

The Worse Old Days The original PCs were based on an architecture with no memory management at all. The solution was a "segmented" memory design. This pervaded the original PC architecture (hardware AND software). Even though segments allowed bigger programs to run they didn't prevent applications from interfering with each other. Nobody cried the day DOS died. Finally, with the Pentium, real memory management was possible!

About Virtual Memory Virtual Memory is another level of caching that sits between the disk and the main memory. While cache is exclusively a hardware issue, VM is handled in both hardware and operating system. That is, many of the things that are done in hardware in the cache can be addressed in software in the VM context.

Virtual Memory Issues What problems are virtual memory hardware trying to solve? * Multiple programs running at once * Limited supply of physical memory * Hardware enforcement of capabilities (security) * Safe sharing among applications * Ability to "route around" hardware faults in physical memory

VM Ideas Memory is divided into "pages". Pentium uses 1K words (4k bytes) per page. Addresses in your code are "virtual" – these are turned into physical addresses by a page table. The OS is responsible for the page table. ALL addresses are translated through this table (really indirection) The page table (or segment table) has other info: privileges, "Present" bit. The "swap file" is where VM pages are parked when rolled out of memory

Big Ideas in VM Enforce privileges in hardware – keep user code from accessing devices or other things that would allow processes to interfere with each other. Read-only pages: prevent immutable data from accidental modification Copy on write: allow pages to be shared or live outside swap space if not written on. Protection: use VM to detect conditions like stack overflow cheaply The page table defines the amount of memory available to a process.

The TLB Bad news: every memory access needs to go through the page table Good news: we can cache page table information so that there's no overhead to most address translation. Yet another cache is used to keep address translation from going too slow.

How Big is the Page Table? Pentium: 32 bit address – 12 for the address in the table so that leaves 20 bits (1 million). That means a page table would be > 4 megabytes! To fix this problem, the Pentium uses a two level table (page table of page tables)

Pentium Paging

Page Faulting Anytime an instruction references memory that is "paged out" (this is what the "P" bit is for in the page table) you have to stop the program and wait for a disk read. This is MUCH more expensive than a cache miss! This is an interrupt, similar to an IO interrupt Poor program performance is usually a result of too many page misses.