CS241 Section: Week 10.

Slides:



Advertisements
Similar presentations
1 CMPT 300 Introduction to Operating Systems Virtual Memory Sample Questions.
Advertisements

CSS430 Memory Management Textbook Ch8
Allocating Memory.
Homework 2 Review Cornell CS Calling Conventions int gcd(int x, int y) { int t, a = x, b = y; while(b != 0) { t = b; b = mod(a, b); a = t; } return.
11/13/01CS-550 Presentation - Overview of Microsoft disk operating system. 1 An Overview of Microsoft Disk Operating System.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Memory Management -3 CS 342 – Operating Systems Ibrahim Korpeoglu Bilkent.
CE6105 Linux 作業系統 Linux Operating System 許 富 皓. Chapter 2 Memory Addressing.
Chapter 3 Memory Management
CSI 400/500 Operating Systems Spring 2009 Lecture #9 – Paging and Segmentation in Virtual Memory Monday, March 2 nd and Wednesday, March 4 th, 2009.
03/24/2004CSCI 315 Operating Systems Design1 Memory Management and Virtual Memory (Problem session)
Chapter 91 Translation Lookaside Buffer (described later with virtual memory) Frame.
Answers to the VM Problems Spring First question A computer has 32 bit addresses and a virtual memory with a page size of 8 kilobytes.  How many.
CS 241 Section Week #12 (04/22/10).
Week 7 February 17, 2004 Adrienne Noble. Important Dates Due Monday, Feb 23 Homework 7 Due Wednesday, Feb 25 Project 3 Due Friday, Feb 27 Homework 8.
Memory Management Ch.8.
CS 346 – Chapter 8 Main memory –Addressing –Swapping –Allocation and fragmentation –Paging –Segmentation Commitment –Please finish chapter 8.
CS 153 Design of Operating Systems Spring 2015 Final Review.
8.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 08 Main Memory (Page table questions)
Operating Systems COMP 4850/CISG 5550 Page Tables TLBs Inverted Page Tables Dr. James Money.
1 Linux Operating System 許 富 皓. 2 Memory Addressing.
CS 149: Operating Systems March 3 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
Virtual Memory Virtual Memory is created to solve difficult memory management problems Data fragmentation in physical memory: Reuses blocks of memory.
CS 241 Section Week #9 (11/05/09). Topics MP6 Overview Memory Management Virtual Memory Page Tables.
Introduction to Virtual Memory and Memory Management
Operating Systems Unit 7: – Virtual Memory organization Operating Systems.
The Microprocessor and Its Architecture A Course in Microprocessor Electrical Engineering Department University of Indonesia.
Memory Management & Virtual Memory © Dr. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada.
Homework Assignment #3 J. H. Wang Nov. 13, 2015.
Copyright ©: Nahrstedt, Angrave, Abdelzaher, Caccamo 1 Memory management & paging.
操作系统原理 OPERATING SYSTEM Chapter 3 Memory Management 内存管理.
CHAPTER 3-3: PAGE MAPPING MEMORY MANAGEMENT. VIRTUAL MEMORY Key Idea Disassociate addresses referenced in a running process from addresses available in.
Virtual Memory Review Goal: give illusion of a large memory Allow many processes to share single memory Strategy Break physical memory up into blocks (pages)
CSCI 6307 Foundation of Systems – Exercise (4) Xiang Lian The University of Texas – Pan American Edinburg, TX
CS 140 Lecture Notes: Virtual MemorySlide 1 Load-Time Relocation Process 1 0 ∞ Process 3 Operating System Process 6.
ADDRESS MAPPING ADDRESS MAPPING The delivery of a packet to a host or a router requires two levels of addressing: logical and physical. We need to be able.
Memory Management memory hierarchy programs exhibit locality of reference - non-uniform reference patterns temporal locality - a program that references.
Operating Systems, Winter Semester 2011 Practical Session 9, Memory 1.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 33 Paging Read Ch. 9.4.
Memory Management & Virtual Memory. Hierarchy Cache Memory : Provide invisible speedup to main 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.
Memory Management Chapter 3
CS 140 Lecture Notes: Virtual Memory
Memory Management Virtual Memory.
Memory Management.
Memory Management (2).
Segmentation COMP 755.
ITEC 202 Operating Systems
Practical Session 9, Memory
Review.
Chapter 8: Main Memory.
CS 140 Lecture Notes: Virtual Memory
Lecture 14 Virtual Memory and the Alpha Memory Hierarchy
Operating Modes UQ: State and explain the operating modes of X86 family of processors. Show the mode transition diagram highlighting important features.(10.
Paging Lecture November 2018.
Segmentation Lecture November 2018.
FIGURE 12-1 Memory Hierarchy
Memory Management & Virtual Memory
Operating Systems Placement Algorithm Alok Kumar Jagadev.
CS 140 Lecture Notes: Virtual Memory
Lecture 3: Main Memory.
Practical Session 9, Memory
CSE 451: Operating Systems Autumn 2005 Memory Management
CS-401 Assembly Language Programming
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Lecture 34 Syed Mansoor Sarwar
CS 140 Lecture Notes: Virtual Memory
COMP755 Advanced Operating Systems
CSE 542: Operating Systems
Page Main Memory.
Presentation transcript:

CS241 Section: Week 10

Topics LMP2 changes Problem solving session: Memory

LMP2 Changes In .c and .h file, change the return type of my_mwrite to int, instead of void In the tester programs, change the following line: sprintf(filename[i], "file%d", i+1); to sprintf(filename[i], "tester/file%d", i+1); File map table: initialization and maintenance may be done in the encrypt and decrypt function

Memory: Problem Solving Session

Problem 1 Consider a system in which the memory has the following hole sizes in the following memory order: 1KB, 4 KB, 15 KB, 20 KB, 4 KB, 7 KB, 18 KB, 12 KB, 15 KB, 9 KB   You are given successive requests for program segments in the following order: 10 KB, 5 KB, 3 KB, 2 KB, 19 KB, 9 KB, 24 KB, 10 KB. For each of the following algorithms, show how the holes get filled for each of the above requests. If a particular request cannot be satisfied, you can skip it (but do mention which ones cannot be satisfied):  First fit Best fit Worst fit Next fit

Problem 2 For each of the following decimal virtual addresses, compute the virtual page number and offset for a 4 KB page and for and 8 KB page: 20000, 32768, 60000.

Problem 3 Consider the page table of the figure. Give the physical address corresponding to each of the following virtual addresses: 29 4100 8300

Problem 4 A machine has 48 bit virtual addresses and 32 bit physical addresses. Pages are 8 KB. How many entries are needed for the page table?

Problem 5 Consider a machine such as the DEC Alpha 21064 which has 64 bit registers and manipulates 64-bit addresses. If the page size is 8KB, how many bits of virtual page number are there? If the page table used for translation from virtual to physical addresses were 8 bytes per entry, how much memory is required for the page table and is this amount of memory feasible?

Problem 6 A computer with a 32-bit address uses a two-level page table. Virtual addresses are split into 9-bit top-level page table field, an 11 bit second-level page table field, and an offset. How large are the pages and how many are there in the address space?

Problem 7 Fill in the following table: Virtual Address (bits) Page Size # of Page Frames # of Virtual Pages Offset Length (bits) Addressable Physical Memory 16 256 B 2^2 32 1 MB 2^4 1 KB 2^8 64 16 KB 2^20 8 MB 2^16

Problem 8 Fill in this table with the correct page evictions. Physical memory contains 4 pages. Page Accesses 1 2 3 4 5 Optimal - FIFO LRU LFU MRU