节点文献
一种改进的细化Linux时钟粒度的方法研究
Study of An Improved Method of Attenuating Linux Time Granularity
【作者】 王银辉;
【导师】 张玉芳;
【作者基本信息】 重庆大学 , 计算机系统结构, 2005, 硕士
【摘要】 实时操作系统是近年来研究的一个热点,与常见的通用操作系统相比,实时操作系统的特点在于系统的正确性不仅依赖于逻辑的正确性,还取决于输出结果的及时性。目前的实时操作系统广泛应用于国防、工业自动控制、通信等领域。现在的应用对时间提出了更高的要求,需要有能够满足实时性的操作系统作为应用的支撑。随着开源项目的兴起,作为其典型代表的Linux 得到了迅速普及和发展。由于全世界各地的Linux 用户和开发者的不断努力,Linux 已成长为稳定的、性能优异的操作系统。但Linux 只是作为一个通用分时操作系统而开发的,其设计目标追求的是公平性和系统吞吐量,和实时系统的目标存在巨大差距。由于Linux 自身的特点,基于Linux 开发一个开放的、标准的、高效廉价的实时操作系统是完全可行的,如何增强Linux 的实时性是目前实时操作系统研究的一个重点。自Linux2.6 内核2003 年底发布以来,已经被大量测试和实际应用证明其是一个高效稳定的内核。相比2.4 内核,2.6 采用了一些新技术使得实时性有了很大提高,如可抢占式内核、新的O(1)调度算法等。尽管实时操作系统的开发者可以从这些改变中受益,Linux 2.6 仍然不是一个实时内核。然而,这些以及其他相关的背景工作使得将Linux 转变为RTOS 成为可能。因此需要对Linux2.6 内核进行实时化改造,进一步提高实时性。从得到Linux2.6 内核及发型版本Fedora 后,经过几个月深入的分析,最后决定从Linux 的时钟系统着手,通过分析找出其在实时性方面的不足,加以改进,提高系统的反应时间,达到实时化的目的。在上述研究结果的基础上通过对原时钟系统的修改,本文实现了一个具有较高软实时性的Linux 内核,其中重点是实现了一个与原时钟系统共存的精密时钟系统,以支持具有强实时要求的应用。修改后的内核在PC 机上长时间运行过程中始终能够及时响应时间精度为微秒的应用,取得了良好的效果。本文给出了完整的修改Linux 内核时钟系统的方法。涵盖了常见的Linux 实时化对时钟的处理过程,同时提出了采用双时钟系统以提高Linux 实时性。对Linux实时化有着一定的借鉴意义。在修改Linux 时钟系统的过程中,主要在以下三个方面进行了研究:(1) 轻量级时钟中断;(2) 多模式时钟中断;(3) 精密的时钟系统。最后给出了实验结果及针对本文的不足而尚待努力的方向。
【Abstract】 Study of Real-time Operating System (RTOS) is now a hot topic. Compared with common OS, RTOS has the characteristic that its validity does not only depend on the logistic correctness, but also depends on outputting result in time. RTOS are wildly used in fields, such as defense, industrial automation control and communication. Today, applications need more strict time request. Operating systems that support real time are needed. With the booming of open-source projects, Linux has popularized and developed rapidly. Because of efforts made by users and developers around the world, Linux has become a stable and preeminent operating system. However, Linux is originally designed as a divided-time OS in general use and mainly aims at fairness and system throughput; it is quite different from real-time OS. According to the internal characters of Linux, it is quite possible for researchers to develop an open, standard and high efficient real-time OS which bases on Linux. Hence, how to enhance the real-time performance of Linux is the key point in the current research of real-time OS. After being released in early 2004, Linux 2.6 kernel has been proved to be stable and high efficient. Compared with 2.4 version kernel, 2.6 has been improved in real-time performance by adopting some new technologies, such as preemptible kernel, new O(1) schedule algorithm etc. Although the developer of RTOS can benefit from these changes, Linux 2.6 is still not a real-time kernel. All these changes make it possible to convert Linux to a RTOS. So the reforming of Linux kernel is needed which improve real-time performance. Since the Linux 2.6 kernel and its release version Fedora was available, after studying on it for several months carefully, some research and improvement about Linux time system are finally decided to be done in order to shorten the response time. Based on research results mentioned above, a new Linux kernel with high real-time performance is implemented by reforming its time system. The key achievement is adding a high-precision time system that coexists with the old one. The reformed kernel runs on PC for long time and meets the real-time demands in the microsecond level. The whole way of reforming the Linux kernel time system is given in this paper, including the common ideas about the Linux real-time realization and a new method in this field proposed in this paper, which adopts bi-time-system to enhance real-time performance. This method can provide some value of research of Linux real-time improvement. In the process of reforming the Linux time system, research is focused on the following three aspects. (1) Modifying the time interrupt services; (2) Multi-mode time interrupt; (3) Precise time system. At the end of this paper, experiment results are given. Some continual research aims on some limitation are also narrated.
【Key words】 Linux time granularity; Interrupt; Real-time; Operating system; timer;
- 【网络出版投稿人】 重庆大学 【网络出版年期】2006年 01期
- 【分类号】TP316.81
- 【被引频次】3
- 【下载频次】292