21
EECS 482 Introduction to Operating Systems Winter 2018 Harsha V. Madhyastha

EECS 482 Introduction to Operating Systems€¦ · Final exam details Closed book, closed notes No computers, phones, calculators, etc. 2 hr. exam –start at 7pm (not 7:10pm!) Focus

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

Page 1: EECS 482 Introduction to Operating Systems€¦ · Final exam details Closed book, closed notes No computers, phones, calculators, etc. 2 hr. exam –start at 7pm (not 7:10pm!) Focus

EECS 482Introduction to Operating

Systems

Winter 2018

Harsha V. Madhyastha

Page 2: EECS 482 Introduction to Operating Systems€¦ · Final exam details Closed book, closed notes No computers, phones, calculators, etc. 2 hr. exam –start at 7pm (not 7:10pm!) Focus

OS Abstractions

April 16, 2018 3

Operating System

Hardware

Applications

CPU Disk RAM

Process File system Virtual memory

EECS 482 – Lecture 27

NetworkI/O Devices

Page 3: EECS 482 Introduction to Operating Systems€¦ · Final exam details Closed book, closed notes No computers, phones, calculators, etc. 2 hr. exam –start at 7pm (not 7:10pm!) Focus

Virtual Machine Monitor

April 16, 2018 4

Operating System

Hardware

Applications

CPU Disk RAM

Process File system Virtual memory

EECS 482 – Lecture 27

NetworkI/O Devices

Virtual Machine Monitor

Page 4: EECS 482 Introduction to Operating Systems€¦ · Final exam details Closed book, closed notes No computers, phones, calculators, etc. 2 hr. exam –start at 7pm (not 7:10pm!) Focus

What is a VMM?● OS enables co-existence of multiple processes

◆ Offers illusion that each process is on own computer

● A VMM enables multiple OS instances to run simultaneously on a machine

● What interface should VMM export?

● A VMM virtualizes an entire physical machine◆ Offers illusion that OS has full control over hardware◆ VMM �applications� (OSes) run in virtual machines

April 16, 2018 6EECS 482 – Lecture 27

Page 5: EECS 482 Introduction to Operating Systems€¦ · Final exam details Closed book, closed notes No computers, phones, calculators, etc. 2 hr. exam –start at 7pm (not 7:10pm!) Focus

Why run multiple OSes? ● Resource utilization

◆ Machines today are powerful, multiplex their hardware» Example: Cloud services

◆ Migrate VMs across machines without shutdown

● Software use and development◆ Can run multiple OSes simultaneously

» No need to dual boot◆ Can do system (e.g., OS) development at user-level

● Many other cool applications◆ Debugging, emulation, security, fault tolerance, …

April 16, 2018 7EECS 482 – Lecture 27

Page 6: EECS 482 Introduction to Operating Systems€¦ · Final exam details Closed book, closed notes No computers, phones, calculators, etc. 2 hr. exam –start at 7pm (not 7:10pm!) Focus

EECS 482 – Lecture 27

Example of Cool VMM Tricks● How to experiment with apps, protocols, and

systems on future hardware?◆ Example: How to experiment with 100 Gbps network?

● Time dilation◆ VMM slows timer interrupt to make hardware (CPU,

disk, network) appear faster to OS and apps◆ Example:

» OS reads 10 Gb of data from network in 1 second, but thinks only 0.1 second has elapsed

» But, applications run 10x slower

April 16, 2018 8

Page 7: EECS 482 Introduction to Operating Systems€¦ · Final exam details Closed book, closed notes No computers, phones, calculators, etc. 2 hr. exam –start at 7pm (not 7:10pm!) Focus

EECS 482 – Lecture 27

VMM Requirements● Fidelity

◆ OSes and applications work without modification» (although we may modify the OS a bit)

● Isolation◆ VMM protects resources and VMs from each other

● Performance◆ VMM is another layer of software à overhead

» As with OS, want to minimize this overhead

April 16, 2018 9

Page 8: EECS 482 Introduction to Operating Systems€¦ · Final exam details Closed book, closed notes No computers, phones, calculators, etc. 2 hr. exam –start at 7pm (not 7:10pm!) Focus

VMware Hypervisor Model

April 16, 2018 11

Operating System

Hardware

Applications

EECS 482 – Lecture 27

Virtual Machine Monitor

Hardware

Page 9: EECS 482 Introduction to Operating Systems€¦ · Final exam details Closed book, closed notes No computers, phones, calculators, etc. 2 hr. exam –start at 7pm (not 7:10pm!) Focus

Xen Architecture

April 16, 2018 13EECS 482 – Lecture 27

Page 10: EECS 482 Introduction to Operating Systems€¦ · Final exam details Closed book, closed notes No computers, phones, calculators, etc. 2 hr. exam –start at 7pm (not 7:10pm!) Focus

VMware Hosted Architecture

April 16, 2018 14EECS 482 – Lecture 27

Page 11: EECS 482 Introduction to Operating Systems€¦ · Final exam details Closed book, closed notes No computers, phones, calculators, etc. 2 hr. exam –start at 7pm (not 7:10pm!) Focus

What needs to be virtualized?● Exactly what you would expect

