27
CS423: Operating Systems Design Professor Adam Bates Fall 2018 CS 423 Operating System Design: Overview and Basic Concepts

CS 423 Operating System Design: Overview and Basic Concepts

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

CS423: Operating Systems Design

Professor Adam BatesFall 2018

CS 423 Operating System Design:

Overview and Basic Concepts

CS 423: Operating Systems Design 2

• Learning Objectives: • Introduce OS definition, challenges, and history

• Announcements: • C4 readings for Week 2 are out! Due Jan 26 • MP0 is available on Compass! Due Jan 29• HW0 is available on Compass! Due Jan 29

Goals for Today

Reminder: Please put away devices at the start of class

CS 423: Operating Systems Design 3

What is an operating system?

CS 423: Operating Systems Design 4

Why Operating Systems?Software to manage a computer’s resources for its users and applications.

Web Server Browser Slack Pop Mail

Application Software

Operating System

NetworkHardware

Read/WriteStandard Output

Device Control

File System Communication

CS 423: Operating Systems Design 5

Why Operating Systems?Software to manage a computer’s resources for its users and applications.

Web Server Browser Slack Pop Mail

Application Software

Operating System

NetworkHardware

Read/WriteStandard Output

Device Control

File System Communication

System LibrarySystem Library System LibrarySystem Library

CS 423: Operating Systems Design

The OS exports a user interface. Why?

6

Why Operating Systems?

Web Server Browser Slack Pop Mail

Application Software

Operating System

NetworkHardware

Read/WriteStandard Output

Device Control

File System Communication

Standard Operating System Interface

System LibrarySystem Library System LibrarySystem Library

CS 423: Operating Systems Design

Standard interface increases portability and reduces the need for machine-specific code.

7

Why Operating Systems?

Web Server Browser Slack Pop Mail

Application Software

NetworkHardware

Machine specific part

Read/WriteStandard Output

Device Control

File System Communication

Operating System (machine independent part)

Standard Operating System Interface

System LibrarySystem Library System LibrarySystem Library

CS 423: Operating Systems Design 8

NetworkHardware

Machine specific part

Web Server Browser Slack Pop Mail

Application Software

Read/WriteStandard Output

Device Control

File System Communication

Operating System (machine independent part)

Standard Operating System Interface

Har

dwar

e A

bstr

acti

on

Laye

r

Why Operating Systems?OS Runs on Multiple Platforms while presenting the same Interface:

CS 423: Operating Systems Design 9

What are the responsibilitiesof an operating system?

CS423: Operating Systems Design

Operating System Roles

Role#1:Referee• Manageresourcealloca3onbetweenusers

andapplica3ons• Isolatedifferentusersandapplica3onsfrom

oneanother• Facilitateandmediatecommunica3on

betweendifferentusersandapplica3ons

10

CS423: Operating Systems Design

Operating System Roles

Role#2:Illusionist• Alloweachapplica3ontobelieveithasthe

en3remachinetoitself• CreatetheappearanceofanInfinitenumber

ofprocessors,(near)infinitememory• Abstractawaycomplexityofreliability,

storage,networkcommunica3on…

11

CS423: Operating Systems Design

Operating System Roles

Role#3:Glue• Managehardwaresoapplica3onscanbe

machine-agnos3c• Provideasetofcommonservicesthat

facilitatesharingamongapplica3ons• Examplesof“Glue”OSServices?

12

CS423: Operating Systems Design

Operating System Roles

Role#3:Glue• Managehardwaresoapplica3onscanbe

machine-agnos3c• Provideasetofcommonservicesthat

facilitatesharingamongapplica3ons• Examplesof“Glue”OSServices?• Cut-and-paste,FileI/O,UserInterfaces...

13

CS 423: Operating Systems Design 14

How is the OS a referee?An illusionist?

Glue?

Consider file systems and storage devices…

CS 423: Operating Systems Design

Ex: File System Support

15

Referee•Preventusersfromaccessingeachother’sfileswithout

permission•EvenaUerafileisdele3nganditsspacere-used

Illusionist•Filescangrow(nearly)arbitrarilylarge•Filespersistevenwhenthemachinecrashesinthemiddle

ofasave

Glue•Nameddirectories,prinW,othersystemcallsforFileI/O

CS423: Operating Systems Design

A Question

16

What does an OS need to do in order safely run an untrustworthy application?

CS423: Operating Systems Design

Another Question

17

H o w s h o u l d a n operating system allocate processing t i m e b e t w e e n competing uses?

CS 423: Operating Systems Design

Example: Web Service

18

Client Server index.html

(1) HTTP GET index.html

(4)HTTP web page

(2)Read file: index.html

(3)File data

• Howdoestheservermanagemanysimultaneousclientrequests?

• Howdowekeeptheclientsafefromspywareembeddedinscriptsonawebsite?

• Howdohandlesupdatestothewebsitesuchthatclientsalwaysseeaconsistentview?

