节点文献

基于单触发时钟的嵌入式Linux实时技术研究与优化

The Research and Optimization of Real-time Technology in Embedded Linux Based on One-shot Clock

【作者】 王文竹

【导师】 吴庆波;

【作者基本信息】 国防科学技术大学 , 计算机科学与技术, 2009, 硕士

【摘要】 近年来,嵌入式系统在军事、工业、航天等重要领域得到了广泛应用,同时这些领域对系统的实时性也提出了越来越高的要求。相对于其它嵌入式操作系统,Linux具有开放源代码、可裁剪、性能稳定、可靠性高、支持SMP体系结构等特点,目前基于Linux的嵌入式系统应用案例越来越丰富。本文对嵌入式Linux中的时钟机制、计时系统、时间戳系统、定时器系统以及调度框架和调度算法进行了深入的分析。在此基础上,针对嵌入式Linux在实时性能上所面临的问题,基于单触发时钟对其进行了实时优化。在时钟系统方面,本文首先实现了单触发时钟,并基于单触发时钟设计了资源控制器OTRC(One-shot Timer Based Resource Controller,OTRC)。OTRC主要用于管理系统中的资源(如CPU等),并根据具体的实时需求来控制时钟中断的时间。另外,改造了计时系统,保证了系统在单触发时钟下计时的正确性。在定时器系统方面,设计了高精度定时器系统。该系统基于OTRC对定时器队列的管理,可以得到微秒级的时钟精度。另外利用时间戳计数器设计了细粒度的时间戳系统,为高精度定时器系统提供了准确的时间度量。改造后的高精度定时器系统能够达到微秒级的定时精度。在调度算法上,提出了OBED(OTRC Based EDF Scheduling,OBED)实时调度算法,并设计了新的实时调度框架。该框架将实时进程和非实时进程分开管理,对实时进程使用EDF调度算法,而对非实时进程使用Linux原有的调度算法,并利用OTRC对进程的执行进行管理和控制。OBED算法综合了两种算法的优点,既能够保证实时进程的时间约束条件,又可以提高非实时进程的性能,达到了提高系统吞吐率的目的。最后,本文在PowerPC嵌入式平台上实现了单触发时钟系统、细粒度时间戳系统、OTRC资源控制器和高精度定时器系统,并实现了OBED实时调度框架的原型系统。测试结果显示,改进后的系统在实时性方面有了很大的提高。

【Abstract】 In recent years, embedded systems have been widely applied in the military, industrial, aerospace and other important areas. At the same time, the real-time also raised higher and higher requirements in these areas. Compared with other embedded operating systems, Linux has many advantages which can be cutting, stable performance, high reliability, support for SMP architecture, and so on. In view of these, this article emphasizes on how to improve the real time technology of embedded Linux.This paper has deeply analysised the clock mechanism, timing system, time stamp system, timer system, scheduler, and scheduling algorithm. Then it presents the corresponding solutions against these key problems based on the one-shot timer for embedded real-time Linux.In the clock system, this article designs the resource controller OTRC (One-shot Timer Based Resource Controller, OTRC) based on the one-shot timer. OTRC is used to control the interrupt of the one-shot clock, manage the resource in the system, and control the one-shot clock according to the specific needs of real-time requjirements. In order to maintain the accuracy of timing, the timing system is rebuilt.In the timer system, the high resolution timer is designed. The high resolution timer system can require microsecond-level clock accuracy based on the OTRC which manage the queue of timer. In addition, the time stamp system which can provide accurate time measurement to high resolution timer system is designed, and it works based on the time stamp counter. The high resolution timer system can achieve microsecond-level timing accuracy.In the scheduling algorithm, the OBED (OTRC Based EDF Scheduling, OBED) real-time scheduling algorithm is designed, and the real-time scheduling framework based on OTRC is designed. The framework separates the real-time process and general process. The real-time process is scheduled with EDF algorithm, while the general process is scheduled with the traditional Linux scheduling algorithm. OBED algorithm combines the advantages of the two algorithms, and controls the preemption of processes. The OBED scheduling framework can not only guarantee the time constraints of real-time process, but also improve the performance of non-real-time process. So, this framework can improve the throughput in the real-time system.Finally, this paper implements the one-shot clock system, time-stamp system, OTRC, and high resolution timer system, and then implement a simple system of OBED scheduling framework in Linux kernel. The experimental results show that the improved system is greatly improved in the real-time performance.

节点文献中: 

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

本文的引文网络