Logist ics Cour se Web Page 1: Welcome and Overview Mailing List - - PDF document

logist ics
SMART_READER_LITE
LIVE PREVIEW

Logist ics Cour se Web Page 1: Welcome and Overview Mailing List - - PDF document

Logist ics Cour se Web Page 1: Welcome and Overview Mailing List St af f Text book Last Modif ied: 6/ 1/ 2004 11:53 AM -1 -2 Topics What is an operat ing syst em? OS Hist ory, Archit ect ural Support A sof t ware


slide-1
SLIDE 1

1

  • 1

1: Welcome and Overview

Last Modif ied: 6/ 1/ 2004 11:53 AM

  • 2

Logist ics

Cour se Web Page Mailing List St af f Text book

  • 3

Topics

OS Hist ory, Archit ect ural Support Processes, Threads Scheduling Synchronizat ion, Deadlock Memory Management File Syst ems, I O Devices Net works, Dist ribut ed Syst ems Securit y

  • 4

What is an operat ing syst em?

A sof t ware layer t hat

manages har dwar e r esour ces pr ovides an abst r act ion of t he under lying

har dwar e t hat is easier t o pr ogr am and use

Applicat ions Operat ing Syst ems Hardware

  • 5

Hardware Resources

CPU, Funct ional Unit s, Regist er s Main memor y access St or age devices (disk dr ives, CD-ROMs, t ape

drives)

Net wor k I nt er f ace Car ds Human I / O devices (keyboar ds, monit or s, mice) Ot her ? Pr int er s, camer as, sensor s, …

How much do you know about what it would be like t o int er act wit h t hese devices wit hout an OS?

  • 6

Benef it s of Operat ing Syst ems (1)

Abst ract ing t he Hardware

Gor y det ails of t he r aw har dwar e hidden so

applicat ions can be smaller and simpler

Applicat ion wr it er s can pr ogr am t o a simpler

and mor e por t able “vir t ual machine” Providing usef ul logical abst ract ions

New t ypes of logical r esour ces (socket s, pipes)

slide-2
SLIDE 2

2

  • 7

Benef it s of Operat ing Syst ems (2)

P

rot ect ing applicat ions f rom each ot her

Enf or ce “f air ” allocat ion of har dwar e r esour ces

among applicat ions

Policies t hat say what is “f air ” and mechanisms

t o enf or ce it Support ing communicat ion and coordinat ion

among applicat ions

Suppor t abst r act ions t hr ough which dif f er ent

applicat ions can shar e dat a and not if y each

  • t her of event s
  • 8

What an operat ing syst em is not ?

Compiler St andard libraries Command Shells These are closely relat ed pieces of syst em

sof t ware, but t hey are not t he OS.

  • 9

I s OS code like ot her code?

Most OSs implement ed in C Developed wit hout space-age development

envir onment s (ker nel debugger s?)

The buck st ops her e!

OS must deal wit h gory hardware det ails

  • Tr y t o keep har dwar e dependent par t s isolat ed

What happens when get a device int errupt in t he middle

  • f execut ing an applicat ion? What happens when get a

device int errupt while servicing anot her device int errupt ?

What happens if you t ake a page f ault while execut ing

  • perat ing syst em code

Per f or mance and r eliabilit y ar e cr ucial! St ill a lot mor e like applicat ion code t han you

might t hink

  • 10

Lot s of variet y of OSes

Unix (Solaris, HP-UX, AI X, FreeBSD,

Net BSD,OpenBSD..)

Linux Windows XP, 2000, NT, ME, 98, 95 BeOS MacOS PalmOS WindowsCE Mach, Amoeba, Sprit e, Vino, SPI N, QnX,…

  • 11

What dist inguishes operat ing syst ems?

When people t alk about which operat ing

syst em t o run, t hey of t en t alk about :

Look and f eel of t he deskt op windowing syst em Devices t hat ar e suppor t ed What har dwar e plat f or ms does it r un on? Applicat ions t hat ar e available f or t hat OS Who developed t he code? Who suppor t s t he

code?

How of t en does t he syst em cr ash? Reliabilit y? Do you pay f or it ?

