CAS3SH3 Final Review. The Final Tue 28 th, 7pm, IWC3 closed book, closed note Non-comprehensive: memory management, storage & file system Types of questions:

Slides:



Advertisements
Similar presentations
Chapter 4 Memory Management Basic memory management Swapping
Advertisements

Operating Systems Review.
Operating Systems Lecture 10 Issues in Paging and Virtual Memory Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing.
Operating Systems ECE344 Ding Yuan Final Review Lecture 13: Final Review.
OS Fall’02 Virtual Memory Operating Systems Fall 2002.
Virtual Memory Chapter 18 S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer,  S. Dandamudi.
CS 153 Design of Operating Systems Spring 2015
Misc Exercise 2 updated with Part III.  Due on next Tuesday 12:30pm. Project 2 (Suggestion)  Write a small test for each call.  Start from file system.
CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
Chapter 101 Virtual Memory Chapter 10 Sections and plus (Skip:10.3.2, 10.7, rest of 10.8)
OS Spring ‘04 Paging and Virtual Memory Operating Systems Spring 2004.
Memory Management (II)
Paging and Virtual Memory. Memory management: Review  Fixed partitioning, dynamic partitioning  Problems Internal/external fragmentation A process can.
CS 104 Introduction to Computer Science and Graphics Problems
CMPT 300: Operating Systems Review THIS REIVEW SHOULD NOT BE USED AS PREDICTORS OF THE ACTUAL QUESTIONS APPEARING ON THE FINAL EXAM.
Memory Management 2010.
CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
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.
03/22/2004CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying the textbook.
Chapter 4 Memory Management 4.1 Basic memory management 4.2 Swapping
Memory Management ◦ Operating Systems ◦ CS550. Paging and Segmentation  Non-contiguous memory allocation  Fragmentation is a serious problem with contiguous.
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
Lecture 21 Last lecture Today’s lecture Cache Memory Virtual memory
Silberschatz and Galvin  Chapters 3 and 5 Possible questions –Tracing a given program involving fork, exec, semaphores, and share memory –Wring.
CS 153 Design of Operating Systems Spring 2015 Final Review.
Operating Systems Chapter 8
8.4 paging Paging is a memory-management scheme that permits the physical address space of a process to be non-contiguous. The basic method for implementation.
1 Chapter 3.2 : Virtual Memory What is virtual memory? What is virtual memory? Virtual memory management schemes Virtual memory management schemes Paging.
File System Implementation Chapter 12. File system Organization Application programs Application programs Logical file system Logical file system manages.
CIS250 OPERATING SYSTEMS Memory Management Since we share memory, we need to manage it Memory manager only sees the address A program counter value indicates.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming  To allocate scarce memory resources.
CS414 Review Session.
8.1 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Paging Physical address space of a process can be noncontiguous Avoids.
Virtual Memory. Virtual Memory: Topics Why virtual memory? Virtual to physical address translation Page Table Translation Lookaside Buffer (TLB)
Virtual Memory. Background Virtual memory is a technique that allows execution of processes that may not be completely in the physical memory. Virtual.
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.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Virtual Memory Hardware.
Paging (continued) & Caching CS-3013 A-term Paging (continued) & Caching CS-3013 Operating Systems A-term 2008 (Slides include materials from Modern.
Introduction: Memory Management 2 Ideally programmers want memory that is large fast non volatile Memory hierarchy small amount of fast, expensive memory.
Operating Systems ECE344 Ding Yuan Final Review Lecture 13: Final Review.
1 Rutgers UniversityCS 416: Operating Systems Final exam details December 22, pm-3pm. Venue: SEC 118. Tips: Spend time reading the questions before.
Memory Management Continued Questions answered in this lecture: What is paging? How can segmentation and paging be combined? How can one speed up address.
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”
Week 5:Virtual Memory CS 162. Today’s Section Administrivia Quiz Review of Lecture Worksheet and Discussion.
MIDTERM REVIEW CSCC69 Winter 2016 Kanwar Gill. What is an OS? What are processes and threads? Process states? Diagram showing the state changes What data.
Chapter 9 Memory Organization. 9.1 Hierarchical Memory Systems Figure 9.1.
Chapters 3 and 5 Possible questions
Lecture 12 Virtual Memory.
Review.
Chapter 8: Main Memory.
Chapter 9: Virtual-Memory Management
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Computer Architecture
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 12/1/2018.
CSE 451: Operating Systems Autumn 2005 Memory Management
Contents Memory types & memory hierarchy Virtual memory (VM)
CSE451 Virtual Memory Paging Autumn 2002
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
CSC3050 – Computer Architecture
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Virtual Memory: Working Sets
CS703 - Advanced Operating Systems
COMP755 Advanced Operating Systems
Virtual Memory.
CSE 542: Operating Systems
Virtual Memory 1 1.
Presentation transcript:

CAS3SH3 Final Review

The Final Tue 28 th, 7pm, IWC3 closed book, closed note Non-comprehensive: memory management, storage & file system Types of questions: multiple choice, long answers You can bring McMaster standard calculator; no Internet-enabled devices All-in-one slides on course page Office hrs: (April 6 – 10 th, 20 th – 24 th ) – Tue. 4 – 6pm, Wed. 10 – 3pm; By appt other time – Please resolve all grading related issues by April 24 th – >= A; > 90 – A + – Note: out of town April 13 th – 17 th

Materials covered since midterm Memory management Storage and file systems Two key aspects Data structure – What – Where: in memory/cache/register, on disk Algorithms

Memory Management Understand the distinctions between virtual (logical) address space and physical address space Understand different approaches to memory management: contiguous vs. non- contiguous, fixed vs variable size partitions, segmentation, paging. Pros and cons of each approach What are external fragmentation and internal fragmentation? Segmentation: segmentation table, how to translate from virtual address to physical address? when errors occur? Base0Limit0V Base1Limit1V Base2Limit2V Base3Limit3N Base4Limit4V Base5Limit5N Base6Limit6N Base7Limit7V OffsetSeg # Virtual Address Base2Limit2V + Physical Address > Error offset Check Valid Access Error

Memory Management Paging: page table, page table entry, how to translate from virtual address to physical address? when errors occur? Special bits in PTE Impacts of page size Physical Address Offset Virtual Page # Virtual Address: Access Error > PageTableSize PageTablePtr page #0 page #2 page #3 page #4 page #5 V,R page #1 V,R V,R,W N page #1 V,R Check Perm Access Error Physical Page #

Paging (cont’d) TLB, multilevel paging, inverted page table, combing paging with segmentation – Pros and cons Compute the size of page table(s) and the maximum size of logical address space of 32-bit and 64-bit systems AdvantagesDisadvantages SegmentationFast context switching: Segment mapping maintained by CPU External fragmentation Paging (single- level page) No external fragmentation, fast easy allocation Large table size ~ virtual memory Paged segmentation Table size ~ # of pages in virtual memory, fast easy allocation Multiple memory references per page access Two-level pages Inverted page table Table size ~ # of pages in physical memory Lookup time If combined with hash table, two memory lookups

Virtual memory Swap file/partition on disk (in raw, no file system) Understand the needs for on-demand paging Valid bit in PTE to indicate whether a page in memory Page faults – Type of pages faults: compulsory misses, policy misses, capacity misses – Cost of page faults – Steps in handling page faults Understanding the notions of temporal and spatial locality, and their implication on page replacement policies and working sets Page replacement policies (FCFS, OPT, LRU, 2 nd chance, clock algorithm) – Given a reference sequence, can determine the # of page faults – Belady’s anomaly Working sets: the definition, how to compute working sets, how to avoid thrashing

Types of page faults & remedies Bag of tricks Prefetching Tracking workset Swapping processes Page replacement algorithms Copy-on-write Capacity misses Compulsory misses Policy misses

Storage and File Systems Organization of magnetic disks Average access time of magnetic disk Disk addressing: organize sectors into blocks and use logical block address (LBA) Disk scheduling: – Goal: minimizing seek time – Policies: FIFO, SSTF, SCAN, C-SCAN, C-LOOK Disk management [file systems]: – Formatting in two steps: 1) partitioning 2) making file system (not applicable for raw disk partitioning) – Boot sequence: BIOS, master boot record (locate boot partition), volume boot record (loading OS) Swap space [memory management]

