当前位置:主页 > 科技论文 > 计算机论文 >

嵌入式系统μCOS-Ⅱ内核调度算法的改进

发布时间:2019-01-26 20:02
【摘要】:嵌入式系统是计算机系统的一个重要分支。伴随着计算机应用场合的越来越广泛,嵌入式系统的应用也变得越来越多。作为以应用为目的的学科,嵌入式系统极大的提高和方便了我们的生活,在我们的生活中它是如影随形。如PDA,手机,汽车,甚至是导弹发射装置中,嵌入式系统都有广泛的存在。 嵌入式操作系统是嵌入式系统的核心,它设计的好坏直接关系到整个嵌入式系统的稳定可靠与否。而自嵌入式系统出现在世界上一问世,,人们对于它的操作系统就表现出了深厚的兴趣,对它的研究和开发就从来没有停止过。 μC/OS-II系统作为一个嵌入式操作系统,源代码表现出精妙的设计和精练浓缩的结构,同时可读性也非常强,这些都为业界所称道。它实现了一个操作系统所基本上能够达到的功能,但它最主要的是微内核的设计使它的应用范围变得越来越广[1]。 本文首先对μC/OS-II操作系统进行内核分析,全面的掌握系统的调度机制,然后提出系统存在的不足。如系统只支持一个优先级只对应一个任务的调度,可支持的任务数量不多,同时也存在着低优先级的任务等待时间过长等情况。针对以上问题,结合系统自身的优势,本文设计出改进的系统内核新的调度算法,新的调度算法是以优先级调度为第一层调度。新的调度算法重新定义了所需要的数据结构,如任务控制块。接着对新设计算法的结构组织图,控制块的初始化,链表的建立,调度的过程,任务的删除等方面进行说明。最后,改进了相关的函数,给出了新函数的执行过程。根据系统任务要求的不同,将它们分成两类:实时任务和分时任务。 实时任务占用优先级的前16个,每一个实时任务都完全占有一个优先级,而且系统仍然是第一时间响应它的调度,满足某些任务要求实时调度情况。分时任务占用的优先级界于实时任务与统计任务,空闲任务之间的这个区段。分时任务主要是用于那些要求核心处理器响应不是那么迅速的任务,可以多个任务共同占用一个优先级。它们通过双向链表来进行存储。分时任务以优先级调度作为第一层调度,以时间片调度作为第二层调度。当具有同一优先级的多个分时任务获得处理器调度的机会时,系统会对这个链接在OSTCBPrioTbl[]上的任务控制块链表进行分时调度算法。在分时任务的执行调度过程中,每执行完一个分时任务,它都要查看是否有高优先级的实时任务就绪,有则系统响应实时任务,无则对任务控制块链表边遍历边执行。而在这个过程中,高优先级的分时任务是没有打断正在执行的分时任务的权限的。 通过调度算法的改进,合理安排任务的优先级。做到实时任务满足快速调用,分时任务合理设置优先级和时间。这样,既能够满足μC/OS-II系统的实时性要求,又能够实现同一优先级下可以拥有多个任务,同时,扩大操作系统可以支撑的任务的数量。 最后,通过对新的内核调度算法进行实验测试,可以发现新的内核调度算法能够满足上面所提到的要求。
[Abstract]:The embedded system is an important branch of the computer system. With the application of computer, the application of embedded system has become more and more. As an application-oriented subject, the embedded system greatly improves and facilitates our lives, and in our lives it is like a shadow. such as a PDA, a mobile phone, an automobile, or even a missile launching device, and the embedded system has a wide range of existence. The embedded operating system is the core of the embedded system, and its design is directly related to the stability and reliability of the whole embedded system. No. And since the embedded system appeared in the world, people expressed deep interest in its operating system and never stopped its research and development..... mu.C/ OS-II system as an embedded operating system, the source code shows a fine design and a refined and concentrated structure, and the readability is also very strong, all of which are the industry It realizes the function that an operating system can basically achieve, but the main thing is that the design of the micro-kernel makes its application range more and more wide[1]. In this paper, the kernel analysis of the operating system of the. mu.C/ OS-II is first carried out, the scheduling mechanism of the system is fully grasped, and then the system is put forward. the system only supports the scheduling of only one task, the number of tasks that can be supported is not large, and the task waiting time of the low priority exists In view of the above problems, in combination with the advantages of the system itself, this paper designs a new scheduling algorithm for the system kernel, and the new scheduling algorithm is based on the priority. the new scheduling algorithm redefines the required data structure, e.g., the task control block is followed by the structure organization chart of the new design algorithm, the initialization of the control block, the establishment of the linked list, the process of scheduling, the deletion of the task, and the like. The surface is described. Finally, the correlation function is improved and a new function is given. The execution process of the system. Depending on the system's task requirements, they are divided into two categories: real-time tasks and the system is still the first time to respond to the scheduling to meet certain tasks. real-time scheduling. The priority level occupied by the task is in real-time tasks and statistics tasks, idle tasks This section between tasks is mainly used for tasks that require that the core processor response is not so fast that multiple tasks can be shared takes up a priority. They go through two-way the task of the time division is scheduled as the first layer according to the priority schedule, and the time slice is scheduled; As the second layer scheduling, when a plurality of sub-tasks with the same priority are provided with the opportunity to schedule the processor, the system proceeds to the task control block linked list on the OSTCBPrioTbl[] in that execution and dispatch of the time-division task, every time a sub-task is run, it is to check whether there is a high-priority real-time task ready, and if the system responds to the real-time task, the task control block chain is not the table edge traverses the edge to perform. In this process, the high-priority sub-task is not to interrupt the point being executed by the improvement of the scheduling algorithm. The priority of the task is to be arranged. The real-time task can meet the quick call and the time-division task. the invention can not only meet the real-time requirements of the. mu.C/ OS-II system, but also can have a plurality of tasks under the same priority, and meanwhile, the expanded operating system can In the end, the new kernel scheduling algorithm can be discovered by carrying out the experiment test on the new kernel scheduling algorithm.
【学位授予单位】:吉林大学
【学位级别】:硕士
【学位授予年份】:2012
【分类号】:TP316.84;TP368.1

【参考文献】

相关期刊论文 前3条

1 高富强;秦昌硕;游纪原;邹恒;;UC/OS-Ⅱ内核扩充时间片轮转调度算法的设计[J];计算机应用;2009年04期

2 孙育河;梁岚珍;;嵌入式实时操作系统在ARM上移植的分析与应用研究[J];计算机系统应用;2007年05期

3 陈果;冯静;;ucos系统及其消息队列详析[J];电子元器件应用;2011年03期

相关硕士学位论文 前1条

1 薛安琪;一种新的实时系统内核调度算法研究设计[D];中国科学技术大学;2010年



本文编号:2415859

资料下载
论文发表

本文链接:https://www.wllwen.com/kejilunwen/jisuanjikexuelunwen/2415859.html


Copyright(c)文论论文网All Rights Reserved | 网站地图 |

版权申明:资料由用户84573***提供,本站仅收录摘要或目录,作者需要删除请E-mail邮箱bigeng88@qq.com