SlideShare a Scribd company logo
cs4414 Fall 2013
University of Virginia
David Evans
Columbus, 28 Feb 2001 Jeonju, 17 June 2002
Class 2-0:
Once Upon a Process
Today’s Main Question
How can several programs
share a processor?
112 September 2013 University of Virginia cs4414
12 September 2013 University of Virginia cs4414 2
Recap:
Last Class
12 September 2013 University of Virginia cs4414 3
Program Computer
Center
Your Program Runs
Program A
Program B
Program C
A
B
A
C
Batch Processing
Multiprogramming
Kinds of Processor-Sharing
Multiprogramming
User program X runs until it gets stuck, then
supervisor program takes over.
Non-preemptive multi-tasking
User program X runs until it decides to let the
supervisor program run.
Preemptive multi-tasking
User program X runs until the (approximately)
supervisor decides to let another program run.
12 September 2013 University of Virginia cs4414 4
Non-preemptive Preemptive
12 September 2013 University of Virginia cs4414 5
12 September 2013 University of Virginia cs4414 6
MULTICS (1969)
UNIX (1975)
PowerMac G5
(Mac OS 9)
2006
MacBook Air
(Mac OS X)
2011
Microsoft
Windows 2.1x
1988
Which have
preemptive
multitasking?
Which have preemptive
multitasking?
12 September 2013 University of Virginia cs4414 7
MULTICS (1969)
UNIX (1975)
PowerMac G5
(Mac OS 9)
2006
MacBook Air
(Mac OS X)
2011
Microsoft
Windows 2.1x
1988
How could I prove it?
12 September 2013 University of Virginia cs4414 8
One-line Proof
12 September 2013 University of Virginia cs4414 9
Quiz
Which are results of preemptive multitasking?
A. A computer running Mac OS X crashes less
than one running Mac OS 9
B. A computer running Mac OS X needs
fewer hard reboots than one running Mac
OS 9
C. When you watch Gangnam Style even for
the 50th time, the video jitters
D. A Senator can play poker on an iPhone
during an important hearing
12 September 2013 University of Virginia cs4414 10
12 September 2013 University of Virginia cs4414 11
How did Apple add preemptive multitasking to Mac OS?
Mac OS X (Cheetah)
24 March 2001
Mac OS 9.2.2
5 Dec 2001
12 September 2013 University of Virginia cs4414 12
http://www.youtube.com/watch?v=YsWBJ_usRck&t=2m18s
(The answer is
probably not in this
movie.)
12 September 2013 University of Virginia cs4414 13
“Once you make them talk, they
won’t be inanimate anymore.”
Steve Jobs (as quoted by Sorkin
earlier in interview)
12 September 2013 University of Virginia cs4414 14
https://upload.wikimedia.org/wikipedia/commons/7/77/Unix_history-simple.svg
12 September 2013 University of Virginia cs4414 15
12 September 2013 University of Virginia cs4414 16
12 September 2013 University of Virginia cs4414 17
12 September 2013 University of Virginia cs4414 18
Tim Berners Lee finishing PS1 23 years early!
12 September 2013 University of Virginia cs4414 19
MULTICS
Unix
BSD
Linux
Minix
Android
NextStep
Mac OS X
iOS
Code (carries license)
“Ideas” (no license,
possible patent lawsuits)
FreeBSD
12 September 2013 University of Virginia cs4414 20
12 September 2013 University of Virginia cs4414 21
12 September 2013 University of Virginia cs4414 22
Non-Malicious
Developers
I am not making this up (really)!:
http://www.pkr.com/en/community/news-events/pkr-for-iphone/
Senator’s Phone
12 September 2013 University of Virginia cs4414 23
So, which API
do I use to
turn on his
microphone?
12 September 2013 University of Virginia cs4414 24
Malicious
Developers
(This one is speculative…)
PRK
senate hearing
Senator’s Phone
Actually just a little harder…
12 September 2013 University of Virginia cs4414 25
Malicious
Developers
Is “App Review” Possible?
12 September 2013 University of Virginia cs4414 26
Ok! Never
turns on
microphone.
Some
program
execution
turns on the
microphone!
12 September 2013 University of Virginia cs4414 27
Not on my
machine, muc
hachas!
What Seems To Be Possible
12 September 2013 University of Virginia cs4414 28
Ok! Never
turns on
microphone.
Some
program
execution
turns on the
microphone!Not
sure…let’s
send it to
NSA just in
case.
12 September 2013 University of Virginia cs4414 29
12 September 2013 University of Virginia cs4414 30
USENIX Security 2013 (click picture for talk video)
What Is Actually Possible
12 September 2013 University of Virginia cs4414 31
Ok! Never
turns on
microphone.
Some
program
execution
turns on the
microphone!Not
sure…let’s
send it to
NSA just in
case.
The Good News!
12 September 2013 University of Virginia cs4414 32
May have been posted by malicious app, not US senator.
How can
preemptive multitasking
even be possible?!?
12 September 2013 University of Virginia cs4414 33
More bad news…?
Preemptive multi-tasking
User program X runs until the supervisor
decides to let another program run.
Preemptive (?) Multitasking
12 September 2013 University of Virginia cs4414 34
Program A
Program B
Program C
A
B
A
Supervisor
Supervisor
Supervisor
A
12 September 2013 University of Virginia cs4414 35
12 September 2013 University of Virginia cs4414 36
Interrupts
12 September 2013 University of Virginia cs4414 37
How frequently
should the
supervisor’s alarm
clock (“kernel
timer interrupt”)
go off to check on
the workers?
My MacBook (Ubuntu)
12 September 2013 University of Virginia cs4414 38
bash-3.2$ uname -a
Darwin Davids-MacBook-Air-2.local 11.4.2 Darwin Kernel
Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-
1699.32.7~1/RELEASE_X86_64 x86_64
bash-3.2$ gcc timer.c ; ./a.out
kernel timer interrupt frequency is approx. 4016 Hz or higher
timer.c is a 50-line C program from
http://www.advenage.com/topics/linux-timer-interrupt-frequency.php (link on notes)
Midterm exemption opportunity:
make a Rust version (and convince me it is accurate)
Timer Interrupts
12 September 2013 University of Virginia cs4414 39
A B
Super
visor
set alarm clock
switch to program A
What makes the alarm clock ring?
Supervisor
set alarm clock
switch to program B
Supervisor
Who interrupts the supervisor?
12 September 2013 University of Virginia cs4414 40
The supervisor’s supervisor!
12 September 2013 University of Virginia cs4414 41
a.k.a. Hypervisor
12 September 2013 University of Virginia cs4414 42
Support for hypervisor added
to Intel x86 in 2005 (VT-x)
12 September 2013 University of Virginia cs4414 43
More general (quite
similar) idea in MULTICS
(but with 8-levels of
supervision in hardware
by 1975)
PS2: The Good Ole Shell
12 September 2013 University of Virginia cs4414 44
$ echo ‘Wha-hoo-wa!’
$ !!
$ traceroute 128.143.22.36
$ id -p ray
$ !!
$ fsck; !mount -u VA!