Are t hese really core OS issues?

  • 12

Core OS I ssues: OS St ruct ure

How is t he OS st r uct ur ed?

One monolit hic kernel of spaghet t i code One monolit hic kernel t hat is int ernally composed of

dist inct layers

One monolit hic kernel t hat is int ernally composed of

dist inct obj ect s

Micro-kernel wit h t rust ed user level applicat ions t hat

provide maj or OS f unct ionalit y like virt ual memory, scheduling, f ile syst ems, et c. Sof t war e engineer ing quest ion

Maint ainabilit y? P

erf ormance? Reliabilit y? P

  • rt abilit y?
slide-3
SLIDE 3

3

  • 13

Core OS I ssues

Concur r ency

How many and what t ypes of act ivit ies can

  • ccur simult aneously?

Pr ot ect ion

What is t he gr anular it y at which per mission t o

access var ious r esour ces ar e gr ant ed?

How do you ver if y an ent it y’s r ight t o access a

r esour ce? Fault Tolerance

How do we deal wit h f ault s in applicat ions? I n

devices? I n our own OS code?

  • 14

Core OS I ssues

Resour ce/ ser vices pr ovided t o applicat ions

Does t he OS of f er kernel support f or event s? Signals?

Threads? P ipes? Shared memory? Naming

How do applicat ions ref er t o and request t he resources

t hey want f or t hemselves? Resources t hey want t o share wit h ot hers? Shar ing

What obj ect s can be shared among applicat ions? What is

t he granularit y of sharing? Resour ce Allocat ion and Tr acking

What is t he unit (or unit s) of resource allocat ion? Can we t rack ( and bill f or) resource usage?

  • 15

Core OS I ssues

Service Time Guarant ees

What guar ant ees (if any) ar e made t o

applicat ions about t he ser vicing of t heir r equest s or about t he ser vicing of device int errupt s?

Real-t ime OSs

Scale/ Load

What ar e t he limit s of r esour ce allocat ion?

(Biggest f ile, Maximum number of pr ocesses, et c.)

What happens as t he demand f or r esour ces

incr eases? (gr acef ul degr adat ion? )

  • 16

Core OS I ssues

Ext ensibilit y / Tuning

What int er f aces ar e pr ovided t o change

  • per at ing syst em behavior ?

How does (or does) t he OS opt imize it s

behavior based on t he char act er ist ics of t he har dwar e or t he applicat ion mix?

  • 17

Evolut ion of Operat ing Syst ems

At f ir st , OS = libr ar y of shar ed code

Every programmer did not writ e code t o

manage each device

Each applicat ion when compiled cont ained

t he “OS”

Load int o memory and execut e

  • By who? People = Oper at or s
  • How? By mechanical swit ches at f irst ,

t hen punch car ds

J ust one applicat ion at a t ime so no

need f or prot ect ion and no need f or sharing

No virt ual memory; eit her t he ent ire

program f it int o memory or programmers handled moving sect ions of t heir own code in and out of memory

  • 18

Bat ch P rocessing

St ill only one applicat ion at a t ime Operat ing syst em rat her t han operat ors

loaded one j ob af t er anot her of f of punch cards or t ape

OS knew how t o read next j ob in, execut e

it and when it is done t ake cont rol back t o read next j ob

Operat ing syst em st ayed in memory

permanent ly

slide-4
SLIDE 4

4

  • 19

Spooling

Pr oblem

Card readers are slow Time t o read t he next j ob

f rom punch cards means lost CP U t ime (expensive!) Solut ion: while execut ing

  • ne j ob load t he next one

int o memory

Might even br ing mult iple

int o memor y and allow t hem t o be execut ed out

  • f or der

Need scheduling algorit hm

t o choose t he next one t o run

  • 20

Mult iprogrammed Bat ch Syst ems

Keep mult iple j ob in memor y at t he same t ime and

int er leave t heir execut ion (not pick one and r un it t o complet ion)

The applicat ions st ill couldn’t communicat e direct ly (no

pipes, socket s, shared memory, et c.)

