Review for Midterm. Starring Ari and Tyler

Similar documents
CMPS 111 Spring 2003 Midterm Exam May 8, Name: ID:

CSE 153 Design of Operating Systems

Fall 2015 COMP Operating Systems. Lab 06

CSI3131 Final Exam Review

Operating Systems (1DT020 & 1TT802)

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1

Chapter 8 Virtual Memory

CS162 Operating Systems and Systems Programming Lecture 11 Page Allocation and Replacement"

CS 333 Introduction to Operating Systems. Class 11 Virtual Memory (1) Jonathan Walpole Computer Science Portland State University

Virtual Memory. Chapter 8

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University

3/3/2014! Anthony D. Joseph!!CS162! UCB Spring 2014!

Lecture 9: Midterm Review

CS 318 Principles of Operating Systems

Midterm Exam #2 Solutions October 25, 2016 CS162 Operating Systems

Fall COMP3511 Review

Memory Management. Dr. Yingwu Zhu

CS399 New Beginnings. Jonathan Walpole

CPSC/ECE 3220 Summer 2017 Exam 2

Page 1. Goals for Today" TLB organization" CS162 Operating Systems and Systems Programming Lecture 11. Page Allocation and Replacement"

CSE 120. Translation Lookaside Buffer (TLB) Implemented in Hardware. July 18, Day 5 Memory. Instructor: Neil Rhodes. Software TLB Management

Computer Architecture. Lecture 8: Virtual Memory

1. Creates the illusion of an address space much larger than the physical memory

2 nd Half. Memory management Disk management Network and Security Virtual machine

To Everyone... iii To Educators... v To Students... vi Acknowledgments... vii Final Words... ix References... x. 1 ADialogueontheBook 1

VIRTUAL MEMORY READING: CHAPTER 9

Memory Management Virtual Memory

Address Translation. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Virtual Memory. Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University

Operating Systems Comprehensive Exam. Spring Student ID # 3/20/2013

Memory management. Requirements. Relocation: program loading. Terms. Relocation. Protection. Sharing. Logical organization. Physical organization

Virtual or Logical. Logical Addr. MMU (Memory Mgt. Unit) Physical. Addr. 1. (50 ns access)

Memory Management. Dr. Yingwu Zhu

a process may be swapped in and out of main memory such that it occupies different regions

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1

CPS104 Computer Organization and Programming Lecture 16: Virtual Memory. Robert Wagner

VIRTUAL MEMORY II. Jo, Heeseung

CSE 120. Fall Lecture 8: Scheduling and Deadlock. Keith Marzullo

21 Lecture: More VM Announcements From last time: Virtual Memory (Fotheringham, 1961)

The Virtual Memory Abstraction. Memory Management. Address spaces: Physical and Virtual. Address Translation

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1

Indian Institute of Technology, Kharagpur


CS162 Operating Systems and Systems Programming Midterm Review"

Final Exam Preparation Questions

Xen and the Art of Virtualization. CSE-291 (Cloud Computing) Fall 2016

Threads. Concurrency. What it is. Lecture Notes Week 2. Figure 1: Multi-Threading. Figure 2: Multi-Threading

CSE 120 Principles of Operating Systems

CPS 310 second midterm exam, 11/14/2014

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1

CS350: Final Exam Review

Multi-level Translation. CS 537 Lecture 9 Paging. Example two-level page table. Multi-level Translation Analysis

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING UNIT I

Midterm Exam Solutions Amy Murphy 28 February 2001

Midterm Exam. October 20th, Thursday NSC

Course Description: This course includes the basic concepts of operating system

Operating Systems. Operating Systems Sina Meraji U of T

COS 318: Operating Systems. Virtual Memory and Address Translation

Operating System Review Part

Main Memory (Part II)

Operating System Concepts

Operating Systems: Quiz2 December 15, Class: No. Name:

MEMORY HIERARCHY BASICS. B649 Parallel Architectures and Programming

Design of Operating System

Operating Systems and Computer Networks. Memory Management. Dr.-Ing. Pascal A. Klein

Computer Architecture Computer Science & Engineering. Chapter 5. Memory Hierachy BK TP.HCM

CPS 104 Computer Organization and Programming Lecture 20: Virtual Memory

Chapter Seven Morgan Kaufmann Publishers

Embedded Systems Dr. Santanu Chaudhury Department of Electrical Engineering Indian Institute of Technology, Delhi

Operating Systems Design Exam 2 Review: Spring 2011

Main Points of the Computer Organization and System Software Module

Chapter 3 - Memory Management

Computer Science 161

Address spaces and memory management

CS 416: Opera-ng Systems Design March 23, 2012

Recall: Address Space Map. 13: Memory Management. Let s be reasonable. Processes Address Space. Send it to disk. Freeing up System Memory

Where are we in the course?

The Deadlock Lecture

CS140 Operating Systems and Systems Programming

COMP 3361: Operating Systems 1 Final Exam Winter 2009

Page Replacement. (and other virtual memory policies) Kevin Webb Swarthmore College March 27, 2018

Virtual Memory 2. q Handling bigger address spaces q Speeding translation

Lecture 21: Virtual Memory. Spring 2018 Jason Tang

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science

Virtual Memory Management

CS153: Midterm (Fall 16)

Announcements. Reading. Project #1 due in 1 week at 5:00 pm Scheduling Chapter 6 (6 th ed) or Chapter 5 (8 th ed) CMSC 412 S14 (lect 5)