More Related Content

Similar to Once Upon a Process

What the &~#@<!? (Memory Management in Rust)
What the &~#@<!? (Memory Management in Rust)What the &~#@<!? (Memory Management in Rust)
What the &~#@<!? (Memory Management in Rust)
David Evans
 
Storage Systems
Storage SystemsStorage Systems
Storage Systems
David Evans
 
Access Control
Access ControlAccess Control
Access Control
David Evans
 
Reverse engineering and instrumentation of android apps
Reverse engineering and instrumentation of android appsReverse engineering and instrumentation of android apps
Reverse engineering and instrumentation of android apps
Gaurav Lochan
 
Research @ RELEASeD (presented at SATTOSE2013)
Research @ RELEASeD (presented at SATTOSE2013)Research @ RELEASeD (presented at SATTOSE2013)
Research @ RELEASeD (presented at SATTOSE2013)
kim.mens
 
Predicting Reassignments of Bug Reports — an Exploratory Investigation
Predicting Reassignments of Bug Reports — an Exploratory InvestigationPredicting Reassignments of Bug Reports — an Exploratory Investigation
Predicting Reassignments of Bug Reports — an Exploratory Investigation
Ahmed Lamkanfi
 
Mirage: Extreme Specialization Of Cloud Appliances
Mirage: Extreme Specialization Of Cloud AppliancesMirage: Extreme Specialization Of Cloud Appliances
Mirage: Extreme Specialization Of Cloud Appliances
The Linux Foundation
 