So why allow more t han one t o run at a t ime?

Able t o over lap I / O of one applicat ion wit h t he

comput at ion of anot her !

I f one j ob request s I / O, don’t leave t he CP

U idle while I / O complet es- pick somet hing else t o run in t he meant ime

Each j ob t ake longer t o act ually run on t he machine, but

bet t er machine ut ilizat ion and t hroughput (import ant f or expensive CP Us)

  • 21

Bat ch vs Mult iprogrammed Bat ch

  • 22

Mult iprogramming

Requires much of t he core OS f unct ionalit y

we will st udy

CPU scheduling algor it hm t o decide which one

  • f t he r unnable j obs t o r un next

Memor y management (simple at f ir st ) Pr ot ect ion of I / O devices f r om mult iple

applicat ions desir ing t o use t hem

Asynchr onous I / O

  • CP

U issues a command t o a device t hen can go do somet hing else unt il j ob is done

  • Device not if ies CP

U of complet ion wit h an int errupt s

  • r CP

U periodically polls device f or complet ion

  • 23

Time Sharing

Bat ch syst ems (even mult ipr ogr ammed bat ch

syst ems) r equir ed user s t o submit j obs wit h t heir input s and t hen lat er get out put back

Time shar ing syst ems pr ovided int er act ive

comput ing

Connect t o comput er t hrough a dumb t erminal (monit or,

keyboard, serial connect ion t o comput er)

Each int eract ive user f eels like t hey have t heir own

comput er, but in realit y j obs are swapped on and of f t he CP U rapidly enough t hat users don’t not ice

Enables int eract ive applicat ions like edit ors and command

shells even debugging running programs

User int eract wit h j ob t hroughout it s run t ime

  • 24

Scheduling f or Time Sharing

Need t o swap j obs on and of f CPU quickly

enough t hat users don’t not ice

Each j ob given a “t ime slice” Bat ch scheduling was very dif f erent – let

applicat ion run unt il it did some I / O t hen swap it out unt il it s I / O complet es

Bat ch opt imizes f or t hroughput ; Time

sharing opt imizes f or response t ime

slide-5
SLIDE 5

5

  • 25

Shared File Syst ems f or Time Sharing

How do user s who log in over dumb t er minal say

which pr ogr ams t o r un wit h what input ?

No longer submit bat ch j obs wit h t heir input on punch

car ds

Log in over a serial line

Command shells: execut e user command t hen await

t he next one

Thus t ime shar ing syst ems needed shar ed f ile

syst ems t hat held commonly used pr ogr ams

User s could log in, r un ut ilit ies, st or e input and

  • ut put f ile in shar ed f ile syst em
  • 26

Securit y f or Time Sharing

Bat ch syst ems had mult iple applicat ions

running at t he same t ime but t here input s and act ions were f ixed at submission t ime wit h no knowledge of what else would be r un wit h it

Time Sharing syst ems mean mult iple

int eract ive users on a machine poking around = I ncreased t hreat t o privacy and securit y

  • 27

CTSS and Mult ics

Compat ible Time Shar ing Syst em (CTSS) one of

f ir st t ime shar ing syst em

Developed at MI T f irst demonst rat ed in 1961 on t he I BM 709, swapping t o

t ape. Mult ics (Mult iplexed I nf or mat ion and Comput ing

Ser vice)

Ambit ious t imesharing syst em developed in 1960’s by

MI T, Bell Labs and GE

Many OS concept s conceived of in Mult ics, but har d t o

implement in 1960

Last Mult ics inst allat ion in Hallif ax Nova Scot ia

decommissioned 10/ 31/ 2000!

  • 28

UNI X

Bell Labs pulled out of MULTI Cs ef f or t

in 1969 convinced it was economically inf easible t o pr oduce a wor king syst em

Handf ul of r esear cher s at Bell Labs

including Ken Thompson and Dennis Rit chie developed a scaled down ver sion

  • n MULTI CS called UNI Cs (UNiplexed

I nf or mat ion and Comput ing Ser vice) – am “emasculat ed MULTI CS”

AT&T licensed complet ed UNI X