◆ CPU◆ Events◆ Memory◆ I/O devices

● Isn�t this just duplicating OS functionality?◆ Yes and no◆ Approaches will be similar to what OS does

» Simpler functionality (VMM much smaller than OS)◆ But implements a different abstraction

» Hardware interface vs. OS interfaceApril 16, 2018 15EECS 482 – Lecture 27

Page 12: EECS 482 Introduction to Operating Systems€¦ · Final exam details Closed book, closed notes No computers, phones, calculators, etc. 2 hr. exam –start at 7pm (not 7:10pm!) Focus

Virtualizing Memory● OS assumes full control over memory

● But VMM partitions memory among VMs◆ VMM needs to control mappings for isolation

» OS can only map to a physical page given to it by VMM

● Solution: Need MMU support to handle two-levels of page tables

April 16, 2018 16EECS 482 – Lecture 27

Page 13: EECS 482 Introduction to Operating Systems€¦ · Final exam details Closed book, closed notes No computers, phones, calculators, etc. 2 hr. exam –start at 7pm (not 7:10pm!) Focus

Shadow Page Tables

April 16, 2018 18EECS 482 – Lecture 27

Page 14: EECS 482 Introduction to Operating Systems€¦ · Final exam details Closed book, closed notes No computers, phones, calculators, etc. 2 hr. exam –start at 7pm (not 7:10pm!) Focus

482 – The Big Ideas

April 16, 2018 19

Operating System

Hardware

Applications

CPU Disk RAM

Process File system Virtual memory

EECS 482 – Lecture 27

NetworkI/O Devices

Virtual Machine Monitor

Page 15: EECS 482 Introduction to Operating Systems€¦ · Final exam details Closed book, closed notes No computers, phones, calculators, etc. 2 hr. exam –start at 7pm (not 7:10pm!) Focus

482 – The Big Ideas

● Abstraction: Virtualizing a resource◆ CPU à Thread◆ Physical memory à Address space◆ Disk à File system

● Concurrency and consistency◆ Ordering, atomicity, and transactions

April 16, 2018 EECS 482 – Lecture 27 20

Page 16: EECS 482 Introduction to Operating Systems€¦ · Final exam details Closed book, closed notes No computers, phones, calculators, etc. 2 hr. exam –start at 7pm (not 7:10pm!) Focus

482 – The Big Ideas● Caching and exploiting locality

◆ Memory as a cache for disk + LRU eviction

● Indirection◆ Gains power, hurts performance◆ Recover performance via caching◆ Multi-level paging + TLB, inode map in LFS

● Tolerating faults through redundancy◆ RAID, replication

April 16, 2018 EECS 482 – Lecture 27 21

Page 17: EECS 482 Introduction to Operating Systems€¦ · Final exam details Closed book, closed notes No computers, phones, calculators, etc. 2 hr. exam –start at 7pm (not 7:10pm!) Focus

Reminders● Submit peer feedback for Project 4● Submit teaching evaluations

● Final exam: 7-9pm next Monday (April 23rd)◆ Email me if you have a conflict◆ Monitor Piazza for room assignment

● Solve sample exams before review session◆ 12-3pm on April 21st in CHRYS 220

April 16, 2018 EECS 482 – Lecture 27 22

Page 18: EECS 482 Introduction to Operating Systems€¦ · Final exam details Closed book, closed notes No computers, phones, calculators, etc. 2 hr. exam –start at 7pm (not 7:10pm!) Focus

Final exam details● Closed book, closed notes● No computers, phones, calculators, etc.

● 2 hr. exam – start at 7pm (not 7:10pm!)

● Focus is on virtual memory to dist. systems● Includes projects 3 and 4● But first-half topics may be needed

April 16, 2018 EECS 482 – Lecture 27 23

Page 19: EECS 482 Introduction to Operating Systems€¦ · Final exam details Closed book, closed notes No computers, phones, calculators, etc. 2 hr. exam –start at 7pm (not 7:10pm!) Focus

How to study?● Review all of project 3 and project 4● A lot of lecture material not in the projects

● Do sample exams, time yourself◆ Reflect on midterm strengths/weaknesses

● Redo all the discussion questions

● Study groups: ask each other questions◆ Textbook is a good source of questions

April 16, 2018 EECS 482 – Lecture 27 24

Page 20: EECS 482 Introduction to Operating Systems€¦ · Final exam details Closed book, closed notes No computers, phones, calculators, etc. 2 hr. exam –start at 7pm (not 7:10pm!) Focus

Exam-taking tips● Skim problems – answer easiest first● Read coding questions carefully

◆ Think and design before writing code● Don’t get bogged down by any 1 question

◆ Stuck? Answer part of the question well◆ Can get partial credit even on tough questions

● Write down assumptions◆ May not get full credit, helps with partial credit

● Familiarity helps you avoid time pressure

April 16, 2018 EECS 482 – Lecture 27 25

Page 21: EECS 482 Introduction to Operating Systems€¦ · Final exam details Closed book, closed notes No computers, phones, calculators, etc. 2 hr. exam –start at 7pm (not 7:10pm!) Focus

● Good luck for the final!

April 16, 2018 EECS 482 – Lecture 27 26