操作系统原理1-2

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

Chapter2:Computer-SystemStructuresStructures沈卓炜zwshen@seueducnzwshen@seu.edu.cn四牌楼校区文正楼南205,83790819-802九龙湖校区计算机楼316(周一、周三)13390922952Chapter2:Computer-SystemStructures(6thEd)(6thEd.)CompterSstemOperationnComputerSystemOperationnI/OStructurenStorageStructureStHihnStorageHierarchynHardwareProtectionnNetworkStructureSoutheastUniversity2.2OperatingSystemConceptsComputer-SystemArchitectureCoputeSystectectue„HowdoestheOStitOSgetintosystem?„Hd„Howdowerequestfori?services?„HowdoestheOSkOSknowsomethinghashd?happened?SoutheastUniversity2.3OperatingSystemConceptsComputer-SystemOperationCoputeSysteOpeatoI/OdeicesandtheCPUcaneectenI/OdevicesandtheCPUcanexecuteconcurrently.nEachdevicecontrollerisinchargeofaparticulardevicetypeparticulardevicetype.nEachdevicecontrollerhasalocalbuffer.SoutheastUniversity2.4OperatingSystemConceptsComputer-SystemOperation(Cont.)pyp()CPUmoesdatafrom/tomainmemornCPUmovesdatafrom/tomainmemoryto/fromlocalbuffersnI/Oisfromthedevicetolocalbufferofcontrollercontroller.nDevicecontrollerinformsCPUthatithasfiihdittibifinisheditsoperationbycausinganinterrupt.SoutheastUniversity2.5OperatingSystemConceptsInterruptteuptnAneventthatrequirestheattentionofthenAneventthatrequirestheattentionoftheOSisaninterrupt.TheseeventsincludethecompletionofanI/O,akeypress,arequestcompletionofanI/O,akeypress,arequestforservice,adivisionbyzeroandsoon.nInterruptsmaybegeneratedbyhardwareornInterruptsmaybegeneratedbyhardwareorsoftware.nAninterruptgeneratedbysoftware(ienAninterruptgeneratedbysoftware(i.e.,divisionby0)isusuallyreferredtoasatrap.nModernoperatingsystemsareinterruptnModernoperatingsystemsareinterruptdriven,meaningtheOSisinactiononlyifaninterruptoccurs.SoutheastUniversity2.6OperatingSystemConceptsinterruptoccurs.WhatisInterruptdriven?atsteuptdenTheOSisactivatedbyaninterruptbyaninterrupt.nTheexecutingprogramisprogramissuspended.nControlisnControlistransferredtotheOSOS.nProgramcontinueswhentheservicewhentheservicecompletesSoutheastUniversity2.7OperatingSystemConceptsInterruptTimeLineForaSingleProcessDoingOutputSoutheastUniversity2.8OperatingSystemConceptsCommonFunctionsofInterruptsCoouctosoteuptsInterrpttransferscontroltotheinterrptnInterrupttransferscontroltotheinterruptserviceroutinegenerally,throughtheinterruptvector,whichcontainstheaddressesofalltheserviceroutines.nInterruptarchitecturemustsavetheaddressoftheinterruptedinstructionoftheinterruptedinstruction.nIncominginterruptsaredisabledwhileanotherinterruptisbeingprocessedtopreventalostinterrupt.SoutheastUniversity2.9OperatingSystemConceptspreventalostinterrupt.InterruptHandlingTheoperatingsstempreseresthestateofnTheoperatingsystempreservesthestateoftheCPUbystoringregistersandtheprogramcounter.nDetermineswhichtypeofinterrupthasnDetermineswhichtypeofinterrupthasoccurred:‹lli‹polling‹vectoredinterruptsystemnSeparatesegmentsofcodedeterminewhatactionshouldbetakenforeachtypeofSoutheastUniversity2.10OperatingSystemConceptsactionshouldbetakenforeachtypeofinterruptI/OInterrupt/OteuptSoutheastUniversity2.11OperatingSystemConceptsI/OStructure/OStuctuenAfterI/Ostarts,controlreturnstouserprogramonlyuponI/Ocompletion.p‹WaitinstructionidlestheCPUuntilthenextinterruptp‹Waitloop(contentionformemoryaccess).)‹AtmostoneI/Orequestisoutstandingatatime,nosimultaneousgI/Oprocessing.SoutheastUniversity2.12OperatingSystemConceptsI/OStructure(Cont.)/OStuctue(Cot)nAfterI/Ostarts,controlreturnstouserprogramwithoutwaitingforI/Ocompletion.‹Systemcall–requesttotheoperatingsystem‹yqpgytoallowusertowaitforI/Ocompletion.‹Device-statustablecontainsentryforeachI/Oydeviceindicatingitstype,address,andstate.‹OperatingsystemindexesintoI/Odevicetablepgytodeterminedevicestatusandtomodifytableentrytoincludeinterrupt.SoutheastUniversity2.13OperatingSystemConceptsTwoI/OMethodso/OetodsSynchronousAsynchronousSoutheastUniversity2.14OperatingSystemConceptsDevice-StatusTableeceStatusabeSoutheastUniversity2.15OperatingSystemConceptsDirectMemoryAccessStructureecteoyccessStuctueUsedforhighspeedI/OdeicesabletonUsedforhigh-speedI/Odevicesabletotransmitinformationatclosetomemoryspeeds.nDevicecontrollertransfersblocksofdatanDevicecontrollertransfersblocksofdatafrombufferstoragedirectlytomainmemorywithoutCPUinterventionwithoutCPUintervention.nOnlyoneinterruptisgeneratedperblock,ratherthantheoneinterruptperbyte.SoutheastUniversity2.16OperatingSystemConceptsDirectMemoryAccessStructure(Ct)(Cont.)SoutheastUniversity2.17OperatingSystemConceptsStorageStructureStoageStuctuenMainmemory–onlylargestoragemediathattheCPUcanaccessdirectly.nSecondarystorage–extensionofmainmemorynSecondarystorageextensionofmainmemorythatprovideslargenonvolatilestoragecapacity.MtidikiidtlllttnMagneticdisks–rigidmetalorglassplatterscoveredwithmagneticrecordingmaterial‹Disksurfaceislogicallydividedintotracks,whicharesubdividedintosectors.aresubdividedintosectors.‹ThediskcontrollerdeterminesthelogicalinteractionbetweenthedeviceandthecomputerSoutheastUniversity2.18OperatingSystemConceptsinteractionbetweenthedeviceandthecomputer.Moving-HeadDiskMechanismoge

1 / 34
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功