Mirage - Extreme specialization of cloud appliances (OSCON 2013)
Mirage - Extreme specialization of cloud appliances (OSCON 2013)Mirage - Extreme specialization of cloud appliances (OSCON 2013)
Mirage - Extreme specialization of cloud appliances (OSCON 2013)
Amir Chaudhry
 
Lessons I Learned While Scaling to 5000 Puppet Agents
Lessons I Learned While Scaling to 5000 Puppet AgentsLessons I Learned While Scaling to 5000 Puppet Agents
Lessons I Learned While Scaling to 5000 Puppet Agents
Puppet
 
Gc vit sttp cc december 2013
Gc vit sttp cc december 2013Gc vit sttp cc december 2013
Gc vit sttp cc december 2013
Seema Shah
 
Using Git, Pointers in Rust
Using Git, Pointers in RustUsing Git, Pointers in Rust
Using Git, Pointers in Rust
David Evans
 
Smartgears
SmartgearsSmartgears
Smartgears
Fabio Simeoni
 
Robust Stability and Disturbance Analysis of a Class of Networked Control Sys...
Robust Stability and Disturbance Analysis of a Class of Networked Control Sys...Robust Stability and Disturbance Analysis of a Class of Networked Control Sys...
Robust Stability and Disturbance Analysis of a Class of Networked Control Sys...Shadi Nabil Albarqouni
 

Similar to Once Upon a Process (13)

What the &~#@<!? (Memory Management in Rust)
What the &~#@<!? (Memory Management in Rust)What the &~#@<!? (Memory Management in Rust)
What the &~#@<!? (Memory Management in Rust)
 
Storage Systems
Storage SystemsStorage Systems
Storage Systems
 
Access Control
Access ControlAccess Control
Access Control
 
Reverse engineering and instrumentation of android apps
Reverse engineering and instrumentation of android appsReverse engineering and instrumentation of android apps
Reverse engineering and instrumentation of android apps
 
Research @ RELEASeD (presented at SATTOSE2013)
Research @ RELEASeD (presented at SATTOSE2013)Research @ RELEASeD (presented at SATTOSE2013)
Research @ RELEASeD (presented at SATTOSE2013)
 
Predicting Reassignments of Bug Reports — an Exploratory Investigation
Predicting Reassignments of Bug Reports — an Exploratory InvestigationPredicting Reassignments of Bug Reports — an Exploratory Investigation
Predicting Reassignments of Bug Reports — an Exploratory Investigation
 
Mirage: Extreme Specialization Of Cloud Appliances
Mirage: Extreme Specialization Of Cloud AppliancesMirage: Extreme Specialization Of Cloud Appliances
Mirage: Extreme Specialization Of Cloud Appliances
 
Mirage - Extreme specialization of cloud appliances (OSCON 2013)
Mirage - Extreme specialization of cloud appliances (OSCON 2013)Mirage - Extreme specialization of cloud appliances (OSCON 2013)
Mirage - Extreme specialization of cloud appliances (OSCON 2013)
 
Lessons I Learned While Scaling to 5000 Puppet Agents
Lessons I Learned While Scaling to 5000 Puppet AgentsLessons I Learned While Scaling to 5000 Puppet Agents
Lessons I Learned While Scaling to 5000 Puppet Agents
 
Gc vit sttp cc december 2013
Gc vit sttp cc december 2013Gc vit sttp cc december 2013
Gc vit sttp cc december 2013
 
Using Git, Pointers in Rust
Using Git, Pointers in RustUsing Git, Pointers in Rust
Using Git, Pointers in Rust
 
