Project 3 Design Considerations SECTION… 6? 5? 7?.

Slides:



Advertisements
Similar presentations
Memory.
Advertisements

CSCC69: Operating Systems
Memory Management (II)
Memory Management and Paging CSCI 3753 Operating Systems Spring 2005 Prof. Rick Han.
1 Virtual Memory vs. Physical Memory So far, all of a job’s virtual address space must be in physical memory However, many parts of programs are never.
Translation Buffers (TLB’s)
Memory Management 1 CS502 Spring 2006 Memory Management CS-502 Spring 2006.
CS-3013 & CS-502, Summer 2006 Memory Management1 CS-3013 & CS-502 Summer 2006.
Memory Management April 28, 2000 Instructor: Gary Kimura.
11/10/2005Comp 120 Fall November 10 8 classes to go! questions to me –Topics you would like covered –Things you don’t understand –Suggestions.
CS 241 Section Week #12 (04/22/10).
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
Segmentation CS 537 – Introduction to Operating Systems.
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
CS 346 – Chapter 8 Main memory –Addressing –Swapping –Allocation and fragmentation –Paging –Segmentation Commitment –Please finish chapter 8.
Lecture 21 Last lecture Today’s lecture Cache Memory Virtual memory
Chapter 8 Memory Management Dr. Yingwu Zhu. Outline Background Basic Concepts Memory Allocation.
Computer Architecture Lecture 28 Fasih ur Rehman.
COS 598: Advanced Operating System. Operating System Review What are the two purposes of an OS? What are the two modes of execution? Why do we have two.
Operating Systems ECE344 Ding Yuan Paging Lecture 8: Paging.
Lecture Topics: 11/17 Page tables TLBs Virtual memory flat page tables
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.
Virtual Memory Additional Slides Slide Source: Topics Address translation Accelerating translation with TLBs class12.ppt.
Review °Apply Principle of Locality Recursively °Manage memory to disk? Treat as cache Included protection as bonus, now critical Use Page Table of mappings.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Demand Paging.
Lecture 26 Virtual Machine Monitors. Virtual Machines Goal: run an guest OS over an host OS Who has done this? Why might it be useful? Examples: Vmware,
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Virtual Memory Implementation.
Lectures 8 & 9 Virtual Memory - Paging & Segmentation System Design.
LECTURE 12 Virtual Memory. VIRTUAL MEMORY Just as a cache can provide fast, easy access to recently-used code and data, main memory acts as a “cache”
3/1/2002CSE Virtual Memory Virtual Memory CPU On-chip cache Off-chip cache DRAM memory Disk memory Note: Some of the material in this lecture are.
Chapter 7: Main Memory CS 170, Fall Program Execution & Memory Management Program execution Swapping Contiguous Memory Allocation Paging Structure.
Chapter 9 Memory Organization. 9.1 Hierarchical Memory Systems Figure 9.1.
Translation Lookaside Buffer
Lecture 11 Virtual Memory
Memory Management.
Memory Caches & TLB Virtual Memory
Virtual Memory User memory model so far:
Section 9: Virtual Memory (VM)
Memory Hierarchy Virtual Memory, Address Translation
CS510 Operating System Foundations
Chapter 8: Main Memory.
Lecture 28: Virtual Memory-Address Translation
CSCI206 - Computer Organization & Programming
Virtual Memory 3 Hakim Weatherspoon CS 3410, Spring 2011
Operating System Concepts
Virtual Memory 4 classes to go! Today: Virtual Memory.
Module IV Memory Organization.
Main Memory Background Swapping Contiguous Allocation Paging
Translation Lookaside Buffer
Lecture 3: Main Memory.
CSE451 Memory Management Introduction Autumn 2002
CSE 451: Operating Systems Autumn 2005 Memory Management
Translation Buffers (TLB’s)
Virtual Memory Overcoming main memory size limitation
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
© 2004 Ed Lazowska & Hank Levy
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Translation Buffers (TLB’s)
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Lecture 8: Efficient Address Translation
Translation Buffers (TLBs)
Chapter 8: Main Memory.
Review What are the advantages/disadvantages of pages versus segments?
Virtual Memory.
Memory Management & Virtual Memory
Virtual Memory 1 1.
Page Main Memory.
Presentation transcript:

Project 3 Design Considerations SECTION… 6? 5? 7?

Preamble  I know you all are waist-deep in ASST2 right now  At the very least pay attention enough that you can think to yourself, “Oh yeah, I think he mentioned that in the slides” later when working on your ASST3 design doc

Address Translation  On memory access: check TLB  TLB miss? Trap to kernel!  Kernel looks through page table(s)  Page table hit?  In physical memory? Load the TLB!  Not in physical memory? Swap in the proper page!  Bad address entirely? Kill the program!  Example on board

TLB  Entries managed by kernel  Relevant functions:  tlb_read / write / random / probe  arch/mips/include/tlb.h  TLB miss  trap to kernel  vm_fault(int faulttype, vaddr_t faultaddress)  TLB entry bits  TLBHI_VPAGE : virtual page index (mask)  TLBLO_PPAGE : physical page index (mask)  TLBLO_DIRTY : whether page is writable (flag)  TLBLO_VALID : whether page is valid (flag)  What should happen on a context switch?  Eviction scheme?

TLB (cont.)  TLB shootdown!!  pew pew pew  OS/161 terminology is slightly different from ours  ipi_tlbshootdown : shoot down specified entries on specified CPU  vm_tlbshootdown : shoot down specified entries on this CPU  vm_tlbshootdown_all : shoot down all entries on this CPU  You need to implement vm_tlbshootdown / _all  Note: Shooting down all entries technically shoots down any specified entries

Page Tables  Segments  Matches addrspace API and ELF layout  What’s in a segment?  Page range  Permissions  Multiple levels  Don’t want to keep entire address space for each process  Level of splitting is up to you  What will your page table look like?  What will your page table entries look like?

Swapping  We can’t fit every user page in memory  Swap pages out to disk  Eviction scheme?  Protip: use LHD0 raw  "lhd0raw:"  Remember that vfs_open mangles the path string  Need to manage disk locations  How will you represent this information?  Need to map pages to disk locations  Where will you keep this information?

Core Map  Mapping from physical pages to virtual pages  Remember: core map must also be in physical memory!  Core map must be in core map  How big should the core map be?  How many entries does the core map have?  How do you reserve space for it?  ram_stealmem()  When should you reserve space for it?

Kernel / User Memory  arch/mips/include/vm.h:42  Kernel memory is linearly mapped  arch/mips/include/vm.h:68  Might be useful to define a corresponding macro  What happens when you ask for address…  0x00406a9b ?  0x8160a4df ?  How do you access physical address 0x07f29c20 ?  Kernel and user pages must coexist  Which has priority?