Homework Assignment #3 J. H. Wang Nov. 13, 2015.

Slides:



Advertisements
Similar presentations
9.4 Page Replacement What if there is no free frame?
Advertisements

Background Virtual memory – separation of user logical memory from physical memory. Only part of the program needs to be in memory for execution. Logical.
Operating Systems Review.
1 Virtual Memory Management B.Ramamurthy. 2 Demand Paging Main memory LAS 0 LAS 1 LAS 2 (Physical Address Space -PAS) LAS - Logical Address.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 38 Frame Allocation Read.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement.
Module 9: Virtual Memory
Module 10: Virtual Memory Background Demand Paging Performance of Demand Paging Page Replacement Page-Replacement Algorithms Allocation of Frames Thrashing.
Virtual Memory Background Demand Paging Performance of Demand Paging
Virtual Memory Introduction to Operating Systems: Module 9.
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)
Instructor: Umar KalimNUST Institute of Information Technology Operating Systems Virtual Memory.
03/26/2010CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying an earlier.
Chapter 9: Virtual Memory. 9.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 22, 2005 Chapter 9: Virtual Memory Background.
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.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 9: Virtual Memory.
1 Virtual Memory Management B.Ramamurthy Chapter 10.
Memory Management 2 Tanenbaum Ch. 3 Silberschatz Ch. 8,9.
03/29/2004CSCI 315 Operating Systems Design1 Page Replacement Algorithms (Virtual Memory)
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.
Slide 12-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter Virtual Memory.
Maninder Kaur VIRTUAL MEMORY 24-Nov
Chapter VIII Virtual Memory Review Questions Jehan-François Pâris
Memory Management ◦ Operating Systems ◦ CS550. Paging and Segmentation  Non-contiguous memory allocation  Fragmentation is a serious problem with contiguous.
Memory Management Ch.8.
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
Silberschatz and Galvin  Chapters 3 and 5 Possible questions –Tracing a given program involving fork, exec, semaphores, and share memory –Wring.
Operating Systems Chapter 8
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
CS 241 Section Week #9 (11/05/09). Topics MP6 Overview Memory Management Virtual Memory Page Tables.
Homework Assignment #3 J. H. Wang Nov. 19, Homework #3 Chap.7: 7.5, 7.10 Chap.8: 8.6, 8.10 Chap.9: 9.3, 9.6 Due: two weeks (Dec. 3, 2009)
Virtual Memory The memory space of a process is normally divided into blocks that are either pages or segments. Virtual memory management takes.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 9 th Edition Chapter 9: Virtual-Memory Management.
Memory Management & Virtual Memory © Dr. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada.
Demand Paging Reference Reference on UNIX memory management
Memory Management. Why memory management? n Processes need to be loaded in memory to execute n Multiprogramming n The task of subdividing the user area.
Silberschatz, Galvin and Gagne  Operating System Concepts Virtual Memory Virtual memory – separation of user logical memory from physical memory.
Virtual Memory The address used by a programmer will be called a virtual address or logical address. An address in main memory is called a physical address.
Memory Management OS Fazal Rehman Shamil. swapping Swapping concept comes in terms of process scheduling. Swapping is basically implemented by Medium.
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)
Chapter 9: Virtual-Memory Management. 9.2 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Chapter 9: Virtual-Memory Management 9.1 Background.
1 Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Operating System Examples (not covered.
10.1 Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Operating System Examples.
CSCI 6307 Foundation of Systems – Exercise (4) Xiang Lian The University of Texas – Pan American Edinburg, TX
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 9: Virtual Memory.
Chapter 9: Virtual Memory. 9.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Background Virtual memory – separation of user logical memory.
Chapters 3 and 5 Possible questions
Computer Organization
Demand Paging Reference Reference on UNIX memory management
Review.
Paging Examples Assume a page size of 1K and a 15-bit logical address space. How many pages are in the system?
Module 9: Virtual Memory
Demand Paging Reference Reference on UNIX memory management
Chapter 9: Virtual-Memory Management
Operating Systems Review.
CS241 Section: Week 10.
Memory Management & Virtual Memory
5: Virtual Memory Background Demand Paging
CPSC 457 Operating Systems
Virtual Memory فصل هشتم.
Major Topics in Operating Systems
Exercise (11).
Exercise (10).
Lecture 9: Caching and Demand-Paged Virtual Memory
Module 9: Virtual Memory
COMP755 Advanced Operating Systems
Student : Yan Wang student ID:
CSE 542: Operating Systems
Module IV Memory Organization.
Presentation transcript:

Homework Assignment #3 J. H. Wang Nov. 13, 2015

Homework #3 Chap.7: 7.6, 7.13 Chap.8: 8.9, 8.16, 8.25* (Optional: End-of-chapter programming projects in Chap. 7& 9) Due: two weeks (Nov. 27, 2015)

Chap. 7: (to be continued…) 7.6: In a real computer system, neither the resources available nor the demands of processes for resources are consistent over long periods (months). Resources break or are replaced, new processes come and go, new resources are bought and added to the system. If deadlock is controlled by the banker’s algorithm, which of the following changes can be made safely (without introducing the possibility of deadlock), and under what circumstances? (to be continued…)

(… continued from the previous slide) (a) Increase Available (new resources added) (b) Decrease Available (resource permanently removed from system) (c) Increase Max for one process (the process needs more resources than allowed, it may want more) (d) Decrease Max for one process (the process decides it does not need that many resources) (e) Increase the number of processes (f) Decrease the number of processes

(to be continued…) 7.13: Consider the following snapshot of a system : Allocation A B C D Max A B C D Available A B C D P0 2 0 0 1 4 2 1 2 3 3 2 1 P1 3 1 2 1 5 2 5 2 P2 2 1 0 3 2 3 1 6 P3 1 3 1 2 1 4 2 4 P4 1 4 3 2 3 6 6 5

(… continued from the previous slide) Answer the following questions using the banker’s algorithm: (a) Illustrate that the system is in a safe state by demonstrating an order in which the processes may complete. (b) If a request from process P1 arrives for (1,1,0,0), can the request be granted immediately? Why? (c) If a request from process P4 arrives for (0,0,2,0), can the request be granted immediately? Why?

Chap. 8: 8.9: Compare paging with segmentation with respect to how much memory the address translation structures require to convert virtual addresses to physical addresses.

8.16: Consider a computer system with a 32-bit logical address and 4-KB page size. The system supports up to 512MB of physical memory. How many entries are there in each of the following? (a) A conventional single-level page table (b) An inverted page table

8.25*: Assume that a system has a 32-bit virtual address with a 4-KB page size. Write a C program that is passed a virtual address (in decimal) on the command line and have it output the page number and offset for the given address. (to be continued…)

(… continued from the previous slide) As an example, your program would run as follows: ./a.out 19986 Your program would output: The address 19986 contains: page number=4 offset=3602 Writing this program will require using the appropriate data type to store 32 bits. We encourage you to use unsigned data types as well.

Chap. 9: 9.11: Discuss situations in which the least frequently used (LFU) page-replacement algorithm generates fewer page faults than the least recently used (LRU) page-replacement algorithm. Also discuss under what circumstances the opposite holds. 9.19: What is the cause of thrashing? How does the system detect thrashing? Once it detects thrashing, what can the system do to eliminate this problem?

9.26*: Write a program that implements the FIFO, LRU, and optimal page-replacement algorithms presented in this chapter. First, generate a random page-reference string where page numbers range from 0 to 9. Apply the random page-reference string to each algorithm, and record the number of page faults incurred by each algorithm. Implement the replacement algorithm so that the number of page frames can vary from 1 to 7. Assume that demand paging is used.

End-of-chapter programming projects Ch.7*: Banker’s Algorithm Write a multithreaded program that implements the banker’s algorithm discussed in Section 7.5.3. Ch.9*: Designing a Virtual Memory Manager This project consists of writing a program that translates logical to physical addresses for a virtual address space of size 216=65,536 bytes.

Any Questions or Comments?