Smartgears
SmartgearsSmartgears
Smartgears
 
Robust Stability and Disturbance Analysis of a Class of Networked Control Sys...
Robust Stability and Disturbance Analysis of a Class of Networked Control Sys...Robust Stability and Disturbance Analysis of a Class of Networked Control Sys...
Robust Stability and Disturbance Analysis of a Class of Networked Control Sys...
 

More from David Evans

Cryptocurrency Jeopardy!
Cryptocurrency Jeopardy!Cryptocurrency Jeopardy!
Cryptocurrency Jeopardy!
David Evans
 
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for CypherpunksTrick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks
David Evans
 
Hidden Services, Zero Knowledge
Hidden Services, Zero KnowledgeHidden Services, Zero Knowledge
Hidden Services, Zero Knowledge
David Evans
 
Anonymity in Bitcoin
Anonymity in BitcoinAnonymity in Bitcoin
Anonymity in Bitcoin
David Evans
 
Midterm Confirmations
Midterm ConfirmationsMidterm Confirmations
Midterm Confirmations
David Evans
 
Scripting Transactions
Scripting TransactionsScripting Transactions
Scripting Transactions
David Evans
 
How to Live in Paradise
How to Live in ParadiseHow to Live in Paradise
How to Live in Paradise
David Evans
 
Bitcoin Script
Bitcoin ScriptBitcoin Script
Bitcoin Script
David Evans
 
Mining Economics
Mining EconomicsMining Economics
Mining Economics
David Evans
 
Mining
MiningMining
Mining
David Evans
 
The Blockchain
The BlockchainThe Blockchain
The Blockchain
David Evans
 
Becoming More Paranoid
Becoming More ParanoidBecoming More Paranoid
Becoming More Paranoid
David Evans
 
Asymmetric Key Signatures
Asymmetric Key SignaturesAsymmetric Key Signatures
Asymmetric Key Signatures
David Evans
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
David Evans
 
Class 1: What is Money?
Class 1: What is Money?Class 1: What is Money?
Class 1: What is Money?
David Evans
 
Multi-Party Computation for the Masses
Multi-Party Computation for the MassesMulti-Party Computation for the Masses
Multi-Party Computation for the Masses
David Evans
 
Proof of Reserve
Proof of ReserveProof of Reserve
Proof of Reserve
David Evans
 
Silk Road
Silk RoadSilk Road
Silk Road
David Evans
 
Blooming Sidechains!
Blooming Sidechains!Blooming Sidechains!
Blooming Sidechains!
David Evans
 
Useful Proofs of Work, Permacoin
Useful Proofs of Work, PermacoinUseful Proofs of Work, Permacoin
Useful Proofs of Work, Permacoin
David Evans
 

More from David Evans (20)

Cryptocurrency Jeopardy!
Cryptocurrency Jeopardy!Cryptocurrency Jeopardy!
Cryptocurrency Jeopardy!
 
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for CypherpunksTrick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks
 
Hidden Services, Zero Knowledge
Hidden Services, Zero KnowledgeHidden Services, Zero Knowledge
Hidden Services, Zero Knowledge
 
Anonymity in Bitcoin
Anonymity in BitcoinAnonymity in Bitcoin
Anonymity in Bitcoin
 
Midterm Confirmations
Midterm ConfirmationsMidterm Confirmations
Midterm Confirmations
 
Scripting Transactions
Scripting TransactionsScripting Transactions
Scripting Transactions
 
How to Live in Paradise
How to Live in ParadiseHow to Live in Paradise
How to Live in Paradise
 
Bitcoin Script
Bitcoin ScriptBitcoin Script
Bitcoin Script
 
Mining Economics
Mining EconomicsMining Economics
Mining Economics
 
Mining
MiningMining
Mining
 
The Blockchain
The BlockchainThe Blockchain
The Blockchain
 
Becoming More Paranoid
Becoming More ParanoidBecoming More Paranoid
Becoming More Paranoid
 
Asymmetric Key Signatures
Asymmetric Key SignaturesAsymmetric Key Signatures
Asymmetric Key Signatures
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
 
