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 layer t hat � Processes, Threads � manages har dwar e r esour ces � pr ovides an abst r act ion of t he under lying � Scheduling har dwar e t hat is easier t o pr ogr am and use � Synchronizat ion, Deadlock � Memory Management Applicat ions � File Syst ems, I O Devices Operat ing Syst ems � Net works, Dist ribut ed Syst ems Hardware � Securit y -3 -4 Benef it s of Operat ing Syst ems Hardware Resources (1) � CPU, Funct ional Unit s, Regist er s � Abst ract ing t he Hardware � Main memor y access � Gor y det ails of t he r aw har dwar e hidden so � St or age devices (disk dr ives, CD-ROMs, t ape applicat ions can be smaller and simpler drives) � Applicat ion wr it er s can pr ogr am t o a simpler and mor e por t able “vir t ual machine” � Net wor k I nt er f ace Car ds � Providing usef ul logical abst ract ions � Human I / O devices (keyboar ds, monit or s, mice) � Ot her ? Pr int er s, camer as, sensor s, … � New t ypes of logical r esour ces (socket s, pipes) 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? -5 -6 1
Benef it s of Operat ing Syst ems What an operat ing syst em is (2) not ? � P rot ect ing applicat ions f rom each ot her � Compiler � Enf or ce “f air ” allocat ion of har dwar e r esour ces � St andard libraries among applicat ions � Command Shells � Policies t hat say what is “f air ” and mechanisms t o enf or ce it � These are closely relat ed pieces of syst em � Support ing communicat ion and coordinat ion sof t ware, but t hey are not t he OS. 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 ot her of event s -7 -8 I s OS code like ot her code? Lot s of variet y of OSes � Most OSs implement ed in C � Unix (Solaris, HP-UX, AI X, FreeBSD, � Developed wit hout space-age development Net BSD,OpenBSD..) envir onment s (ker nel debugger s?) � Linux � The buck st ops her e! � OS must deal wit h gory hardware det ails � Windows XP, 2000, NT, ME, 98, 95 • Tr y t o keep har dwar e dependent par t s isolat ed � BeOS � What happens when get a device int errupt in t he middle of execut ing an applicat ion? What happens when get a � MacOS device int errupt while servicing anot her device int errupt ? � PalmOS � What happens if you t ake a page f ault while execut ing � WindowsCE operat ing syst em code � Per f or mance and r eliabilit y ar e cr ucial! � Mach, Amoeba, Sprit e, Vino, SPI N, QnX,… � St ill a lot mor e like applicat ion code t han you might t hink -9 -10 What dist inguishes operat ing Core OS I ssues: OS St ruct ure syst ems? � When people t alk about which operat ing � How is t he OS st r uct ur ed? syst em t o run, t hey of t en t alk about : � One monolit hic kernel of spaghet t i code � One monolit hic kernel t hat is int ernally composed of � Look and f eel of t he deskt op windowing syst em dist inct layers � Devices t hat ar e suppor t ed � One monolit hic kernel t hat is int ernally composed of � What har dwar e plat f or ms does it r un on? dist inct obj ect s � Applicat ions t hat ar e available f or t hat OS � 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, � Who developed t he code? Who suppor t s t he scheduling, f ile syst ems, et c. code? � Sof t war e engineer ing quest ion � How of t en does t he syst em cr ash? Reliabilit y? � Maint ainabilit y? P erf ormance? Reliabilit y? P ort abilit y? � Do you pay f or it ? � Are t hese really core OS issues? -11 -12 2
Core OS I ssues Core OS I ssues � Resour ce/ ser vices pr ovided t o applicat ions � Concur r ency � Does t he OS of f er kernel support f or event s? Signals? � How many and what t ypes of act ivit ies can Threads? P ipes? Shared memory? occur simult aneously? � Naming � Pr ot ect ion � How do applicat ions ref er t o and request t he resources � What is t he gr anular it y at which per mission t o t hey want f or t hemselves? Resources t hey want t o share wit h ot hers? access var ious r esour ces ar e gr ant ed? � Shar ing � How do you ver if y an ent it y’s r ight t o access a � What obj ect s can be shared among applicat ions? What is r esour ce? t he granularit y of sharing? � Fault Tolerance � Resour ce Allocat ion and Tr acking � How do we deal wit h f ault s in applicat ions? I n � What is t he unit (or unit s) of resource allocat ion? devices? I n our own OS code? � Can we t rack ( and bill f or) resource usage? -13 -14 Core OS I ssues Core OS I ssues � Service Time Guarant ees � Ext ensibilit y / Tuning � What guar ant ees (if any) ar e made t o � What int er f aces ar e pr ovided t o change applicat ions about t he ser vicing of t heir oper at ing syst em behavior ? r equest s or about t he ser vicing of device � How does (or does) t he OS opt imize it s int errupt s? behavior based on t he char act er ist ics of t he � Real-t ime OSs har dwar e or t he applicat ion mix? � 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? ) -15 -16 Evolut ion of Operat ing Syst ems Bat ch P rocessing � At f ir st , OS = libr ar y of shar ed code � St ill only one applicat ion at a t ime � Every programmer did not writ e code t o � Operat ing syst em rat her t han operat ors manage each device loaded one j ob af t er anot her of f of punch � Each applicat ion when compiled cont ained t he “OS” cards or t ape � Load int o memory and execut e • By who? People = Oper at or s � OS knew how t o read next j ob in, execut e • How? By mechanical swit ches at f irst , it and when it is done t ake cont rol back t o t hen punch car ds � J ust one applicat ion at a t ime so no read next j ob need f or prot ect ion and no need f or � Operat ing syst em st ayed in memory sharing � No virt ual memory; eit her t he ent ire permanent ly program f it int o memory or programmers handled moving sect ions of t heir own code in and out of memory -17 -18 3
Mult iprogrammed Bat ch Spooling Syst ems � Pr oblem � 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 � Card readers are slow � Time t o read t he next j ob t o complet ion) f rom punch cards means lost � The applicat ions st ill couldn’t communicat e direct ly (no CP U t ime (expensive!) pipes, socket s, shared memory, et c.) � Solut ion: while execut ing � So why allow more t han one t o run at a t ime? one j ob load t he next one � Able t o over lap I / O of one applicat ion wit h t he int o memory comput at ion of anot her ! � Might even br ing mult iple � 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 int o memor y and allow meant ime t hem t o be execut ed out � Each j ob t ake longer t o act ually run on t he machine, but of or der bet t er machine ut ilizat ion and t hroughput (import ant f or � Need scheduling algorit hm expensive CP Us) t o choose t he next one t o run -19 -20 Bat ch vs Mult iprogramming Mult iprogrammed Bat ch � 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 of 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 or CP U periodically polls device f or complet ion -21 -22 Time Sharing Scheduling f or Time Sharing � Bat ch syst ems (even mult ipr ogr ammed bat ch � Need t o swap j obs on and of f CPU quickly syst ems) r equir ed user s t o submit j obs wit h t heir enough t hat users don’t not ice input s and t hen lat er get out put back � Each j ob given a “t ime slice” � Time shar ing syst ems pr ovided int er act ive comput ing � Bat ch scheduling was very dif f erent – let � Connect t o comput er t hrough a dumb t erminal (monit or, applicat ion run unt il it did some I / O t hen keyboard, serial connect ion t o comput er) swap it out unt il it s I / O complet es � 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 � Bat ch opt imizes f or t hroughput ; Time CP U rapidly enough t hat users don’t not ice � Enables int eract ive applicat ions like edit ors and command sharing opt imizes f or response t ime shells even debugging running programs � User int eract wit h j ob t hroughout it s run t ime -23 -24 4
Recommend
More recommend