安徽理工大学毕业设计(论文)摘要随着电子技术与软件技术的飞速发展,嵌入式系统技术己经成了最热门的技术之一。嵌入式实时操作系统是嵌入式应用软件的基础和开发平台,其中涉及到软件和硬件两方面的问题。嵌入式实时操作系统研究的核心在于其内核结构和基本功能的研究以及嵌入式实时操作系统在不同芯片上的移植、任务的开发以及功能的扩展,同时这也是嵌入式实时操作系统的难点问题。μC/OS-II以其结构清晰、性能稳定、源码公开等特点,受到广大嵌入式系统开发人员的青睐,已作为嵌入式实时操作系统被移植到许多微处理器上,在国防、航天航空、交通、能源、工业控制、通信以及人们日常生活等各个领域得到了广泛的应用。本文在阐述嵌入式实时操作系统概念和特性的基础之上,简单介绍了μC/OS-II的特点及其内核结构,分析了μC/OS-II中的任务调度和中断处理机制的过程,描述了μC/OS-II中时钟节拍服务和μC/OS-II初始化和启动的步骤。在充分了解了μC/OS-II的工作原理后,本文详细讨论了μC/OS-II在51单片机上的移植过程,其中包括OS_CPU.H、OS_CPU_A.ASM、OS_CPU_C.C这3个文件的修改。最后本文通过建立两个小任务来对μC/OS-II的移植进行了有效的测试。关键字:嵌入式实时操作系统、μC/OS-II、移植、MCS-51单片机I安徽理工大学毕业设计(论文)AbstractWiththerapiddevelopmentofelectrontechnologyandsoftwaretechnology,theembeddedsystemtechnologyhasbecomeoneofthefocalpointofresearch.Theembeddedreal-timeoperationsystemisthebaseandthedevelopmentoftheembeddedapplicationflat,relatestomanytechniquesabouthardwareandsoftware.Thekerneloftheembeddedreal-timeoperationsystemliesintheport(adaptingareal-timekerneltoadifferentmicroprocessorormicrocontroller)oftheembeddedreal-timesystem、createtasks,extendfunctionandtheresearchonthekernelandthebasalfunctionoftheembeddedreal-timeoperationsystem,whicharethedifficultiesoftheembeddedreal-timeoperationsystem.Basedontheadvantageofclearstructure,stablecapabilityandfreesoundcode,theμC/OS-IIcomesinforlotsofpeople’slikewhoempoldertheembeddedsystem.Asaembeddedreal-timeoperationsystem,theμC/OS-IIhasbeenrepotedonlotsofMPU,andhaswidelyusedandplaysaveryimportantroleinmanyfields,suchasnationaldefence,spacenavigation,traffic,energysources,industrycontrol,communications,andcivilliving.Baseontheexpatiateontheconceptandthecharacteristicabouttheembeddedreal-timeoperationsystem,thetextisintroducedthetraitofμC/OS-IIandthestructureofkernel.ThekernelofμC/OS-IIisdiscussedthetaskschedulingofμC/OS-IIandtheinterruptsunderμC/OS-IIareanalyzed,μC/OS-II'sclocktickandtheprocessabouttheinitializationandstartingofμC/OS-IIaredescribed.BaseonthesufficientcognitionofμC/OS-II’selements,thereisbataroundthetransplantprocessofμC/OS-IIonSingleChipMicyocoof51,whichincludes3fileswouldbereworked:OS_CPU.H、OS_CPU_A.ASMandOS_CPU_C.C.Atlast,twolittertaskshasbeenerectedtotesttheembeddedsystemofμC/OS-II.Keywords:theembeddedreal-timeoperationsystem,μC/OS-II,transplant,SingleChipComputerofMCS-51II安徽理工大学毕业设计(论文)目录摘要..........................................................................................................................................IABSTRACT....................................................................................................................................II1绪论............................................................................................................................................11.1嵌入式操作系统..................................................................................................................11.1.1嵌入式操作系统...........................................................................................................11.1.2嵌入式实时操作系统...................................................................................................21.1.3典型嵌入式操作系统介绍...........................................................................................41.2嵌入式实时操作系统的现状和未来..................................................................................61.2.1RTOS发展历史.............................................................................................................61.2.2RTOS市场和技术发展的变化.....................................................................................71.2.3RTOS的未来.................................................................................................................71.2.4RTOS在中国.................................................................................................................81.3µC/OS-Ⅱ的产生和发展......................................................................................................92µC/OS-Ⅱ简介.........................................................................................................................112.1µC/OS-Ⅱ的特点................................................................................................................112.2µC/OS-Ⅱ内核结构............................................................................................................132.2.1临界区.........................................................................................................................132.2.2任务及任务控制块.....................................................................................................142.2.3任务状态.....................................................................................................................152.2.4任务调度.....................................................................................................................162.2.5中断处理.....................................................................................................................182.2.6时钟节拍.....................................................................................................................192