Lec1 424 002
Lec1 424 002
Lec1 424 002
Greatest Artifact of Human Civilization…
HTTP 0.9
DN creat Search
request resul Index
page
Page
store
Load
balancer
Ad Server
Interactive is important
Ask Questions!
appl n
appln
appln
OS
Hardware
Operator …
Switchboard Operator
Computer Operators
OS
Ctrlr
Networks
storage
Displays
Inputs
Processor
Networks
storage
Displays
Inputs
1/21/20 Kubiatowicz CS162 © UCB Fall 2020 12
Hardware ISA
Memory
Processor
OS
Networks
storage
Displays
Inputs
1/21/20 Kubiatowicz CS162 © UCB Fall 2020 13
Defn: Process
• Address Spac
• One or more threads of contro
• Additional system state associated with i
• Thread:
– locus of control (PC
– Its registers (processor state when running
– And its “stack” (SP
» As required by programming language runtime
For Example …
Hardware ISA
Memory
Processor
OS
Networks
storage
Displays
Inputs
1/21/20 Kubiatowicz CS162 © UCB Fall 2020 16
What is an Operating System?
• Refere
– Manage sharing of resources, Protection, Isolatio
» Resource allocation, isolation, communicatio
• Illusionis
– Provide clean, easy to use abstractions of physical
resource
» Infinite memory, dedicated machin
» Higher level objects: files, users, message
» Masking limitations, virtualization
Hardware ISA
Memory
Processor Protection
Boundary
OS
Networks
storage
Displays
Inputs
1/21/20 Kubiatowicz CS162 © UCB Fall 2020 18
What is an Operating System?
• Refere
– Manage sharing of resources, Protection, Isolatio
» Resource allocation, isolation, communicatio
• Illusionis
– Provide clean, easy to use abstractions of physical
resource
» Infinite memory, dedicated machin
» Higher level objects: files, users, message
» Masking limitations, virtualizatio
• Glu
– Common service
» Storage, Window system, Networkin
» Sharing, Authorizatio
» Look and feel
OS Basics: I/O
Threads
Address Spaces Windows
Processes Files Sockets
Hardware ISA
Memory
Processor Protection
Boundary
OS
Ctrlr
Networks
storage
Displays
Inputs
1/21/20 Kubiatowicz CS162 © UCB Fall 2020 20
OS Basics: Creating Process/Loading Program
Threads
Address Spaces Windows
Processes Files Sockets
Hardware ISA
Memory
Processor Protection
Boundary
OS
Ctrlr
Networks
storage
Displays
Inputs
1/21/20 Kubiatowicz CS162 © UCB Fall 2020 21
What makes Operating Systems
Exciting and Challenging?
Moore’s Law
1000
Performance (vs. VAX-11/780)
52%/year
100
ManyCore Chips: The future arrived in 2007
• Intel 80-core multicore chip (Feb 2007
– 80 simple cores
– Two FP-engines / core
– Mesh-like network
– 100 million transistors
– 65nm feature size
• Intel Single-Chip Cloud
Computer (August 2010)
– 24 “tiles” with two cores/tile
– 24-router mesh network
– 4 DDR3 memory controllers
– Hardware support for message-passing
)
HDD
(source: https://www.networkworld.com/article/3153244/data-center/solid-state-drives-are-now-larger-than-
hard-disk-drives-the-impact-for-your-data-center.html)
1/21/20 Kubiatowicz CS162 © UCB Fall 2020 28
Network Capacity Still Increasing
(source: http://www.ospmag.com/issue/article/Time-Is-Not-Always-On-Our-Side )
1/21/20 Kubiatowicz CS162 © UCB Fall 2020 29
Internet Scale: 1.06 Billion Hosts (Jan 2017)
(source: http://www.internetworldstats.com/stats.htm)
Mini
1:103
Workstation
Productivity
PC Interactive
Laptop
1:1
PDA
Cell Streaming from/
to the physical
103:1 world
Mote!
years
The Internet of
Bell’s Law: new computer class per 10 years
Things!
Databases
Information Collection
Remote Storage
Online Games
Commerce
…
MEMS for
Sensor Nets
1/21/20 Kubiatowicz CS162 © UCB Fall 2020 35
g
Syllabus
• OS Concepts: How to Navigate as a Systems Programmer
– Process, I/O, Networks and Virtual Machine
• Concurrenc
– Threads, scheduling, locks, deadlock, scalability, fairnes
• Address Spac
– Virtual memory, address translation, protection, sharin
• File System
– I/O devices, file objects, storage, naming, caching, performance, paging,
transactions, database
• Distributed System
– Protocols, N-Tiers, RPC, NFS, DHTs, Consistency, Scalability, multicas
• Reliability & Securit
– Fault tolerance, protection, securit
• Cloud Infrastructure
Learning by Doing
• Individual Homework: Learn Systems Programmin
1. Tools, Autograding, recall C, executabl
2. Simple Shel
3. Web serve
4. Memory Managemen
• Three Group Projects (Pintos in C
1. Threads & Scheduling
2. User-program
3. File Systems
Group Projects
• Project teams have 4 members
• Must work in groups in “the real world
• Communicate with colleagues (team members
• Communication problems are natura
• What have you done
• What answers you need from others
• Dividing up by Task is the worst approach. Work as a team
• You must document your work!!
• Communicate with supervisor (TAs
• What is the team’s plan
• What is each member’s responsibility
• Short progress reports are require
• Design Documents: High-level description for a manager!
Getting started
• Start homework 0 right away (hopefully Today!
– Vagrant virtualbox – VM environment for the cours
» Consistent, managed environment on your machin
– Get familiar with all the tool
– Submit to autograder via gi
• Early Dro
– Given the assignments, this is a highly rewarding but time consuming cours
– If you are not serious about taking, please drop early
Grading
• 15% Midterm
• 20% Final
• 25% Homewor
• 40% Group HWs
• Group HWs gradin
• [10 pts] Initial desig
• [10 pts] Design revie
• [10 pts] Design documen
• [60 pts] Code (3 checkpoints
• [10 pts] Final desig
• Submission via git push to release branc
• Regular git push so TA sees your progress
Challenge: Complexity
• Applications consisting of
– … a variety of software modules that
– … run on a variety of devices (machines) tha
» … implement different hardware architecture
» … run competing application
» … fail in unexpected way
» … can be under a variety of attack
t
Proc
Caches
Busses
adapters
Memory
Controllers
Disks
I/O Devices: Displays
Networks
Keyboards
1/21/20 Kubiatowicz CS162 © UCB Fall 2020 47
Increasing Software Complexity
Linux 2.2.0
Firefox
Android
Windows 7
Windows Vista
Mac OS X "Tiger"
Modern Car
0 30 60 90 120
e
)
Virtual Machines
• Software emulation of an abstract machin
– Give programs illusion they own the machin
– Make it look like hardware has features you wan
• Two types of “Virtual Machine”
– Process VM: supports the execution of a single program; this
functionality typically provided by O
– System VM: supports the execution of an entire OS and its applications
(e.g., VMWare Fusion, Virtual box, Parallels Desktop, Xen)
Process VMs
• Programming simplicit
– Each process thinks it has all memory/CPU tim
– Each process thinks it owns all device
– Different devices appear to have same high level interfac
– Device interfaces more powerful than raw hardwar
» Bitmapped display ⇒ windowing syste
» Ethernet card ⇒ reliable, ordered, networking (TCP/IP
• Fault Isolatio
– Processes unable to directly impact other processe
– Bugs cannot crash whole machin
• Protection and Portabilit
– Java interface safe and stable across many platforms
“In conclusion…”
• Operating systems provide a virtual machine abstraction to handle
diverse hardwar
– Operating systems simplify application development by providing
standard service
• Operating systems coordinate resources and protect users from
each othe
– Operating systems can provide an array of fault containment, fault
tolerance, and fault recover