Opera&ng Systems: Principles and Prac&ce Tom - - PowerPoint PPT Presentation

opera ng systems principles and prac ce
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Opera&ng ¡Systems: ¡ ¡ Principles ¡and ¡Prac&ce ¡

Tom ¡Anderson ¡

slide-2
SLIDE 2

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 ¡

slide-3
SLIDE 3

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 ¡
slide-4
SLIDE 4

Problem ¡Sets ¡

  • Two ¡parts, ¡equivalent ¡to ¡a ¡final ¡

– Done ¡individually ¡

slide-5
SLIDE 5

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? ¡

slide-6
SLIDE 6

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

slide-7
SLIDE 7

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, ¡… ¡

slide-8
SLIDE 8

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, ¡… ¡

slide-9
SLIDE 9

Ques&on ¡

  • What ¡(hardware, ¡soZware) ¡do ¡you ¡need ¡to ¡be ¡

able ¡to ¡run ¡an ¡untrustworthy ¡applica&on? ¡

slide-10
SLIDE 10

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? ¡

slide-11
SLIDE 11

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

slide-12
SLIDE 12

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 ¡

slide-13
SLIDE 13

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

slide-14
SLIDE 14

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? ¡
slide-15
SLIDE 15

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

slide-16
SLIDE 16

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+

slide-17
SLIDE 17

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 ¡ ¡

slide-18
SLIDE 18

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 ¡

slide-19
SLIDE 19

Today’s ¡Opera&ng ¡Systems: ¡ Computers ¡Cheap ¡

  • Smartphones ¡
  • Embedded ¡systems ¡
  • Laptops ¡
  • Tablets ¡
  • Virtual ¡machines ¡
  • Data ¡center ¡servers ¡
slide-20
SLIDE 20

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 ¡
slide-21
SLIDE 21

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 ¡

chapter ¡before ¡class ¡and] ¡re-­‑read ¡each ¡ chapter ¡once ¡we've ¡covered ¡the ¡ corresponding ¡material… ¡more ¡of ¡it ¡will ¡make ¡ sense ¡then. ¡Don't ¡save ¡this ¡re-­‑reading ¡un2l ¡ right ¡before ¡the ¡mid-­‑term ¡or ¡final ¡– ¡keep ¡up.” ¡