P

rovided licensees (including UC Berkeley) wit h t he sof t ware code and manuals because Depart ment of J ust ice didn' t allow AT&T t o sell sof t war e

  • 29

UNI X (con’t)

I n 1977, t he f ir st Ber keley Sof t war e Dist r ibut ion

(BSD) ver sion of UNI X was r eleased.

AT&T t r ansf er r ed it s own UNI X development

ef f or t s t o West er n Elect r ic

I n 1982, West er n Elect r ic r eleased Syst em I I I

UNI X (mar ket ing t hought t hat Syst em I I I sounded mor e st able t han Syst em I ☺ )

I n 1984, UC Ber keley r eleased ver sion 4.2BSD

which included a complet e implement at ion of t he TCP/ I P net wor king pr ot ocols

  • 30

Wow!

slide-6
SLIDE 6

6

  • 31

We’ve been f ollowing t he development of

corporat e/ academic comput ing

Next , we swit ch gears t o personal

comput ing

  • 32

P ersonal Comput ers

Comput er s become cheap enough t hat one can be

dedicat ed t o an individual

First PC was t he Alt air

produced by MI TS in 1975 8 bit I nt el 8080, 256 byt es(!) of memory No keyboard (f ront panel swit ches inst ead), monit or,

t ape or disk!

$ 400 P

  • pular wit h hobbyist s (like building radios or TVs)

1975 -1980, many companies make PCs (or

micr ocomput er s) based on t he 8080 chip

St ill f or hobbyist s For an OS, most run CP

/ M (Cont rol P rogram Microcomput er) f rom Digit al Research

  • 33

Apple Comput er

1976 - Member s of a Calif or nia

hobbyist gr oup, St eve Wozniak and St eve J obs, sell a f ully assembled micr ocomput er , Apple I

No more light s and swit ches $666 f or machine wit h video t erminal,

keyboard and 4K RAM, 4 K more f or $120, casset t e t ape int erf ace f or $75 1977 - Apple I I

Looks basically like t he deskt op P

C we know and love

Mouse, speakers and color (t o play Breakout

☺)

  • 34

I BM P C

1980 - I BM decides t o get int o t he PC business Rat her t han build it s own har dwar e, it goes wit h

t he I nt el 8088

Rat her t han wr it e it s own sof t war e, it looked t o

get a language pr ocessor and an OS f r om elsewher e

Licenses Microsof t ’s BASI C int erpret er St ill need an OS

  • Digit al Resear ch’s new ver sion of CP/ M way behind schedule
  • UNI X needs t oo many r esour ces (100K of memor y and a

hard disk)

  • They ask Micr osof t if it could deliver an OS t oo
  • 35

DOS

I n 1981, QDOS (Quick-and-Dir t y OS)

purchased by Microsof t and renamed MS- DOS

QDOS was a scaled down ver sion of t he CP/ M

OS f or t he 8088 f amily of comput er s Feat ur es of DOS 1.0 and 2.0

OS back t o a libr ar y linked in wit h applicat ions

  • 1 M address space; Applicat ions got only 640K

Apps do anyt hing t hey want ! - No memor y

pr ot ect ion; no har dwar e pr ot ect ion

No hier ar chical f ile syst em – single dir ect or y at

most 64 f iles

  • 36

Windows On Top, DOS underneat h

1981 – Microsof t begins development of

t he I nt erf ace Manager t hat would event ually become Micr osof t Windows

1985 – Windows 1.0

r uns as a libr ar y on t op of DOS allowed user s t o swit ch bet ween sever al

programs —wit hout r equir ing t hem t o quit and r est ar t individual applicat ions 1987 – Windows 2.0 of f ers overlapping

windows

slide-7
SLIDE 7

7

  • 37

Windows

Two Windows pr oduct lines

1994 –Windows NT

  • ent ir ely new OS ker nel (not DOS!) designed f or high-end

server machines

  • Microkernel based concept s pioneered in CMU research

proj ect MACH

1995 –Windows 95

  • I ncluded MS-DOS 7.0, but t ook over f rom DOS complet ely