CS423: Operating Systems Design

OS Challenges

19

Reliability•Doesthesystemdowhatitwasdesignedtodo?

Availability• Whatpor3onofthe3meisthesystemworking?• MeanTimeToFailure(MTTF),MeanTimetoRepair

Security•Canthesystembecompromisedbyana^acker?

Privacy•Dataisaccessibleonlytoauthorizedusers

CS423: Operating Systems Design

OS Challenges

20

Portability• Forprograms:

Applica3onprogramminginterface(API)Abstractvirtualmachine(AVM)

• ForhardwareHardwareabstrac3onlayer

TCP/IP Networking

Virtual Memory

Hardware-Specific Software and Device Drivers

File System

Scheduling

Graphics Processor

Address TranslationProcessors

Network

Hardware

Users

User-mode

Kernel-modeKernel-user Interface

(Abstract virtual machine)

Hardware Abstraction Layer

APP

SystemLibrary

APP

SystemLibrary

APP

SystemLibrary

Disk

CS423: Operating Systems Design

OS Challenges

21

PerformanceLatency/response3meHowlongdoesanopera3ontaketocomplete?

ThroughputHowmanyopera3onscanbedoneperunitof3me?

OverheadHowmuchextraworkisdonebytheOS?

FairnessHowequalistheperformancereceivedbydifferentusers?

PredictabilityHowconsistentistheperformanceover3me?

CS423: Operating Systems Design

OS Family Tree

22

Descendant

Level 4

Level 5

Level 6

Level 3

Level 2

Level 1

Influence

MVS Multics

MS/DOS VM/370VMS UNIX

Windows BSD UNIX Mach

Windows NT VMWare Linux NEXT MacOS

iOSAndroid

Windows 8 MacOS X

CS423: Operating Systems Design

Performance / Time

23

1.3 Operating Systems: Past, Present, and Future 27

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 network10 Mbps(shared)

100 Mbps(switched)

10 Gbps(switched) 1000

Ratio of usersto computers

100:1 1:1 1:several 100+

Figure 1.8: Approximate computer server performance over time, reflecting the most widely used servers ofeach era: in 1981, a minicomputer; in 1997, a high-end workstation; in 2014, a rack-mounted multicoreserver. MIPS stands for “millions of instructions per second,” a measure of processor performance. The VAX11/782 was introduced in 1982; it achieved 1 MIP. DRAM prices are from Hennessey and Patterson,“Computer Architecture: A Quantitative Approach.” Disk drive prices are from John McCallum. The Hayessmartmodem, introduced in 1981, ran at 300bps. The 10 Mbps shared Ethernet standard was alsointroduced in 1981. One of the authors built his first operating system in 1982, used a VAX at his first job,and owned a Hayes to work from home.

from expensive to cheap devices occurred with telephones over the pasthundred years. Initially, telephone lines were very expensive, and a singleline was shared among everyone in a neighborhood. Over time, of course,both computers and telephones have become cheap enough to sit idle untilwe need them.

Despite these changes, operating systems still face the same conceptualchallenges as they did fifty years ago. To manage computer resources for ap-plications and users, they must allocate resources among applications, providefault isolation and communication services, abstract hardware limitations, andso forth. Tremendous progress has been made towards improving the reliabil-ity, security, efficiency, and portability of operating systems, but much more isneeded. Although we do not know precisely how computing technology orapplication demand will evolve over the next 10-20 years, it is highly likelythat these fundamental operating system challenges will persist.

Early Operating SystemsComputers wereexpensive; users

would wait.The first operating systems were runtime libraries intended to simplify theprogramming of early computer systems. Rather than the tiny, inexpensiveyet massively complex hardware and software systems of today, the firstcomputers often took up an entire floor of a warehouse, cost millions of

CS423: Operating Systems Design

Early Operating Systems

Oneapplica3onata3me• Hadcompletecontrolofhardware• OSwasrun3melibrary• Userswouldstandinlinetousethecomputer

Batchsystems• KeepCPUbusybyhavingaqueueofjobs• OSwouldloadnextjobwhilecurrentoneruns• Userswouldsubmitjobs,andwait,andwait,and

24

CS423: Operating Systems Design

Time-Sharing OSs

25

Mul3pleusersoncomputeratsame3me• Mul3programming:runmul3pleprogramsat

same3me• Interac3veperformance:trytocomplete

everyone’stasksquickly• Ascomputersbecamecheaper,moreimportant

toop3mizeforuser3me,notcomputer3me

CS423: Operating Systems Design

Today’s OSs

26

• Smartphones• Embeddedsystems• Laptops• Tablets• Virtualmachines• Datacenterservers

CS423: Operating Systems Design

Tomorrow’s OSs

27

• Giant-scaledatacenters• Increasingnumbersofprocessorsper

computer• Increasingnumbersofcomputersperuser• Verylargescalestorage