Yleiskatsaus
Thegeneraloperatingsystemisanoperatingsystemwithmanytypesofoperatingcharacteristics.Itcanhavemultiplebatchprocessing,time-sharing,real-timeprocessingfunctionsatthesametime,ortwoormoreofthem.
Esimerkki:reaaliaikainen+eräkäsittely=reaaliaikainen eräkäsittelyjärjestelmä.Varmista ensin, että reaaliaikaiset tehtävät käsitellään ensin ja eräkäsittely suoritetaan.Reaaliaikaisia tehtäviä kutsutaan usein foreground-töiksi, ja erätöitä kutsutaan taustatöiksi.
Toinen esimerkki:ajanjakokäsittely+eräkäsittely=time-sharingbatchprocessingsystem.Toisin sanoen:työt, joilla on vähän aikavaatimuksia, tuodaan "taustalle" (eräkäsittely)prosessointia varten.
Fromthemid-1960s,theinternationalcommunitybegantodevelopsomelarge-scalegeneral-purposeoperatingsystems.Thesesystemstrytoachievethegoalofbeingfullyfunctional,adaptabletovariousapplicationrangesandchangingoperatingmodes.However,thesesystemsaretoocomplexandlarge,notonlypayingahugeprice,butalsoencounteringgreatdifficultiesinsolvingtheirreliability,maintainabilityandunderstandability.
Incontrast,theUNIXoperatingsystemisanexception.Thisisauniversalmulti-usertime-sharinginteractiveoperatingsystem.Itfirstbuildsaleancore,butitsfunctionsarecomparabletomanylargeoperatingsystems.Outsidethecorelayer,itcansupporthugesoftwaresystems.Ithasbeenquicklyappliedandpromoted,andhasbeencontinuouslyimproved,whichhasasignificantimpactonmodernoperatingsystems.
Vikoja
Keskeyttää
Forcurrentlyrunningtasks,interruptsareItshowsgreatrandomnesstotheextent,soitisimpossibletopredictwhentheinterruptionwilloccur.InGPOS,thepriorityoftheinterruptishigherthanthepriorityofthetaskexecution,sotheexecutiontimeoftheinterruptedtaskbecomesuncertainduetotheuncertaintyoftheinterruptoccurrence.Thisuncertaintymaybefatalforreal-timesystemswithtimeconstraints.
Multitasking ja tehtävien ajoitus
GPOSgenerallyadoptsround-robinpriorityschedulingalgorithm,anditscoreisasetofpriorityadjustablequeues.Eachqueuemaintainsasetoftaskswiththesamepriority.Theschedulingalgorithmallocatesatimesliceforeachtaskinthehighestpriorityqueue,andthetaskstime-divisionandreusetheCPUaccordingtothetimeslice.Theschedulingalgorithmwillgraduallyadjustthepriorityofeachqueue,sothatthetasksinthelow-priorityqueuecaneventuallybeexecuted.Inthiskindofschedulingalgorithm,sinceitisimpossibletoaccuratelypredicthowlongataskneedstowaittobeexecutedandhowlongitcanbeexecuted,thiskindofschedulingalgorithmcannotsatisfytheschedulingofreal-timetasks.
Virtuaalinen tallennustila
AlmostallGPOSusespage-basedvirtualstoragetechnology.Inthevirtualmemorymechanism,whenapagefails,itmustbeaccompaniedbyapagechangeoperation,whichhasanegativeimpactonthereal-timeperformanceofthetask.Ontheonehand,ifthecurrenttaskhasapagefailure,thetaskisinterruptedandthesystemperformsapagechangeoperation;ontheotherhand,ifmultipletasksshareaphysicalpage,therewillbepagethrashing.Theprocessofpagefailureisverycomplicated,involvingmanyfactors,suchasfailureinterruption,diskoperation,systemstoragecapacity,etc.Inpage-basedGPOS,frequentpagefailurescanmakeitimpossibletoaccuratelypredicttheexecutiontimeofatask.
DMA
DMAtechnologygreatlyimprovestheoverallthroughputofthesystem,effectivelyreducestheprocessor’sinterventionintheoperationofI/Odevices,andimprovestheprocessorUtilizationrate.ButbecauseDMAmustvisitthemainmemory,soduringDMAtransfer,I/OdeviceandCPUaretime-sharingcontentionformainmemory.WhentheDMAtransferoccupiesthestoragebus,theprocessorcannotreadorwritethemainmemory.Althoughinmanysystems,theprocessorreadsandwritesthememorythroughtheCacheinsteadofdirectlyreadingandwritingthemainmemory,butwhentheCachefailsandthesystemisundergoingDMAtransfer,theCachestillcannotreadandwritethemainmemoryimmediately.TheDMAtransmissionmethodaddsuncertainfactorstoaccuratelypredictthetimefortheCPUtocompleteatask.
Reaaliaikainen laajennusmenetelmä
(1)Integroitu aikataulutus
Integratedschedulingisaconceptthatreferstothesimultaneoususeofreal-timeschedulingalgorithmsandnon-standardschedulingalgorithmsinthesameoperatingsystem.Real-timeschedulingalgorithmsareusedtoschedulereal-timetasksandnon-real-timetasksrespectively.Intheintegratedschedulingscheme,sincereal-timetasksareassigneddeadlines,real-timetasksandnon-real-timetasksarefairlyscheduledbythescheduler,andthesystemdoesnotgivereal-timetasksahigherpriority.Theschedulerfirstallocatesprocessortimeslicestoreal-timetasks,andtheallocationalgorithmiscarriedoutaccordingtotheendofthedeadline.Accordingtotherequirementsofreal-timetasksforprocessortimeslicesandtheworkloadofnon-real-timetasks,theschedulingalgorithmmaintainsafairallocationschemebetweenreal-timetasksandnon-real-timetasks.Fornon-real-timetasks,theschedulerusesaround-robinschedulingalgorithmforscheduling.Althoughintegratedschedulingcanfairlyallocateprocessortimeslicestoreal-timetasksandnon-real-timetasks,experimentaldatashowsthatthecompletiontimeofreal-timetasksfluctuatesgreatlydependingonthesystemload.Whenthefluctuationistoolarge,theperformancepredictionoftheentiresystemisinaccurate,andtheresultisthattheutilizationrateoftheprocessorisgreatlyreducedorotherreal-timetaskscannotbeexecuted.
(2)ProcessorResourceReservation
ProcessorResourceReservation(PCR)isanabstractmechanism.PCRallowsuserstocontroltheallocationofprocessorcycles,trackreservedresourcesandmeasureprocessorresourcesusedbytasks,andsolvetheschedulingproblemsofreal-timetasksandnon-real-timetasks.InPCR,thereal-timetaskmodelisaperiodicmodel.InthePCRsolution,almostallfunctionalcomponentsoftheoperatingsystemneedtobemodifiedorredesigned.
(3)ReaaliaikainenMach
Thereal-timeMachprojecthopestodevelopareal-timeversionoftheMachkernel.Inreal-timeMach,allsub-partsoftheoriginalMachkernelhavebeenredesigned.Real-timeMachaddsreal-timethreadmanagement,integratedtime-drivenscheduler,real-timesynchronizationandmemory-residentobjectsonthebasisoftheoriginalkernel.Inreal-timeMach,theprocesscancreatebothreal-timeandnon-real-timethreads.Whencreatingareal-timethread,theuserneedstoprovidesomeparametersaboutthreadtimecharacteristics,suchasperiod,maximumoverhead,deadline,andwhetherthedeadlineisharddeadlineorsoftdeadline.Real-timeMachimplementsareal-timesynchronizationmechanismthroughpriorityinheritancetosolvethepriorityinversionprobleminGPOS.Throughthereal-timesynchronizationmechanism,whenahigh-prioritytaskissuspendedbecauseasharedresourceislockedbyalow-prioritytask,itssuspensionwaitingtimehasanupperlimit.