年会总经理主持稿串词

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

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

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

资源描述

DIAPMRTAI-Beginner’sGuide~rtai/documentation/articles/guide.html1of1109/30/200412:46PMDIAPMRTAIDipartimentodiIngegneriaAerospaziale-PolitecnicodiMilanoRealTimeApplicationInterfaceHomeRTAIHomeInfoAboutRTAINewsArchiveDocumentationApplicationsandLinksTheRTAITeamDownloadDownloadRTAIContactMailingListReportBugDIAPMRTAI-Beginner’sGuideWhatisarealtimesystem?Arealtimesystemcanbedefinedasasystemcapableofguaranteeingtimingrequirementsoftheprocessesunderitscontrol.Itmustbefastandpredictable.Fastmeansthatithasalowlatency,i.e.itrespondstoexternal,asynchronouseventsinashorttime.Thelowerthelatency,thebetterthesystemwillrespondtoeventswhichrequireimmediateattention.Predictablemeansthatitisabletodeterminetask’scompletiontimewithcertainty.Typicallyarealtimesystemrepresentsthecomputercontrollingsystemthatmanagesandcoordinatestheactivitiesofacontrolledsystem,thatcanbeviewedastheenvironmentwithwhichthecomputerinteracts.Theinteractionisbidirectional,saythroughvarioussensors(environment-computer)andactuators(computer-environment),andischaracterizedbytimingcorrectnessconstraints.Itisdesirablethattime-criticalandnontime-criticalactivitiescoexistinarealtimesystem.Botharecalledtasksandataskwithatimelinessrequirementiscalledarealtimetask.Typicallyrealtimetaskshavethefollowingtypesofrequirementsand/orconstraints.-Timingconstraints.Themostcommonareeitherperiodicoraperiodic.Anaperiodictaskhasadeadlinebywhichitmustfinishorstart,oritmayhaveaconstraintonbothstartandfinishtimes.Aperiodictaskhastoberepeatedonceperperiod.Mostsensoryprocessingisperiodic,whileaperiodicrequirementscanarisefromdynamicevents.Resourcerequirements.ArealtimetaskmayrequireaccesstocertainresourcessuchasI/Odevices,datastructures,filesanddatabases.Communicationrequirements.Tasksshouldbeallowedtocommunicatewithmessages.Concurrencyconstraints.Tasksshouldbeallowedconcurrentaccesstocommonresourcesprovidingtheconsistencyoftheresourceisnotviolated.WhatisRTAI?RTAImeansRealTimeApplicationInterface.Strictlyspeaking,itisnotarealtimeoperatingsystem,suchasVXworksorQNX.ItisbasedontheLinuxkernel,providingtheabilitytomakeitfullypre-emptable.Linuxisastandardtime-sharingoperatingsystemwhichprovidesgoodaverageperformanceandhighlysophisticatedservices.LikeotherOS,itofferstotheapplicationsatleastthefollowingservices:hardwaremanagementlayerdealingwitheventpollingorprocessor/peripheralinterruptsschedulerclassesdealingwithprocessactivation,priorities,timeslicecommunicationsmeansamongapplications.Linuxsuffersfromalackofrealtimesupport.Toobtainatimingcorrectnessbehaviour,itisnecessarytomakesomechangesinthekernelsources,i.e.intheinterrupthandlingandschedulingpolicies.Inthisway,youcanhavearealtimeplatform,withlowlatencyandhighpredicatbilityrequirements,withinfullnonrealtimeLinuxenvironment(accesstoTCP/IP,graphicaldisplayandwindowingsystems,fileanddatabasesystems,etc.).RTAIoffersthesameservicesoftheLinuxkernelcore,addingthefeaturesofanindustrialrealtimeoperatingsystem.Itconsistsbasicallyofaninterruptdispatcher:RTAImainlytrapstheperipheralsinterruptsandifnecessaryre-routesthemtoLinux.Itisnotanintrusivemodificationofthekernel;itusestheconceptofHAL(hardwareabstractionlayer)togetinformationfromLinuxandtotrapsomefundamentalfunctions.ThisHALprovidesfewdependenciestoLinuxKernel.ThisleadstoasimpleadaptationintheLinuxkernel,aneasyRTAIportfromversiontoversionofLinuxandaneasieruseofotheroperatingsystemsinsteadofRTAI.RTAIconsidersLinuxasabackgroundtaskrunningwhennorealtimeactivityoccurs.DIAPMRTAI-Beginner’sGuide~rtai/documentation/articles/guide.html2of1109/30/200412:46PMInstallingRTAIPleasehavealookattheREADME.INSTALLfileintheRTAIdistributionfordetailedinstructionshowtoinstallRTAI.KernelModulesRTAIisverymuchmoduleoriented.SotounderstandandbeabletouseRTAIisnecessarytoknowthedynamicallyloadablemodulesforLinux.TheLinuxkerneldesignissimilartothatofclassicUnixsystems:itusesamonolithicarchitecturewithfilesystems,devicedrivers,andotherpiecesstaticallylinkedintothekernelimagetobeusedatboottime.Theuseofdynamickernelmodulesallowsyoutowriteportionsofthekernelasseparateobjectsthatcanbeloadedandunloadedonarunningsystem.Akernelmoduleissimplyanobjectfilecontainingroutinesand/ordatatoloadintoarunningkernel.Whenloaded,themodulecoderesidesinthekernel’saddressspaceandexecutesentirelywithinthecontextofthekernel.Technically,amodulecanbeanysetofroutines,withtheonerestrictionthattwofunctions,init_module()andcleanup_module(),mustbeprovided.Thefirstisexecutedoncethemoduleisloaded,andthesecond,beforethemoduleisunloadedfromthekernel.Themainfunctionstousetoload/unloadandinspectkernelmodulesarecontainedinthemodutilspackage.Theyare:/sbin/insmod(insertamoduleintotherunningkernel)/sbin/rmmod(removeamodulefromtherunningkernel)/sbin/lsmod(inspectmodulesintherunningcodes)Notethattomanagewithkernelmodulesyouhavetoberoot.Onceamoduleisloaded,itpassestoformpartoftheoperatingsystem,henceitcanuseallthefunctionsandaccessallvariablesandstructuresofthekernel.Similarlytheglobalsymbolscreatedaremadeava

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

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

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

×
保存成功