af t er st art ing

  • pre-empt ive mult it asking, advanced f ile syst ems, t hreading,

net wor king

2000 - Windows 2000

Upgrade t o t he Windows NT code base Designed t o permanent ly replace Windows 95 and it s

DOS r oot s

  • 38

Linux

Linus Tor vald, a st udent in Finland, ext ends an

educat ional oper at ing syst em Minix int o an Unix st yle oper at ing syst em f or PCs (x86 machines) as a hobby

I n 1991, he post s t o t he comp.os.minix newsgr oup

an invit at ion f or ot her s t o j oin him in developing t his f r ee, open sour ce OS

Dif f er ent dist r ibut ions package t he same Linux

ker nel t oget her wit h ot her var ious collect ions of

  • pen sour ce sof t war e (GNU-Linux)

Companies sell suppor t or inst allat ion CDs, but

f r eely sof t war e available

Linux is now t he f ast est gr owing segment of t he

  • per at ing syst em mar ket
  • 39

P C-OSs meet Timesharing

Bot h Linux and lat er ver sions of Windows have

br ought many advanced OS concept s t o t he deskt op

Mult iprogramming f irst added back in because people like

t o do more t han one t hing at a t ime (spool j ob t o print er and cont inue t yping)

Memory prot ect ion added back in t o prot ect against

buggy applicat ions – not ot her users!

Linux (and even Windows now) allow users t o log in

remot ely and mult iple users t o be running j obs St eady incr eases in har dwar e per f or mance and

capacit y made t his possible

  • 40

P arallel and Dist ribut ed Comput ing

Har ness r esour ces of mult iple comput er syst ems

P

arallel comput ing f ocused on split t ing up a single t ask and get t ing speed- up proport ional t o t he number of machines

Dist ribut ed comput ing f ocused on harnessing resources

(hardware or dat a) f rom geographically dispersed machines Har dwar e

SI MD, MI MD, MP

P s, SMPs, NOWs, COWs, …

Tight ly or Loosely Coupled machines? Do t hey share

memory? Do t hey share a high speed int ernal net work? Maybe a bus? Do t hey share a clock? Do all processors

  • perat e t he same inst ruct ion at t he same t ime but on

dif f erent dat a?

  • 41

P arallel and Dist ribut ed (con’t)

Need communicat ion bet ween machines

Net wor king har dwar e and sof t war e pr ot ocols?

Fault t olerance: helps or hurt s?

Abilit y t o of f er f ail-over t o duplicat ed

resources?

“A dist r ibut ed syst em is one wher e I can’t do

wor k because a machine I never hear d of goes down” Load balancing, synchronizat ion,

aut hent icat ion, naming

  • 42

Real Time OSes

I f applicat ion demands guar ant eed r esponse t imes,

OS can be designed t o pr ovide ser vice guar ant ees

Hard-real t ime

Usually need guarant eed physical response t o sensors

  • Ex. I ndust rial cont rol, Saf et y monit oring, medical imaging

Sof t-real t ime

OS priorit ies and can provide desired response t ime most

  • f t he t ime
  • Ex. Robot ics, virt ual realit y
slide-8
SLIDE 8

8

  • 43

Embedded OSes

Cheap processors everywhere – in t oys,

appliances, cars, cell phones, PDAs

Typically designed f or one dedicat ed

applicat ion

Very const rained hardware resource

Slow pr ocessor , no disk, lit t le memor y, small

displays, no keyboar d

Bet t er of f t han ear ly mainf r ames t hough ?

Will mar ch of t echnology br ing power of

t oday’s deskt ops and f ull OS f eat ures t o all t hese devices t oo?

  • 44

Lessons f rom hist ory?

  • 45

This Semest er

Archit ect ural support f or OS; Applicat ion

demand on OS

Maj or component s of an OS

Scheduling, Memor y Management ,

Synchr onizat ion, File Syst ems, Net wor king,.. How is t he OS st ruct ured int ernally and

what int erf aces does it provide f or using it s services and t uning it s behavior?

What are t he maj or abst ract ions modern

OSes provide t o applicat ions and how are t hey support ed?