Class 1: What is Money?
Class 1: What is Money?Class 1: What is Money?
Class 1: What is Money?
 
Multi-Party Computation for the Masses
Multi-Party Computation for the MassesMulti-Party Computation for the Masses
Multi-Party Computation for the Masses
 
Proof of Reserve
Proof of ReserveProof of Reserve
Proof of Reserve
 
Silk Road
Silk RoadSilk Road
Silk Road
 
Blooming Sidechains!
Blooming Sidechains!Blooming Sidechains!
Blooming Sidechains!
 
Useful Proofs of Work, Permacoin
Useful Proofs of Work, PermacoinUseful Proofs of Work, Permacoin
Useful Proofs of Work, Permacoin
 

Recently uploaded

Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 

Recently uploaded (20)

Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 

Once Upon a Process

  • 1. cs4414 Fall 2013 University of Virginia David Evans Columbus, 28 Feb 2001 Jeonju, 17 June 2002 Class 2-0: Once Upon a Process
  • 2. Today’s Main Question How can several programs share a processor? 112 September 2013 University of Virginia cs4414
  • 3. 12 September 2013 University of Virginia cs4414 2
  • 4. Recap: Last Class 12 September 2013 University of Virginia cs4414 3 Program Computer Center Your Program Runs Program A Program B Program C A B A C Batch Processing Multiprogramming
  • 5. Kinds of Processor-Sharing Multiprogramming User program X runs until it gets stuck, then supervisor program takes over. Non-preemptive multi-tasking User program X runs until it decides to let the supervisor program run. Preemptive multi-tasking User program X runs until the (approximately) supervisor decides to let another program run. 12 September 2013 University of Virginia cs4414 4
  • 6. Non-preemptive Preemptive 12 September 2013 University of Virginia cs4414 5
  • 7. 12 September 2013 University of Virginia cs4414 6 MULTICS (1969) UNIX (1975) PowerMac G5 (Mac OS 9) 2006 MacBook Air (Mac OS X) 2011 Microsoft Windows 2.1x 1988 Which have preemptive multitasking?
  • 8. Which have preemptive multitasking? 12 September 2013 University of Virginia cs4414 7 MULTICS (1969) UNIX (1975) PowerMac G5 (Mac OS 9) 2006 MacBook Air (Mac OS X) 2011 Microsoft Windows 2.1x 1988
  • 9. How could I prove it? 12 September 2013 University of Virginia cs4414 8
  • 10. One-line Proof 12 September 2013 University of Virginia cs4414 9
  • 11. Quiz Which are results of preemptive multitasking? A. A computer running Mac OS X crashes less than one running Mac OS 9 B. A computer running Mac OS X needs fewer hard reboots than one running Mac OS 9 C. When you watch Gangnam Style even for the 50th time, the video jitters D. A Senator can play poker on an iPhone during an important hearing 12 September 2013 University of Virginia cs4414 10
  • 12. 12 September 2013 University of Virginia cs4414 11 How did Apple add preemptive multitasking to Mac OS? Mac OS X (Cheetah) 24 March 2001 Mac OS 9.2.2 5 Dec 2001
  • 13. 12 September 2013 University of Virginia cs4414 12 http://www.youtube.com/watch?v=YsWBJ_usRck&t=2m18s (The answer is probably not in this movie.)
  • 14. 12 September 2013 University of Virginia cs4414 13 “Once you make them talk, they won’t be inanimate anymore.” Steve Jobs (as quoted by Sorkin earlier in interview)
  • 15. 12 September 2013 University of Virginia cs4414 14 https://upload.wikimedia.org/wikipedia/commons/7/77/Unix_history-simple.svg
  • 16. 12 September 2013 University of Virginia cs4414 15
  • 17. 12 September 2013 University of Virginia cs4414 16
  • 18. 12 September 2013 University of Virginia cs4414 17
  • 19. 12 September 2013 University of Virginia cs4414 18 Tim Berners Lee finishing PS1 23 years early!
  • 20. 12 September 2013 University of Virginia cs4414 19 MULTICS Unix BSD Linux Minix Android NextStep Mac OS X iOS Code (carries license) “Ideas” (no license, possible patent lawsuits) FreeBSD
  • 21. 12 September 2013 University of Virginia cs4414 20
  • 22. 12 September 2013 University of Virginia cs4414 21
  • 23. 12 September 2013 University of Virginia cs4414 22 Non-Malicious Developers I am not making this up (really)!: http://www.pkr.com/en/community/news-events/pkr-for-iphone/ Senator’s Phone
  • 24. 12 September 2013 University of Virginia cs4414 23 So, which API do I use to turn on his microphone?
  • 25. 12 September 2013 University of Virginia cs4414 24 Malicious Developers (This one is speculative…) PRK senate hearing Senator’s Phone
  • 26. Actually just a little harder… 12 September 2013 University of Virginia cs4414 25 Malicious Developers
  • 27. Is “App Review” Possible? 12 September 2013 University of Virginia cs4414 26 Ok! Never turns on microphone. Some program execution turns on the microphone!
  • 28. 12 September 2013 University of Virginia cs4414 27 Not on my machine, muc hachas!
  • 29. What Seems To Be Possible 12 September 2013 University of Virginia cs4414 28 Ok! Never turns on microphone. Some program execution turns on the microphone!Not sure…let’s send it to NSA just in case.
  • 30. 12 September 2013 University of Virginia cs4414 29
  • 31. 12 September 2013 University of Virginia cs4414 30 USENIX Security 2013 (click picture for talk video)
  • 32. What Is Actually Possible 12 September 2013 University of Virginia cs4414 31 Ok! Never turns on microphone. Some program execution turns on the microphone!Not sure…let’s send it to NSA just in case.
  • 33. The Good News! 12 September 2013 University of Virginia cs4414 32 May have been posted by malicious app, not US senator.
  • 34. How can preemptive multitasking even be possible?!? 12 September 2013 University of Virginia cs4414 33 More bad news…? Preemptive multi-tasking User program X runs until the supervisor decides to let another program run.
  • 35. Preemptive (?) Multitasking 12 September 2013 University of Virginia cs4414 34 Program A Program B Program C A B A Supervisor Supervisor Supervisor A
  • 36. 12 September 2013 University of Virginia cs4414 35
  • 37. 12 September 2013 University of Virginia cs4414 36
  • 38. Interrupts 12 September 2013 University of Virginia cs4414 37 How frequently should the supervisor’s alarm clock (“kernel timer interrupt”) go off to check on the workers?
  • 39. My MacBook (Ubuntu) 12 September 2013 University of Virginia cs4414 38 bash-3.2$ uname -a Darwin Davids-MacBook-Air-2.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu- 1699.32.7~1/RELEASE_X86_64 x86_64 bash-3.2$ gcc timer.c ; ./a.out kernel timer interrupt frequency is approx. 4016 Hz or higher timer.c is a 50-line C program from http://www.advenage.com/topics/linux-timer-interrupt-frequency.php (link on notes) Midterm exemption opportunity: make a Rust version (and convince me it is accurate)
  • 40. Timer Interrupts 12 September 2013 University of Virginia cs4414 39 A B Super visor set alarm clock switch to program A What makes the alarm clock ring? Supervisor set alarm clock switch to program B Supervisor
  • 41. Who interrupts the supervisor? 12 September 2013 University of Virginia cs4414 40
  • 42. The supervisor’s supervisor! 12 September 2013 University of Virginia cs4414 41 a.k.a. Hypervisor
  • 43. 12 September 2013 University of Virginia cs4414 42 Support for hypervisor added to Intel x86 in 2005 (VT-x)
  • 44. 12 September 2013 University of Virginia cs4414 43 More general (quite similar) idea in MULTICS (but with 8-levels of supervision in hardware by 1975)
  • 45. PS2: The Good Ole Shell 12 September 2013 University of Virginia cs4414 44 $ echo ‘Wha-hoo-wa!’ $ !! $ traceroute 128.143.22.36 $ id -p ray $ !! $ fsck; !mount -u VA!