Virtual Memory II CSE 351 Spring

CS 143A - Principles of Operating Systems

Reintroduction to Concurrency

Operating Systems (2INC0) 2017/18

(b) External fragmentation can happen in a virtual memory paging system.

Pipelined processors and Hazards

Chapter 8 Virtual Memory

Basic Memory Management. Basic Memory Management. Address Binding. Running a user program. Operating Systems 10/14/2018 CSC 256/456 1

Cute Tricks with Virtual Memory

Course Outline. Processes CPU Scheduling Synchronization & Deadlock Memory Management File Systems & I/O Distributed Systems

Second Midterm Exam March 21, 2017 CS162 Operating Systems

CS 31: Intro to Systems Virtual Memory. Kevin Webb Swarthmore College November 15, 2018

CSc33200: Operating Systems, CS-CCNY, Fall 2003 Jinzhong Niu December 10, Review

Transcription:

Review for Midterm Starring Ari and Tyler

Basic OS structure OS has two chief goals: arbitrating access to resources, and exposing functionality. Often go together: we arbitrate hardware by wrapping in higher-level interface that naturally incorporates protection. Examples of arbitration and protection?

Moving bits in and out Can either do I/O via memory mapping or special instructions. (feature of hardware, not OS) Some mix of interrupts and DMA for data path. Traps to indicate software conditions/ system calls.

Processes vs Threads What do they have in common? How are they different?

Scheduling OS has to pick which process/thread gets CPU time, and for how long. Lots of scheduling algorithms: most real-world ones are some flavor of round-robin. Do some sort of feedback to size CPU bursts to process behavior: want interactive processes to get scheduled more often.

You ve all built them. Semaphores

Monitors More modern and high-level than semaphores. Defines (lexically or dynamically) a region of code in which only one thread is running. Lexically: Java s synchronized(foo) {} Dynamically: Monitor_enter, Monitor_leave. (Pthreads, windows, etc)

Condition variables Monitors alone not enough. Condition variables let a thread atomically release monitor lock and stop. Can be woken without breaking monitor guarantee. (Though ambiguous who runs next) Hoare vs Mesa semantics

Deadlock Conditions:?

Deadlock Conditions: Mutual exclusion: resources aren t shared. Hold+Wait: process holding resource can request more No preemption: resources not taken from process. Circular Dependence

Dealing with deadlock Many strategies -- either proactive or reactive?

Dealing with deadlock Many strategies -- either proactive or reactive Impose total ordering on resources. Have resource acquisition operation check for cycles. (Hard, if resources can t be neatly enumerated) Banker s algorithm? (Hard in practice, since don t know maximum need)

Virtual Memory Originally, swapping to share scarce RAM; one process at a time loaded into memory. Paging allows more fine-grained allocation. These days, VM primarily for process isolation. Idea is that processes cannot utter name of someone else s storage, so no possibility of corruption.

Paging Paging requires separating virtual and physical addresses; this way same physical address can be used by different processes and system will catch accesses. Mapping from virtual to physical address stored in page tables. Some hardware support needed: have to catch accesses, and to make this go acceptably fast, need hardware caches (TLB)

Address translation Can t have map for every address -- too expensive. Map by pages instead. Suppose we have a virtual address 0xAABB1234. Suppose 4k pages. Then last three nybbles are page offset, rest is page tag. So we lookup 0xAABB1, fetch the page, and then add back the 234.

Worked example Let s do it for two-level paging and 40-bit addresses; 4kb pages, tag sizes of 16 and 12 bits. Suppose address is 0xAABB123456. Then offset on page is...

Worked example Let s do it for two-level paging and 40-bit addresses; 4kb pages, tag sizes of 16 and 12 bits. Suppose address is 0xAABB123456. Then offset on page is 0x456. Index into first table is...

Worked example Let s do it for two-level paging and 40-bit addresses; 4kb pages, tag sizes of 16 and 12 bits. Suppose address is 0xAABB123456. Then offset on page is 0x456. Index into first table is... 0xAABB. And index into second table is...

Worked example Let s do it for two-level paging and 40-bit addresses; 4kb pages, tag sizes of 16 and 12 bits. Suppose address is 0xAABB123456. Then offset on page is 0x456. Index into first table is... 0xAABB. And index into second table is 0x123.

Doing the translation Same example of 0xAABB123456. First index into outer table to map 0xAABB. Write that down as YYYY. Next lookup page table YYYY. Map 0x123 to ZZZ. Final address is 0xYYYYZZZ123456.

Page tables Many different page table layouts. Either direct, or inverted. Inverted relies on hashing to find match. Can afford overhead; almost all lookups hit TLB instead. Cost on context switch; have to refresh TLB

Page ejection If doing VM to share RAM, will sometimes need to eject pages from RAM to make way for others. Can get thrashing if pages ejected too often. (Throughput falls drastically) Try to do clever algorithms to do as few read-ins as possible.

Caching... Physical RAM now looks like a cache for total memory. Significant theory behind caching... Can t do perfectly; ideal is to eject page that won t be used again for longest time. Use LRU or WS as approx.

Working set Idea behind WS: track pages used in last t seconds, or last k faults. Keep those working sets if possible; else suspend and swap out a process. Hard to really implement. Tracking page access is expensive. Real systems try to approximate LRU and WS.