Opera&ng Systems: Principles and Prac&ce Tom - - PowerPoint PPT Presentation
Opera&ng Systems: Principles and Prac&ce Tom - - PowerPoint PPT Presentation
Opera&ng Systems: Principles and Prac&ce Tom Anderson How This Course Fits in the UW CSE Curriculum CSE 333: Systems Programming Project
How ¡This ¡Course ¡Fits ¡in ¡the ¡UW ¡CSE ¡ Curriculum ¡
- CSE ¡333: ¡Systems ¡Programming ¡
– Project ¡experience ¡in ¡C/C++ ¡ – How ¡to ¡use ¡the ¡opera&ng ¡system ¡interface ¡
- CSE ¡451: ¡Opera&ng ¡Systems ¡
– How ¡to ¡make ¡a ¡single ¡computer ¡work ¡reliably ¡ – How ¡an ¡opera&ng ¡system ¡works ¡internally ¡
- CSE ¡452: ¡Distributed ¡Systems ¡
– How ¡to ¡make ¡a ¡set ¡of ¡computers ¡work ¡reliably, ¡ despite ¡failures ¡of ¡some ¡nodes ¡
Project: ¡OS/161 ¡
- Build ¡an ¡opera&ng ¡system ¡ ¡
– That ¡can ¡boot ¡on ¡a ¡mul&processor ¡
- We ¡give ¡you ¡some ¡basic ¡building ¡blocks ¡
– Three ¡assignments, ¡that ¡build ¡on ¡each ¡other ¡
- Threads, ¡user ¡programs, ¡virtual ¡memory ¡
– Work ¡in ¡groups ¡of ¡2-‑3 ¡(recommend ¡3!) ¡
- Instruc&ons ¡on ¡web ¡page ¡
– Download ¡and ¡browse ¡code ¡before ¡sec&on ¡ – Bring ¡laptop ¡or ¡smartphone ¡to ¡sec&on ¡
- Assignment ¡0 ¡due ¡next ¡Thursday ¡
Problem ¡Sets ¡
- Two ¡parts, ¡equivalent ¡to ¡a ¡final ¡
– Done ¡individually ¡
Main ¡Points ¡(for ¡today) ¡
- Opera&ng ¡system ¡defini&on ¡
– SoZware ¡to ¡manage ¡a ¡computer’s ¡resources ¡for ¡its ¡ users ¡and ¡applica&ons ¡
- OS ¡challenges ¡
– Reliability, ¡security, ¡responsiveness, ¡portability, ¡… ¡
- OS ¡history ¡
– How ¡are ¡OS ¡X, ¡iOS, ¡Windows ¡10, ¡Android, ¡and ¡ Linux ¡related? ¡
What ¡is ¡an ¡
- pera&ng ¡system? ¡
- SoZware ¡to ¡
manage ¡a ¡ computer’s ¡ resources ¡for ¡its ¡ users ¡and ¡ applica&ons ¡
TCP/IP Networking Virtual Memory Hardware-Specific Software and Device Drivers File System Scheduling Graphics Processor Address Translation Processors Network
Hardware Users User-mode Kernel-mode
Kernel-user Interface (Abstract virtual machine) Hardware Abstraction Layer APP System Library APP System Library APP System Library Disk
Opera&ng ¡System ¡Roles ¡
- Referee: ¡
– Resource ¡alloca&on ¡among ¡users, ¡applica&ons ¡ – Isola&on ¡of ¡different ¡users, ¡applica&ons ¡from ¡each ¡other ¡ – Communica&on ¡between ¡users, ¡applica&ons ¡
- Illusionist ¡
– Each ¡applica&on ¡appears ¡to ¡have ¡the ¡en&re ¡machine ¡to ¡ itself ¡ – Infinite ¡number ¡of ¡processors, ¡(near) ¡infinite ¡amount ¡of ¡ memory, ¡reliable ¡storage, ¡reliable ¡network ¡transport ¡
- Glue ¡
– Libraries, ¡user ¡interface ¡widgets, ¡… ¡
Example: ¡File ¡Systems ¡
- Referee ¡
– Prevent ¡users ¡from ¡accessing ¡each ¡other’s ¡files ¡ without ¡permission ¡ – Even ¡aZer ¡a ¡file ¡is ¡deleted ¡and ¡its ¡space ¡re-‑used ¡
- Illusionist ¡
– Files ¡can ¡grow ¡(nearly) ¡arbitrarily ¡large ¡ – Files ¡persist ¡even ¡when ¡the ¡machine ¡crashes ¡in ¡the ¡ middle ¡of ¡a ¡save ¡
- Glue ¡
– Named ¡directories, ¡prine, ¡… ¡
Ques&on ¡
- What ¡(hardware, ¡soZware) ¡do ¡you ¡need ¡to ¡be ¡
able ¡to ¡run ¡an ¡untrustworthy ¡applica&on? ¡
Ques&on ¡
- How ¡should ¡an ¡opera&ng ¡system ¡allocate ¡
processing ¡&me ¡between ¡compe&ng ¡uses? ¡
– Give ¡the ¡CPU ¡to ¡the ¡first ¡to ¡arrive? ¡ – To ¡the ¡one ¡that ¡needs ¡the ¡least ¡resources ¡to ¡ complete? ¡ ¡ ¡To ¡the ¡one ¡that ¡needs ¡the ¡most ¡ resources? ¡
Example: ¡web ¡service ¡
- How ¡does ¡the ¡server ¡manage ¡many ¡simultaneous ¡
client ¡requests? ¡
- How ¡do ¡we ¡keep ¡the ¡client ¡safe ¡from ¡spyware ¡
embedded ¡in ¡scripts ¡on ¡a ¡web ¡site? ¡
- How ¡do ¡make ¡updates ¡to ¡the ¡web ¡site ¡so ¡that ¡clients ¡
always ¡see ¡a ¡consistent ¡view? ¡
Client Server index.html (1)
HTTP GET index.html
(4)
HTTP web page
(2)
Read file: index.html
(3)
File data
OS ¡Challenges ¡
- Reliability ¡
– Does ¡the ¡system ¡do ¡what ¡it ¡was ¡designed ¡to ¡do? ¡
- Availability ¡
– What ¡por&on ¡of ¡the ¡&me ¡is ¡the ¡system ¡working? ¡ – Mean ¡Time ¡To ¡Failure ¡(MTTF), ¡Mean ¡Time ¡to ¡Repair ¡
- Security ¡
– Can ¡the ¡system ¡be ¡compromised ¡by ¡an ¡agacker? ¡
- Privacy ¡
– ¡Data ¡is ¡accessible ¡only ¡to ¡authorized ¡users ¡
OS ¡Challenges ¡
- Portability ¡
– For ¡programs: ¡
- Applica&on ¡programming ¡
interface ¡(API) ¡
- Abstract ¡virtual ¡machine ¡
(AVM) ¡
– For ¡the ¡opera&ng ¡system ¡
- Hardware ¡abstrac&on ¡
layer ¡
TCP/IP Networking Virtual Memory Hardware-Specific Software and Device Drivers File System Scheduling Graphics Processor Address Translation Processors Network
Hardware Users User-mode Kernel-mode
Kernel-user Interface (Abstract virtual machine) Hardware Abstraction Layer APP System Library APP System Library APP System Library Disk
OS ¡Challenges ¡
- Performance ¡
– Latency/response ¡&me ¡
- How ¡long ¡does ¡an ¡opera&on ¡take ¡to ¡complete? ¡
– Throughput ¡
- How ¡many ¡opera&ons ¡can ¡be ¡done ¡per ¡unit ¡of ¡&me? ¡
– Overhead ¡
- How ¡much ¡extra ¡work ¡is ¡done ¡by ¡the ¡OS? ¡
– Fairness ¡
- How ¡equal ¡is ¡the ¡performance ¡received ¡by ¡different ¡users? ¡
– Predictability ¡
- How ¡consistent ¡is ¡the ¡performance ¡over ¡&me? ¡
OS ¡History ¡
Descendant Influence
MVS Multics MS/DOS VM/370 VMS UNIX Windows BSD UNIX Mach Windows NT VMWare Linux NEXT MacOS iOS Android Windows 8 MacOS X
Computer ¡Performance ¡Over ¡Time ¡
1981 1997 2014 Factor (2014/1981) Uniprocessor speed (MIPS) 1 200 2500 2.5K CPUs per computer 1 1 10+ 10+ Processor MIPS/$ $100K $25 $0.20 500K DRAM Capacity (MiB)/$ 0.002 2 1K 500K Disk Capacity (GiB)/$ 0.003 7 25K 10M Home Internet 300 bps 256 Kbps 20 Mbps 100K Machine room network 10 Mbps (shared) 100 Mbps (switched) 10 Gbps (switched) 1000 Ratio of users to computers 100:1 1:1 1:several 100+
Early ¡Opera&ng ¡Systems: ¡ Computers ¡Very ¡Expensive ¡
- One ¡applica&on ¡at ¡a ¡&me ¡
– Had ¡complete ¡control ¡of ¡hardware ¡ – OS ¡was ¡run&me ¡library ¡ – Users ¡would ¡stand ¡in ¡line ¡to ¡use ¡the ¡computer ¡
- Batch ¡systems ¡
– Keep ¡CPU ¡busy ¡by ¡having ¡a ¡queue ¡of ¡jobs ¡ – OS ¡would ¡load ¡next ¡job ¡while ¡current ¡one ¡runs ¡ – Users ¡would ¡submit ¡jobs, ¡and ¡wait, ¡and ¡wait, ¡and ¡ ¡
Time-‑Sharing ¡Opera&ng ¡Systems: ¡ Computers ¡and ¡People ¡Expensive ¡
- Mul&ple ¡users ¡on ¡computer ¡at ¡same ¡&me ¡
– Mul&programming: ¡run ¡mul&ple ¡programs ¡at ¡ same ¡&me ¡ – Interac&ve ¡performance: ¡try ¡to ¡complete ¡ everyone’s ¡tasks ¡quickly ¡ – As ¡computers ¡became ¡cheaper, ¡more ¡important ¡ to ¡op&mize ¡for ¡user ¡&me, ¡not ¡computer ¡&me ¡
Today’s ¡Opera&ng ¡Systems: ¡ Computers ¡Cheap ¡
- Smartphones ¡
- Embedded ¡systems ¡
- Laptops ¡
- Tablets ¡
- Virtual ¡machines ¡
- Data ¡center ¡servers ¡
Tomorrow’s ¡Opera&ng ¡Systems ¡
- Giant-‑scale ¡data ¡centers ¡
- Increasing ¡numbers ¡of ¡processors ¡per ¡
computer ¡
- Increasing ¡numbers ¡of ¡computers ¡per ¡user ¡
- Very ¡large ¡scale ¡storage ¡
Textbook ¡
- Lazowska, ¡Spring ¡2012: ¡“The ¡text ¡is ¡quite ¡
sophis&cated. ¡You ¡won't ¡get ¡it ¡all ¡on ¡the ¡first ¡
- pass. ¡The ¡right ¡approach ¡is ¡to ¡[read ¡each ¡