Download CITS2002 Systems Programming An Introduction to Operating

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Mobile operating system wikipedia , lookup

Library (computing) wikipedia , lookup

Copland (operating system) wikipedia , lookup

Spring (operating system) wikipedia , lookup

Burroughs MCP wikipedia , lookup

RSTS/E wikipedia , lookup

Security-focused operating system wikipedia , lookup

Distributed operating system wikipedia , lookup

Unix security wikipedia , lookup

VS/9 wikipedia , lookup

CP/M wikipedia , lookup

Transcript
CITS2002SystemsProgramming
1
next→
CITS2002
help2002
CITS2002schedule
AnIntroductiontoOperatingSystems
Whatisanoperatingsystem?
Apieceofsystemssoftwarethatprovidesaconvenient,efficientenvironmentfortheexecutionofuserprograms.
It'sprobablythelargestandmostcomplexprogramyou'lleverrun!
Whydoweneedanoperatingsystem?
Theuser'sviewpoint:
toprovidetheuserinterface,commandinterpreter,anddirectorystructure,andtoexecuteapplicationprograms(wordprocessor,emailclient,web
browser,MP3player).
Theprogrammingenvironmentviewpoint:
toenhancethebaremachine,toprovideutilityprograms(suchascompilers,editors,filters),toprovidehigh-levelinputandoutput(I/O),tostructure
informationintofiles,andtoimproveaccesstomemory(size,protection,sharing).
Theefficiencyviewpoint:
toreplacethe(longdeparted)humanoperator,toscheduletasks,toefficientlystoreandretrievedata,andtoinvokeandshareprograms.
Theeconomicviewpoint:
toallowsimultaneoususeandschedulingofresources,includingdisk-bounddataandexpensiveperipherals.
Traditionally,wewouldsummarizeanoperatingsystem'sgoalsasmaking"thesystem"convenienttouseandschedulingitsresourcesefficientlyandfairly.
Inaddition,itmustsupporthardwareandsoftwarenotyetdeveloped.
CITS2002SystemsProgramming,Lecture4,p1,11thAugust2016.
CITS2002SystemsProgramming
←prev 2
next→
CITS2002
help2002
CITS2002schedule
OperatingSystem≠User/ComputerInterface
Anoperatingsystemisoftensimplyseenanddescribedastheuser/computerinterface.
Weoften(mistakenly)claimtounderstand,andlikeordislike,an"operatingsystem"basedonitsinterface.
Suchaninterfaceprovidesuswith:
programcreation(editors,compilers,debuggers,linkers)
programexecution(characterandgraphical)
accesstoI/Odevices(bothfixedandremovable)
constrainedaccesstofilesofmedia
constrainedaccessto"internal"resources
errordetection,response,reporting,and
accountingandmonitoring.
Whetherornotacertaininterfacerunsonaparticularhardwareoroperatingsystemplatformisusuallydictatedbyeconomics,marketing,andpolitics-not
technology.
CITS2002SystemsProgramming,Lecture4,p2,11thAugust2016.
CITS2002SystemsProgramming
←prev 3
next→
CITS2002
help2002
CITS2002schedule
OperatingSystem≡ResourceManager
Anoperatingsystemisbetterconsideredasbeingincontrolofitshardwareandsoftwareresources.
Betterstill,becausethe"controls"areoftentemporalorexternaltotheoperatingsystemitself,let'sconsidertheoperatingsystemasaresource
manager.
Anoperatingsystemisjustanotherprogramrunningontheavailablehardware.
Mostofthetime,theoperatingsystemrelinquishescontroltotheuserprocessesuntilthehardwareagaindispatchesthecontrol.
CITS2002SystemsProgramming,Lecture4,p3,11thAugust2016.
CITS2002SystemsProgramming
←prev 4
next→
CITS2002
help2002
CITS2002schedule
OperatingSystemsMustBeExtensible
Ofimportanceisanoperatingsystem'sabilitytoevolvetomeetnewhardwareandsoftwaredemands:
Newhardwareisconstantlyintroduced-addingmorememorypresentslittledifficulty;newtypesofdisks,videocards,etc,aremoreproblematic.
Newapplicationprograms,tools,andsystemservicesareadded.
Fixesandpatchesarereleasedtocorrectoperatingsystemdeficiencies.
Allofthissuggeststhattheoperatingsystem,asaprogram,needstobeextensible-amodulardesignseemsessential.Considerthefollowingfigure,
takenfromStallings.
LayersandViewsofaComputerSystem
CITS2002SystemsProgramming,Lecture4,p4,11thAugust2016.
CITS2002SystemsProgramming
←prev 5
next→
CITS2002
help2002
CITS2002schedule
TraditionalOperatingSystemServices
CPUscheduling:
distributeorapportioncomputingtimeamongseveralprocesses(ortasks)whichappeartoexecute
simultaneously.
Memorymanagement:
divideandsharephysicalmemoryamongseveralprocesses.
Swapping:
moveprocessesandtheirdatabetweenmainmemoryanddisktopresenttheillusionofabiggermachine.
I/Odevicesupport:
providespecializedcodetooptimallysupportdevicerequirements.
Filesystem:
organizemassstorage(ondisk)intofilesanddirectories.
CITS2002SystemsProgramming,Lecture4,p5,11thAugust2016.
CITS2002SystemsProgramming
←prev 6
next→
CITS2002
help2002
CITS2002schedule
TraditionalOperatingSystemServices, continued
Utilityprograms:
accounting,setting/constrainingsystemresourceaccess,manipulatingthefilesystem.
Acommandinterface:
textualorgraphical,toenableinteractiveinterrogationandmanipulationofoperatingsystemfeatures.
Systemcalls:
allowconstrainedaccesstotheinterioroftherunningoperatingsystem(asaprogram).
Protection:
keepprocessesfrominterferingwitheachother,theirdata,and"thesystem",whilstpermittingsharingwhen
requested.
Communication:
allowusersandtheirprogramstocommunicationwithinasinglemachine,andacrossnetworks.
CITS2002SystemsProgramming,Lecture4,p6,11thAugust2016.
CITS2002SystemsProgramming
←prev 7
next→
CITS2002
help2002
CITS2002schedule
AWhirlwindHistoryofOperatingSystems
Tounderstandthewaymodernoperatingsystemsarethewaytheyare,itisusefultoexaminetheirevolutionoverthelastsixtyyearsorso.
Advancesinoperatingsystemsoftenaccompaniedadvancesinhardware,fallingprices,and"exploding"capacities.
ThefirsttruedigitalcomputerwasdesignedbyEnglishmathematicianCharlesBabbage(17921871).
AlthoughBabbagespentmostofhisworkinglifeandfortunebuildinghis"analyticalengine",its
mechanicaldesignandthewoodentechnologyofthedaycouldnotprovidetherequiredprecision.
Needlesstosay,theanalyticalenginedidnothaveanoperatingsystem.
“
Everythingthatcanbeinventedhasbeeninvented.
— CharlesH.Duell,Commissioner,U.S.OfficeofPatents,1899.
CITS2002SystemsProgramming,Lecture4,p7,11thAugust2016.
CITS2002SystemsProgramming
←prev 8
next→
CITS2002
help2002
CITS2002schedule
1945-55:VacuumTubesandPlugboards
UntilWorldWarII,littleprogresswasmadeinconstructingdigitalcomputers.Sixsignificantgroupscanreasonablyclaimthefirstelectricalcomputers:
TommyFlowersandMaxNewman,BletchleyPark,England,
HowardAitken,Harvard,
JohnvonNeumann,InstituteofAdvanceStudies,Princeton,
J.P.EckertandW.Mauchley,UniversityofPennsylvania,and
KonranZuse,Germany.
TomKilburnandFreddieWilliams,Manchester,
Asinglegroupofpeopledesigned,built,programmed,operatedandmaintainedeachmachine.Althoughfillingsmallwarehouses,withtensofthousands
ofvacuumtubes,theywerenomatchfortoday'scheapesthomecomputers.
“
Ithinkthereisaworldmarketformaybefivecomputers.
— ThomasWatson(1874-1956),ChairmanofIBM,1943.
Programswereloadedmanuallyusingconsoleswitches,ormorelikelybydirectreconfigurationofwiring;indicationofaprogram'sexecutionand
debuggingreturnedthroughconsolelights.
Advantages:
Interactive,anduserreceivedimmediateresponse.
Disadvantages:
Expensivemachinewasidlemostofthetime,becausepeople'sreactions(andthinking)wereslow.
Programminganddebuggingweretedious;hardwarewasveryunreliable.
Eachprogramwasselfcontained,includingitsowncodeformathematicalfunctionsandI/Odevicesupport.
CITS2002SystemsProgramming,Lecture4,p8,11thAugust2016.
CITS2002SystemsProgramming
←prev 9
next→
CITS2002
help2002
CITS2002schedule
1955-65:TransistorsandBatchSystems
Programminglanguagesandoperatingsystems(asweknowthemtoday)stillunheardof.Collectionsofsubroutines(procedures)todriveperipheralsand
toevaluatetrigonometricfunctionswerethefirstexamplesofoperatingsystemsservices.Themid-1950ssawtheuser(stillastheprogrammer)submitting
adeckofpunchedHollerithcardsdescribingajobtobeexecuted.
Giventhehighcostofcomputers,waystoincreasetheirutilitywerequicklysought.Thegeneralsolutionwasthebatch
system.
Similar/relatedprograms,perhapseachrequiringtheFORTRAN(FORmulaTRANslation)compiler,orasetof
mathematicalroutines,werebatchedtogethersothattherequiredroutinesneedonlybephysicallyloadedonce.
Programswerefirstwrittenonpapertape,intheemergingFORTRANlanguageorinassemblylanguage,andthencopiedtopunchedcards.Suchdecks
ofcardsincludedjobcontrolcards,theprogramitself,andoftentheprogram'sdata.
Jobssubmittedbydifferentusersweresequencedautomaticallybytheoperatingsystem'sresidentmonitor.Earlyperipherals,suchaslargemagnetictape
drives,wereusedtobatchinput(jobsanddata)andspool(fromSimultaneousPeripheralOperationOnLine)output.
CITS2002SystemsProgramming,Lecture4,p9,11thAugust2016.
CITS2002SystemsProgramming
←prev 10
next→
CITS2002
help2002
CITS2002schedule
1955-65:TransistorsandBatchSystems, continued
Generally,aninexpensivecomputer,suchasanIBM1401,wasusedforreadingcardsandprintingfromoutputtapes.Theexpensivemachine,suchasan
IBM7094,wasusedsolelyforthemathematicalcomputations.
Advantages:
The(true,computational)computerwaskeptbusier.
Disadvantages:
Thecomputerwasnolongerinteractive.Jobsexperiencedalongerturnaroundtime.
TheCPUwasstillidlemuchofthetimeforjobs.Otherjobsremainedqueuedforexecution.
Thesignificantoperatingsysteminnovationatthistimewastheintroductionofacommandinterpreter(ajobcontrollanguage-JCL)todescribe,order,
andcommenceexecutionofjobs.
Theresidentmonitorwasalsoprotectedfromtheuserprograms,andmanagedtheautomatedloadingoftheprogramsafterthemonitor.
CITS2002SystemsProgramming,Lecture4,p10,11thAugust2016.
CITS2002SystemsProgramming
←prev 11
next→
CITS2002
help2002
CITS2002schedule
1965-1980:IntegratedCircuitsandMultiprogramming
Intheearly1960s,computermanufacturerstypicallymadetwotypesofcomputers-word-oriented,largescalescientificcomputers(suchasthe7094),
andcharacter-orientedcommercialcomputers(suchasthe1401),whichwerereallybettersuitedforI/O.
Incompatibilityandalackofanupgradepathweretheproblemsoftheday.
IBMattemptedtoaddressbothproblemswiththereleaseoftheirSystem/360,afamilyofsoftwarecompatiblemachinesdifferingonlyincapacity,price
andperformance.Themachineshadthesamearchitectureandinstructionset.
WithheavyCPU-boundscientificcalculations,I/Oisinfrequent,sothetimewastedwaitingwasnotsignificant.However,commercialprocessingprograms
intheemergingCOBOL(ComputerOrientedBusinessOrganizationalLanguage)oftenspent80-90%ofitstimewaitingforI/Otocomplete.
TheadventofseparateI/OprocessorsmadesimultaneousI/OandCPUexecutionpossible.
TheCPUwasmultiplexed(shared),oremployedmultiprogramming,amongstanumberofjobs-whileonejobwaswaitingforI/Ofromcomparativelyslow
I/Odevices(suchasakeyboardortape),anotherjobcouldusetheCPU.
JobswouldrununtiltheircompletionoruntiltheymadeanI/Orequest.
Advantages:
Interactivitywasrestored.
TheCPUwaskeptbusyifenoughjobswerereadytorun.
Disadvantages:
Thecomputerhardwareandtheoperatingsystemsoftwarebecamesignificantlymorecomplex(andtherehasbeennolookingbacksince!).
CITS2002SystemsProgramming,Lecture4,p11,11thAugust2016.
CITS2002SystemsProgramming
←prev 12
next→
CITS2002
help2002
CITS2002schedule
1965-1980:IntegratedCircuitsandMultiprogramming, continued
Still,thedesireforquickerresponsetimesinspiredavariantofmultiprogramminginwhicheachusercommunicateddirectlywithoneofamultitudeofI/O
devices.
Theintroductionoftimesharingintroducedpre-emptivescheduling.Jobswouldexecuteforatmostpre-definedtimeinterval,afterwhichitwasanotherjob's
turntousetheCPU.
Thefirstserioustimesharingsystem(CTSS,fromMIT1962)lackedadequatememoryprotection.
Most(modern)operatingsystemcomplexitywasfirstintroducedwiththesupportofmultiprogramming-schedulingalgorithms,deadlockprevention,
memoryprotection,andmemorymanagement.
Theworld'sfirstcommerciallyavailabletime-sharingcomputer,theDECPDP-6,wasinstalledinUWA'sPhysicsBuildingin1965-cf.
Cyberhistory,byKeithFalloon,UWAMScthesis,2001,andpdp6-serials.
CITS2002SystemsProgramming,Lecture4,p12,11thAugust2016.
CITS2002SystemsProgramming
←prev 13
next→
CITS2002
help2002
CITS2002schedule
EarlyOperatingSystemSecurity
Veryearlyoperatingsystems,onone-user-at-a-timecomputersystems,assistedtheusertoloadtheir
programsandcommencetheirexecution.
Therewaslittletoprotectand,ifanerrantprogrammodifiedtheexecutiveprogram,thenonlythecurrentuser
wasaffected.Asmoreofacourtesy,theexecutivemightclearmemorysegmentsandcheckitselfbefore
acceptingthenextprogram.
Asmulti-taskingoperatingsystemsemerged,accountabilityofresourceusebecamenecessary,and
operatingsystemmonitorsoversawtheexecutionofprograms.
Aswithmodernoperatingsystems,therewastheneedto:
protecttheoperatingsystemfromtheprogram,
protectprogramsfromthemselves,
protectprogramsfromeachother,and
constraindataaccesstothecorrectprogram(s).
Untilsystemresourcesbecamemoreplentiful(andcheaper)attemptsweremadetomaximizeresourcesharing-securitywasaconsequent,notaninitial,
goal.
e.g.processschedulingpoliciesweredominatedbyalreadyrunningprocessesrequestingresources(suchaslibrariesand
tapes)thatwerealreadyinuse.
Atthislevel,computersecurityismoreconcernedwithreliabilityandcorrectness,thanaboutdeliberateattacksonprograms,data,andthesystem.
CITS2002SystemsProgramming,Lecture4,p13,11thAugust2016.
CITS2002SystemsProgramming
←prev 14
next→
CITS2002
help2002
CITS2002schedule
1970s:MinicomputersandMicrocomputers
“
ThereareonlytwothingstocomeoutofBerkeley,UnixandLSD,andI
don'tthinkthisisacoincidence.
— JeremyS.Anderson.
Anothermajordevelopmentoccurringinparallelwasthephenomenalgrowthinminicomputers,startingwiththeDEC(DigitalEquipmentCorporation)PDP1(ProgrammedDataProcessor)in1961.ThePDP-1,with4Kof18-bitwordscostonlyUS$120,000-5%oftheIBM7094.
Thetrendwastowardsmanysmallmid-rangepersonalcomputers,ratherthanasinglemainframe.
Earlyminicomputersandmicrocomputersweresimpleintheirhardwarearchitectures,andsotherewassomeregressiontoearlieroperatingsystemideas
(singleuser,nopre-emption,nomultiprogramming).
Forexample,MS-DOSonanIBM-PC(circa.1975)wasessentiallyintroducedasabatchsystem,similartothoseofthe1960s,withafewmodern
additions,suchasahierarchicalfilesystem.
Withsomenotableexceptions,thetrendquicklymovedtowardssupportofallmodernoperatingsystemfacilitiesonmicrocomputers.
“
Thereisnoreasonanyonewouldwantacomputerintheirhome.
— KenOlsen,DECFounderandChairman,1977.
Perhapsmostsignificanthasbeentheevolution,andimportance,ofoperatingsystems'userinterfaces.
Inparticular,thegraphicaldesktopmetaphorhasremainedforsometime.
CITS2002SystemsProgramming,Lecture4,p14,11thAugust2016.
CITS2002SystemsProgramming
←prev 15
next→
CITS2002
help2002
CITS2002schedule
1980-90:PersonalComputersandNetworking
“
640Koughttobeenoughforanybody.
— BillGates(1955-),in1981.
Thedecentralizationofcomputingresource,nowdataandnotthehardware,requiredmoresupportforinter-operatingsystemcommunication-both
physicalsupportandapplicationprogramsupport.
Asminicomputersshrunkinsize,butexplodedincapacity,thepowerfulcomputerworkstationwasborn.CompaniessuchasSunMicrosystems(SUN)and
SiliconGraphics(SGI)rodethiswaveofsuccess.
Local-areanetworks(primarilyEthernetandtoken-ring)connectedworkstations,whilewide-areanetworksconnectedminicomputers.
Operatingsystemdevelopmentsincludedthedevelopmentoffastandefficientnetworkcommunicationprotocols,dataencryption(ofnetworksandfile
systems),security,reliability,andconsistencyofdistributeddata.
CITS2002SystemsProgramming,Lecture4,p15,11thAugust2016.