Overview
Thegeneraloperatingsystemisanoperatingsystemwithmanytypesofoperatingcharacteristics.Itcanhavemultiplebatchprocessing,time-sharing,real-timeprocessingfunctionsatthesametime,ortwoormoreofthem.
Praenomen: real-timeprocessing+batchprocessing=real-timebatchprocessingsystem.Firstofall, ut real-timetasksareprocessed prius, andbatchprocessingisperformed.Real-timetasksareoften calledforegroundjobs, andbatchjobs are calledbackgroundjobs.
Anotherexample:time-sharingprocessing+batchprocessing=time-sharingbatchprocessingsystem.Thatis:jobswithlowtimerequirementsareputintothe"background"(batchprocessing)proprocessing,jobsthatrequirefrequentinteractionareprocessedinthe" antica"
Fromthemid-1960s,theinternationalcommunitybegantodevelopsomelarge-scalegeneral-purposeoperatingsystems.Thesesystemstrytoachievethegoalofbeingfullyfunctional,adaptabletovariousapplicationrangesandchangingoperatingmodes.However,thesesystemsaretoocomplexandlarge,notonlypayingahugeprice,butalsoencounteringgreatdifficultiesinsolvingtheirreliability,maintainabilityandunderstandability.
Incontrast,theUNIXoperatingsystemisanexception.Thisisauniversalmulti-usertime-sharinginteractiveoperatingsystem.Itfirstbuildsaleancore,butitsfunctionsarecomparabletomanylargeoperatingsystems.Outsidethecorelayer,itcansupporthugesoftwaresystems.Ithasbeenquicklyappliedandpromoted,andhasbeencontinuouslyimproved,whichhasasignificantimpactonmodernoperatingsystems.
Defectus
obloquitur
Forcurrentlyrunningtasks,interruptsareItshowsgreatrandomnesstotheextent,soitisimpossibletopredictwhentheinterruptionwilloccur.InGPOS,thepriorityoftheinterruptishigherthanthepriorityofthetaskexecution,sotheexecutiontimeoftheinterruptedtaskbecomesuncertainduetotheuncertaintyoftheinterruptoccurrence.Thisuncertaintymaybefatalforreal-timesystemswithtimeconstraints.
Multitaskingandtaskscheduling
GPOSgenerallyadoptsround-robinpriorityschedulingalgorithm,anditscoreisasetofpriorityadjustablequeues.Eachqueuemaintainsasetoftaskswiththesamepriority.Theschedulingalgorithmallocatesatimesliceforeachtaskinthehighestpriorityqueue,andthetaskstime-divisionandreusetheCPUaccordingtothetimeslice.Theschedulingalgorithmwillgraduallyadjustthepriorityofeachqueue,sothatthetasksinthelow-priorityqueuecaneventuallybeexecuted.Inthiskindofschedulingalgorithm,sinceitisimpossibletoaccuratelypredicthowlongataskneedstowaittobeexecutedandhowlongitcanbeexecuted,thiskindofschedulingalgorithmcannotsatisfytheschedulingofreal-timetasks.
Virtualstorage
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.
Real-timeextensionmethod
(I) Integratedscheduling
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.
(III) Verus timeMach
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.