保护和安全英文文档格式.docx
《保护和安全英文文档格式.docx》由会员分享,可在线阅读,更多相关《保护和安全英文文档格式.docx(6页珍藏版)》请在冰豆网上搜索。
![保护和安全英文文档格式.docx](https://file1.bdocx.com/fileroot1/2022-12/11/62df5843-5437-47cb-bc19-1a0cd3e61184/62df5843-5437-47cb-bc19-1a0cd3e611841.gif)
devicemanagement,processandresourcemanagement,memorymanagement,filemanagement,andfunctionalorganization.Next,wewilladdressgeneralimplementationmethodologies:
performanceandtrustedsoftware.Softwaremodularizationissusesareintroducedinthischapter,andarediscussedinmoredetailinChapter19.ThischapterconcludeswithadescriptionofthegeneralorganizationofUNIXkernelsandtheWindowsNTkernel.
BASICFUNCTIONS
TherearetwobasicresponsibilitiesoftheOS(seeFigure3.1):
⏹Createanabstractmachineenvironmentwithmultiple,autonomousabstractcomponents.Manyofthecomponentscanbeinuseconcurrently.Forexample,theOSusesmultiprogrammingtocreateanabstractmachineforeachprocess.
⏹Coordinatetheuseofthecomponentsaccordingtothepoliciesofthemachine’sadministrator.Forexample,theschedulerdecideswhenandwhichdifferentprocessesshouldbeallocatedtheprocesspor.
ThecreationpartoftheOSprovidesthespectrumofabstraction(suchasprocesses,threads,andresources)thatprogrammersuse,andthecoordinationpartmanagestheirconcurrentusesothatthecommunityofprocessesworksinharmony.
◆FIGURE3.1PurposeofanOS
PartofanOScreatesasetofabstractionsthatwillbeusedbyapplicationprogrammerstheseabstractionsincludeprocesses,threads,andfiles.InamultiprogrammingOS,multipleprocessescompetefortheuseoftheabstractresources,sotheOScorrdinatesthewaythattheseprocessesusetheabstractresources.
ThereisnocompleteagreementabouttheexactsetoffunctionsrequiredforanOS.Instead,eachOSprovidesasetdeterminedbyengineeringandmarketingchoices.OurgoalistolearnthegeneralprinciplesbehindOSfunctions,andthentoputthoseprinciplestoworkinOS-specificLaboratoryRxercises.Overtheyears,OSfunctionshavebeencharacterizedassatisfyingoneofthefollowingbasicrequirements:
Devicemanagement
Process,thread,andresourcemanagement
Memorymanagement
Filemanagement
Wewillusethesegeneralcharacterizationsasaframeworkforconsideringdetailedrequirements,designissues,architectures,andimplementation.Let’sfirstconsiderageneraldescriptionofeachofthesecomponentsofanOS.
DEVICEMANAGEMENT
TheOSmanagestheallocation,isolation,andsharingofthedevicesaccordingtopolicieschosenbythedesignerorsystemadminstrator.Evenoperationsystemsthatdonotsupportmultiprogrammingincorporatedevicemanagrment.Mostoperatingsystemstreatalldevicessuchasdisks,tapes,terminals,andprintersinthesamegeneralmanner,buttheyprovidespecialmanagementapproachesfortheprocessorandmemory.Devicemanagementreferstothewaythegenericdevicesarehandled.
Therearedevice-dependentanddevice-independentpartsofadevicemanager(seeFigure3.2).Thedependentparts,calleddevicedrivers,implementtheaspectsofdevicemanagementthatareuniquetoeachdevicetype.Forexample,adevicedriverforakeyboardisconstructedexplicitlytosensekeystrokesfromakeyboarddeviceasthecorrespondingkeysarepressed.Adevicemanagerforadisplayscreenisconstructedtowritecharactersorgraphicstoabideodisplay.
◆FIGURE3.2DeviceManagement
Thedevicemanageriscomposedofadevice-independentpartandacollectionofdevice-dependentparts,oneforeachtypeofdevice.Thedevice-dependentpartsexportservicestothedeviceindependentpart,whichprovidesaunifiedinterfaceforallthedifferentdevicetypes.
Theindependentpartofthedevicemanagerdfinesageneralsoftwareenvironmentinwhichadevice-dependentdrivercanexecute.Forexample,theindependentpartofthedevicemanager.Mostofthefunctionalityisimplementedinthecollectionofdevicedrivers.
Bypartitioningthedesignintodependentandindependentcomponecnts,thetaskofaddingadevicetoacomputerisgreatlysimplified.First,theOSdesignerdecideswhichaspectsofdevicemanagementaredevice-dependentandwhichpartscanbeindependentofalldevices.Theindependentpartsaretheimplementedidthebaseoperationsystem(theywillworkwithalldevices).Thedependentpartsareimplementedinthedriverforeachdevicetype.Thismeansthattheimdependentpartofthedevicemanagerhassystemcallstoreadand/orwriteanydevice.Aprinterdevicedrivercontainsallthesoftwarethatisspecifictoaparticulartypeofprinter(suchasaPostscript).SincetheindependentpartsaregenericforalldevicesandarebulitintotheOS,thedesignercanadddevicedriverstotheOSwheneveradeviceisaddedtothecamputer.
DevicemanagementisanimportantbutrelativelysimplepartoftheoverallOSdesign.Chapter4introducesdevicebehavior(fromasystemprogrammer’sperspective)aspartofthecomputerorganizationdiscussion.Chapter5addressesdevicemanagementindetail.
PROCESS,THREAD,ANDRESOURCEMANAGEMENT
Processesandthreadsarethebasicunitsofcomputationdefinedbyprogrammers,and(abstract)resourcesaretheelementsofthecomputingevironmentneededbyaprocesssothatitsthreadscanexecute.ThispartoftheOSimplementsallpartsoftheabstractmachinethatcreatetheabstractionsofprocesses,threads,andresources(seeFigure3.3).ThispartoftheOSiscompletelyresponsibleformanagingthehardwareprocessorresourceandvariousabstractresourcessuchasmessages.Itsharestheresponsibilityofmanagingthehardwareprimarymemorywiththememorymanager.
◆FIGURE3.3Process,Thread,andResourceManagement
Theprocess,thread,andresourcemanagerisresponsiblefortheadministrationoftheprocessorandvariousabstractresources.Itcooperateswiththememorymanagertoadministertheprimarymemory.
Processmanagement,threadmanagement,andresourcemanagementcouldbesepatatedintotheirownlogicalunits,butmostoperatingsystemscombinethemintoasinglemodule,sincetogethertheydefinetheessentialpartsoftheabstractmachineevironment.Inthisbook,thispartoftheOSissimpleyreferredtoasthe“processmanager”ratherthanthemoreproper(andlonger)name“process,thread,andresourcemanager.”
InChapter2,theUNIXprocessmodelwasdescribedasoneexampleofhowanOScandefineacomputationalenvironment.AUNIX-styleOSprovidesasetofprocessmanagementfacilitiesforcreating,destroying,blocking,andrunningaprocess.Chapter2alsodesribedthemoremodernthread-basedapproachinwhichthecomputationalelementisdividedintoastaticprocesspartandadynamicthreadpart.Theprocessmanagerforthread-basedsystemsismorecomplexthanoneforprocess-basedsystemssinceitmustmanageprocessesandthreadsasseparateentities.
Theresourcemanagerallocatesresourcestoprocesseswhentheyarerequestedbyathread,andkeepstrackofresourceswhenathreadfinishesusingthem.Logically,adesignercouldseparateresourcemanagementfunctionalityfromprocess/threadmanagement.However,changesisstatustoaresourceareusuallyrelatedtoachangeinstatusofaprocess,soOSdesignerstendtotalkaboutresourcemanagementsasifitwereapartofprocessmanagement.
Theprocessmanagerallowsmultipleusers(orprocessesandthreads)tosharethemachinebyprovidingmultipleexecutioncontextsandschedulingtheprocessorsothateachthreadreceievesanequitablefractionoftheavailabletime.Primaryconsiderationsoftheprocessmanagerarehowitwillenforceisolationofresourceaccessamongtheprocesses(accordingtosomepolicy)andhowitwillallowtheprocessestocircumventtheisolationmechanismwhenthepolicycallsfortheprocessestosharearesource.Chapters6through10describetheissuesrelatedtodesigningaprocessmanager.
MEMORYMANAGEMENT
Thememorymanagercooperateswhittheprocessmanagertoadministertheallocationanduseoftheprimary(alsocalledtheexecutableormain)memoryresource---seeFigure3.4Everyprocessrequestsandusesmemoryaccordingtoitsprogramdefinition.Thememorymanagerallocatesmemorytocompetingprocessesaccordingtoaspecifiedpolicyandenforcesresourceisolation.Astrategythatallowssharingismorecomplextomanagethanonewithnosharing,Hence,thememorymanagerincorporatesmechanismstoallowblockstobesharedinthepresenceoftheisolationmechanism.
◆FIGURE3.4MemoryManagement
Thememorymanagercooperateswiththeprocessmanagertoadministertheprimarymemory.IftheOSsupportsvirtualmemory,thenthatpartofthememorymanagercooperateswiththedeviceand/prthefilemanagerstomanagethememoryandpaginddevices.
Modernmemorymanagersprovidevirtualmemoryextensionssothattheabstractmachine’sprimarymemoryappearstobelargerthanthephysicalmachine’smemory.Thisisaccomplishedbyintegratingthecomputer’sprimarymemoryandthememoryfromitsstoragedevices,allowingprocessestorefernceinformationstoredonastoragedeviceasifitwerestoredintheprimarymemory.Virtualmemoryrequirementsdifferfromconventionalmemorymanagementrequirements.Thisisbecausethesystemismanaginganabstractresource---thevirtualmemoryspace---whichmustbemanagedbycontrollingthewaytheprimarymemoryandthestoragedevicesareusedtogether.Chapters11and12discussmemorymanagementapproaches,issues,anddesigns.
Modernmenorymanagersalseprovideameansforathreadononemachinetoaccessands