本科毕业设计
Linux系统实时响应特性分析与实验验证
——基于Ti达芬奇DSP系列TMS320DM6441
刘XX 2008XXX
指导教师 赵XX 教授
学院名称 论文提交日期
工程学院 2012年5月16日
专业名称 通信工程 论文答辩日期 2011年5月19日
摘 要
随着嵌入式技术的发展,Linux以开源、稳定和健壮的特点在嵌入式设备领域中得到了越来越广泛的应用。然而,Linux不是真正的实时系统,在一些有较高实时性要求的应用场合中受到了限制。为此,人们越来越重视Linux的实时性能和实时化研究,并取得了不少进展,如Kurt-Linux、RTLinux和MontaVista Linux等。
本文以TI的达芬奇TMS320DM6441为平台,对嵌入式Linux系统的实时响应特性进行分析和实验验证。首先介绍了DaVinci技术和MontaVista Linux的基本情况,分析了常用的实时性能指标,并结合目前典型的实时化方法对MontaVista Linux Professional 5.0中融合的2.6.18内核的实时性能进行了深入的分析。时间性能是衡量实时操作系统很重要的参数,而任务切换时间和中断响应时间是最重要的实时性能指标。为了评估嵌入式Linux的时间性能,本文在TMS320DM6441移植了MontaVista Linux-2.6.18,在一定负载下分别用软件和结合硬件(示波器)的方法对两个时间参数进行了测试。通过对测试数据的比较分析,发现基于DM6441的MontaVista Linux-2.6.18采用SCHED_FIFO调度策略和较高实时优先级时,任务切换时间为118us-270us,GPIO中断响应时间为5.6us-11.3us,
DSPLINK消息传递时间为279us-286us,其实时性能能满足大部分的应用场合。
本文为改进嵌入式Linux实时性能提供了思路,对应用Linux系统进行研究嵌入式实时系统的研究和开发有一定的应用参考价值,并为应用DM6441进行开发提供了时间性能方面的参考。
关键词:DaVinci TMS320DM6441 MontaVista Linux-2.6 实时性能测试 实验验证
Linux Real-Time Performance Analysis and Experimental Verification
——Based on DaVinci TMS320DM6441
Liu Dasheng
(College of Engineering,South China Agricultural University,Guangzhou 510642,China) Abstract: As the development of embedded technology, Linux has been widely used with the characteristics of open source, stable and robust. As an incomplete RTOS, it has limitations in some superior RT fields. So Linux's RT performance and study have attracted widely attention, achieving some progresses, such as Kurt-Linux, RTLinux and MontaVista Linux etc.
This paper focuses on the response characteristic of embedded Linux system with the analysis and experimental verification based on the TI DaVinci TMS320DM6441. It firstly introduces the DaVinci and MontaVista Linux, analyzing the general real-time Performance Index, and analyzes thoroughly the real-time performance of the Linux-2.6.18 kernel integrated in the MontaVista Linux Professional 5.0. Time performance is an important parameter in the real-time operating system, and the task of switching time and interrupting response time is the most important real-time performance index. In order to evaluate the embedded Linux time-performance, based on the TMS320DM6441 transplanted with MontaVista Linux-2.6.18, under certain load, the author respectively tests the two-time parameters by the method of combining with software and hardware (with an oscilloscope).
Through analyzing and comparing the tested data, it is found that when the DM6441 based MontaVista Linux-2.6.18 applies the SCHED_FIFO scheduling strategy and the superior real-time priority, task switching time is 118us-270us, GPIO interrupt response time is 5.7us-11.3us and DSPLINK transfer time is 279us-286us, showing a good real-time performance and widely application.
This paper provides a guideline to improve the real-time performance of embedded Linux, it also has an application of reference value on embedded Linux real-time systems research. And it provides the time-performance references for the development with DM6441. Key words:DaVinci TMS320DM6441 MontaVista Linux-2.6 Real-Time Performance Test Experimental Verification
目 录
1 前言 .......................................................................................................................................... 1 1.1 课题的研究背景 ................................................................................................................... 1 1.2 研究现状与发展趋势 ........................................................................................................... 1 1.3 研究目标与内容 ................................................................................................................... 4 1.4 本文结构 ............................................................................................................................... 4 2 DaVinci技术与嵌入式Linux .................................................................................................. 5 2.1 DaVinci技术简介.................................................................................................................. 5 2.1.1 DaVinci硬件平台............................................................................................................... 5 2.1.2 DaVinci软件平台............................................................................................................... 6 2.2 MontaVista Linux与实时系统 .............................................................................................. 6 2.3 本章小结 ............................................................................................................................... 8 3 嵌入式Linux系统实时响应特性分析 .................................................................................. 9 3.1 嵌入式系统的实时性能指标 ............................................................................................... 9 3.1.1 任务切换时间 .................................................................................................................... 9 3.1.2 中断响应时间 .................................................................................................................. 10 3.2 嵌入式Linux的实时化方法 ............................................................................................. 11 3.3 MontaVista Linux的实时性分析 ........................................................................................ 12 3.4 本章小结 ............................................................................................................................. 14 4 MontaVista Linux时间性能测试方案设计 ........................................................................... 15 4.1 总体测试方案介绍 ............................................................................................................. 15 4.2 常用的几种系统实时性能测试方法和测试工具 ............................................................. 15 4.3 实验平台设计 ..................................................................................................................... 17 4.3.1 硬件平台设计 .................................................................................................................. 17 4.3.2 软件平台设计 .................................................................................................................. 18 4.4 测试方案设计 ..................................................................................................................... 19 4.4.1 系统运行负载设计 .......................................................................................................... 19 4.4.2 任务切换时间测试方案设计 .......................................................................................... 20 4.4.3 中断响应时间测试方案设计 .......................................................................................... 23
4.4.4 GPIO驱动程序设计......................................................................................................... 26 4.5 本章小结 ............................................................................................................................. 29 5 MontaVista Linux时间性能测试 ........................................................................................... 30 5.1 测试方案实施介绍 ............................................................................................................. 30 5.2 测试平台搭建 ..................................................................................................................... 30 5.2.1 DM6441开发环境搭建 ................................................................................................... 30 5.2.2 Linux系统移植 ................................................................................................................ 31 5.3 任务切换时间测试与数据分析 ......................................................................................... 33 5.3.1 任务切换时间测试 .......................................................................................................... 33 5.3.2 数据分析 .......................................................................................................................... 37 5.4 中断响应时间测试与数据分析 ......................................................................................... 37 5.4.1 中断响应时间测试 .......................................................................................................... 37 5.4.2 数据分析 .......................................................................................................................... 40 5.5 结论 ..................................................................................................................................... 41 5.6 本章小结 ............................................................................................................................. 41 6 总结与展望 ............................................................................................................................ 42 6.1 总结 ..................................................................................................................................... 42 6.2 展望 ..................................................................................................................................... 43 6.3 本章小结 ............................................................................................................................. 43 参 考 文 献 .............................................................................................................................. 44 附 录 .................................................................................................................................... 46 附录A 基于TMS320DM6441实验平台实物与测试过程照片 ........................................... 46 附录B 系统负载程序源代码 .................................................................................................. 48 附录C 任务切换时间软件测试程序源代码 .......................................................................... 52 附录D 任务切换时间硬件辅助测试程序源代码 .................................................................. 56 附录E 中断响应时间硬件辅助测试程序源代码 .................................................................. 59 附录F GPIO驱动程序源代码 ................................................................................................. 61 致 谢 .................................................................................................................................... 68 毕业论文成绩评定表