Storage Understand MTF, MTR and MTDL – Able to determine MTF, MTDL for simple schemes such as mirroring Redundant array of inexpensive (independent) disks (RAID) – Mirroring, stripling, parity, (7, 4) hamming code – Error detection vs error correction; bit level vs. block level stripling – Different RAID configuration

File systems Directory – what is stored in directory: (file name, FCB block) organized as a linear array or hash table – How are directories organized: tree, acyclic graphs – How to locate a file “/home/me/file1”? (starting from the root directory, find the FCB corresponding to the subdirectories and finally the file) – Recently accessed directories cached in memory Files: abstract data type, contiguous logical space (to users) – File operations: read, write, open, close, … – FCB – Disk allocation and translation: contiguous allocation, linked allocation, index allocation – The maximum size of file is determined by the allocation schemes

File systems In memory and on-disk data structure – What happens when creating, opening, reading a file? In memoryon-disk Mount table Directory cache system-wide open-file table per-process open file table (PCB) Buffers for file system blocks MBR Boot control block Volume control block Directory structures FCB and data blocks of each files

Discussion In paging, the physical address can be computed by adding the physical page # and the offset (false) – Adding  appending Consider the use of multilevel paging. Suppose a page table in each level can be no larger than 4096 Byte, and the size of each entry in the page table is 4 Byte. With 32-bit logical address space, a) what is the minimum # of levels needed if the page size is 4096 Byte, and b) how many physical memory references are needed for each logical memory reference if no TLB is used. – (a) 2 32 /2 12 = 2 20  2 levels – (b) # of memory reference = # of levels + 1 The following bits are typically kept in a page table entry: valid bit, read-only bit, use bit, reference bit, and dirty bit. – use bit is the same as reference bit

Discussions Consider the following memory references Suppose only 3 physical frames in the memory. The number of page faults generated by FIFO (including compulsory PFs) is, ______The number of page faults generated by OPT is, ______The number of page faults generated by LRU is, ______The number of page faults generated by the clock algorithm is, ______ FIFO OPT

LRU Clock 2 u: 0 2 u: 0 2 u: 0 2 u: 0 1 u: 0 1 u: 0 2 u: 0 2 u: 0 1 u: 0 1 u: 0 4 u: 0 4 u: 0 2 u: 1 2 u: 1 1 u: 0 1 u: 0 4 u: 0 4 u: 0 2 u: 1 2 u: 1 5 u: 0 5 u: 0 4 u: 0 4 u: 0 2 u: 1 2 u: 1 5 u: 0 5 u: 0 1 u: 0 1 u: 0 2 u: 0 2 u: 0 6 u: 0 6 u: 0 1 u: 0 1 u: 0 2 u: 0 2 u: 0 6 u: 0 6 u: 0 5 u: 0 5 u: 0

C-SCAN

C-LOOK

Good luck Please remember to fill in teaching evaluation!