节点文献

实时操作系统μc/os-Ⅱ内核分析与移植

Kernel Analysis and Porting of RTOS μc/os-Ⅱ

【作者】 王莹莹

【导师】 李斌;

【作者基本信息】 重庆大学 , 控制理论与控制工程, 2007, 硕士

【摘要】 嵌入式系统是以应用为中心,以计算机技术为基础,软硬件可剪裁,适应应用系统对功能、可靠性、成本、体积、功耗等综合性严格要求的专用性系统。它一般由嵌入式处理器、相关支撑硬件、嵌入式操作系统及上层应用软件系统组成,用以实现对其它设备的控制、监视和管理等功能。μc/os-Ⅱ作为一种嵌入式硬实时操作系统,以其良好的可靠性和卓越的实时性被广泛地应用在通信、军事、航空、航天等高精尖技术及实时性要求极高的领域中。μc/os-Ⅱ实际上是一个实时操作系统内核,只包含了任务调度、任务管理、时间管理、内存管理和任务间的通信与同步等基本功能,本文重点分析了其中的任务管理机制。μc/os-Ⅱ对任务的管理和调度主要是通过任务控制块和任务就绪表来实现的。但由于μc/os-Ⅱ就绪表结构是基于所有任务的优先级都不同这个前提,因此在μc/os-Ⅱ中,任意的两个任务都必须有不同的优先级,即使这两个任务具有同等的重要性,这种设计就导致了μc/os-Ⅱ任务切换不合理、处理优先级反转麻烦等一系列问题。针对这种情况,本文对μc/os-Ⅱ的任务调度进行了改进,将原有的基于就绪表的调度视为对优先级下就绪任务集合的调度,在确定当前优先级最高的就绪任务集合之后,再使用时间片轮转调度进行具体任务的调度。在此基础上,针对实时内核中最易出现的优先级反转问题,通过对μc/os-Ⅱ中与互斥信号量相关的函数的修改,使μc/os-Ⅱ具备了优先级继承的功能,从而消除了优先级反转。LPC2000系列是基于一个支持实时仿真和跟踪的16/32位ARM7TDMI-STMCPU的微控制器。本文将μc/os-Ⅱ移植到该处理器上,给出了相关移植文件的详细代码,并编写了一个多任务程序,对移植后的系统进行了测试,通过在实验箱上的仿真,表明了移植的正确性。文章最后利用移植后的平台,开发了一个简易的数字示波器系统,进一步了解了基于嵌入式实时操作系统的程序设计技术。

【Abstract】 Embedded system is a kind of special system that can meet application system’s compositive and strict demand on function, reliability, cost, size and power consumption. It is based on computer technology, takes applying as centre, based on computer technology, its software and hardware can be reduced. Generally it is composed of microprocessor, relevant supporting hardware, embedded operation system and upper level application software system. Therefore, it realizes control, surveillance and management of other equipments.μc/os-Ⅱis a embedded real-time operating systems (RTOS) ,with its excellent reliability and real-time performance, it has been widely used in communications, military, aviation, aerospace and other areas with high-technology and high-demand of real-time performance..μc/os-Ⅱis a real-time operating system kernel, only contains task scheduling, task management, time management, memory management and inter-task communication and synchronization, and other basic functions, This paper mainly analyses tasks management and interrupt mechanism.Task management ofμc/os-Ⅱkernel is realized by task control block and task ready table. The ready table needs different task should have different priority, even if these two tasks are of equal importance. Therefore it leads several problems on task switch and priority inversion. In this situation, this paper make some improvement on task scheduling, it schedules tasks in the set with same priority, instead of in task ready table, it determines the highest-priority tasks set firstly, then schedules tasks in this set with time slice method.The problem of priority revertion is very common in real-tijme kernel, this paper makes some correction on the function concerning about mutex signal, thereby solves this problem.LPC2000 series is a microcontrollers based on the 16-/32-bit ARM7TDMI-STMCPU that supports real-time simulation and tracking,This paper portsμc/os-Ⅱto this processor, lists detail code, and support a multi-task program, it also test the system after porting, the simulation experiment show the correctness of this porting.Finally to show how to program on embedded real-time operating system, this paper develops a digital oscillograph system.

  • 【网络出版投稿人】 重庆大学
  • 【网络出版年期】2007年 05期
  • 【分类号】TP316.2
  • 【被引频次】15
  • 【下载频次】586
节点文献中: 

本文链接的文献网络图示:

本文的引文网络