【VC++开源代码栏目提醒】:网学会员,鉴于大家对VC++开源代码十分关注,论文会员在此为大家搜集整理了“【论文】μC-OS-II系统剪裁移植与应用 - 学士论文”一文,供大家参考学习!
摘 要 随着社会的信息化、智能化、网络化的发展,嵌入式系统技术也将获得广阔的发展空间。
目前它已经渗透到我们生活中的各个角落,如工业、服务业、各种电子商品等,给我们生活的方方面面带来了很多方便。
嵌入式系统是以应用为中心,以计算机技术为基础,软硬件可裁剪,适用于应用系统对功能、可靠性、成本、体积、功耗有严格要求的专用计算机系统。
本文研究了专门为单片机嵌入式应用设计的实时操作系统内核μC/OS-II,主体用标准的 ANSI C 语言写成,可移植性好,目前已被成功移植到四十多种 CPU 上。
文中首先对嵌入式系统的特性及发展前景进行了介绍,然后讨论了μC/OS-II 的源代码,它的目标是实现一个基于优先级调度的抢占式的实时内核,并在这个内核之上提供最基本的系统服务,如信号量、邮箱、消息队列、内存管理、中断管理等。
利用μC/OS-II 的特点,讨论进行移植的方法和步骤等;最后是成功的把μC/OS-II 移植到 MC9S12DG128 的 freescale MCU 上,充分体现了它良好的可移植性和高效的管理性能。
关键词: 嵌入式系统,μC/OS-II,移植 I Abstract With the information、intelligence、 network-based development of the society,the embedded systems technology will also get broad space for development. At presentit has penetrated into our lives in every aspect: such as industry、services、variouselectronic goods etc. which bring about a lot of convenience to every aspects of our lives.Embedded system as the center of application-centric based on computer technologysoftware and hardware can be tailored for the application of system of functionalityreliability cost size power consumption which are strict requirements of a dedicatedcomputer system. This paper deals with single-chip embedded applications for real-timeoperating system kernel designμC/OS-II the main use of standard ANSI C languageexcellent transfer ability has been successfully transplanted to more than 40 CPU on thespecies. First the characteristics of embedded systems and development prospects wereintroduced and then discussedμC/OS-II source code which goal is to achieve apriority-based preemptive scheduling of real-time kernel and provide the most basicservices in the kernel of the system such as semaphores mailboxes message queuesmemory management interrupt management etc Taking advantage of the feature ofμC/OS-II to discuss the methods and procedures of theμC/OS-II transplantation etcFinally successful transplant it to the MC9S12DG128 MCU of the Free Scale it fullyreflects the good portability as well as its efficient management performance. Key
words: embedded systems μC/OS-II transplantation II 目 录第一章 绪论 1 1.1 嵌入式系统的概述1 1.1.1 嵌入式系统的特点 1 1.1.2 实时操作系统概述 2 1.1.3 实时操作系统的特征 4 1.2 嵌入式系统的发展前景5 1.3 本文的研究工作及意义7第二章 实时内核 μC/OS-II 分析 8 2.1 实时操作系统概述8 2.2 实时操作系统 μC/OS-II 的内核结构 10 2.2.1 宏 OS_ENTER_CRITICAL 和 OS_EXIT_CRITICAL11 2.2.2 任务及状态 12 2.2.3 任务控制块 OS_TCB13 2.2.4 就绪表(Ready List) 14 2.2.5 任务调度(Task Scheduling) 15 2.2.6 给调度器上锁和开锁 15 2.2.7 空闲任务Idle Task16 2.2.8 统计任务16 2.2.9 μC/OS-II 的中断处理 16 2.2.10 时钟节拍 17 2.2.11 μC/OS-II 初始化 17 2.2.12 μC/OS-II 的启动 17第三章 μC/OS-II 的移植 18 3.1 μC/OS-II 移植条件及方法18 III 3.2 μC/OS-II 的移植19 3.2.1 INCLUDES.H 19 3.2.2 OS_CPU.H 19 3.2.3 OS_CPU_A.ASM20 3.2.4 OS_CPU_C.C24第四章 μC/OS-II 在 MC9S12DG128 上的移植 27 4.1 建立工程 27 4.2 程序说明 28 4.3 任务和串行接收中断程序片段如下 29 4.4 OS_CPU.H() 32 4.5 OS_CPU_C.C 33 4.6 移植过程中遇到的问题及解决 37第五章 总结与展望 38 5.1 本文总结 38 5.2 未来研究的展望39参考文献 40致 谢 41附 录 42声 明 49 IV μC/OS-II 系统剪裁移植与应用 第一章 绪论1.1 嵌入式系统的概述 嵌入式系统是一个外延极广的名词,凡是与产品结合在一起的具有嵌入式特点的控制系统都可以叫嵌入式系统,现在嵌入式系统,某种程度上指近些年比较热的具有操作系统的嵌入式系统,本文在进行分