摘要:嵌入式操作系统是嵌入式系统的核心部分,是系统功能的外在表现,它控制着整个系统的所有资源并提供开发应用程序的基础。由于Linux操作系统所具有的若干优良特点,例如,源代码免费、内核稳定高效,使得基于Linux来研究嵌入式操作系统成为一种廉价、高效率、市场前景广阔的研究策略。
Linux的内核资源丰富,功能完善,工作稳定。本文首先介绍了虚拟文件系统模块、进程通信模块、网络接口模块的工作原理。在对其组成模块深入的分析基础上,着重剖析了内核的内存管理模块和进程管理模块。然后通过研究Linux进程调度算法实时性问题,提出了一种基于动态优先级的进程调度的实现方案。该算法提出了一种动态的优先级的思想,可以根据进程的状态来改变进程的优先级,能够较好的适应系统的实时性要求。设计并实现了该算法,通过实验模拟,表明其具有良好的性能。最后进一步介绍了Linux内核编译,升级和移植的方法。
关键词:嵌入式操作系统,Linux内核,进程
Research on the Kernel of Embedded Operating System
Abstract :Embedded operating system is the key part of embedded system and the outer representation of system functions. It controls all the resources of the whole system and provides the foundation for exploiting and applying programs. Linux operating system possesses a variety of good characteristics: for example, the formal code is free and the kernel of it is steady and highly effective. These advantages make the research on embedded operating system, which is based on Linux, a research strategy that is highly effective and of broad market prospects.
Linux kernel is rich in resources, functions and stable when it works. This paper introduces the work principles of the Virtual File System module, the process of communication module and the network interface module. In its in-depth modules based on the analysis, it focuses on an analysis of the kernel memory management module and process management module. Through doing researching on the process of Linux for real-time scheduling algorithm, this paper presents a dynamic priority based on the process of realization of program scheduling. The algorithm presents a dynamic priority of thinking, which can change the process priority according to the state of the process and better adapt the real-time requirements. This algorithm has strong advantages in improving the real-time system. This paper designs and implements the algorithm and the simulation test confirms its good performances. Finally, this paper introduces the compiling, upgrading and transplanting methods on the Linux kernel.
Key words: embedded operating system, Linux kernel, process
1.绪论
1.1课题来源及研究意义
嵌入式系统是指以应用为中心、以计算机技术为基础、软件硬件可裁剪、适应应用系统对功能、可靠性、成本、体积、功耗严格要求的专用计算机系统。嵌入式操作系统是支持嵌入式系统应用的操作系统软件,它是嵌入式系统极为重要的组成部分,通常包括与硬件相关的底层驱动软件、系统内核、设备驱动接口、通信协议、图形界面、标准化浏览器等。与通用操作系统相比较,嵌入式操作系统在系统实时高效性、硬件的依赖性、软件固态化以及应用的专用性等方面具有较为突出的特点。嵌入式操作系统的出现,将大大提高嵌入式系统开发的效率,改变以往嵌入式软件设计只能针对具体的应用从头做起。在嵌入式操作系统之上开发嵌入系统将减少系统开发的工作量,增强嵌入式应用软件的可移植性,使嵌入式系统的开发方法更具科学性。近年来,随着电子技术的不断进步,嵌入式系统开发己成为热点,而Linux作为一个自由软件,也得到了极大的发展,嵌入式系统与Linux的结合,正日益被人们看好。Linux自身具备一整套工具链,容易自行建立嵌入式系统的开发环境和交叉运行环境,并且可以跨越嵌入式系统开发中的仿真工具(ICE)的障碍。Linux具有内核小,效率高,源代码开放等优点。强大的网络支持使得可以利用Linux的网络协议栈将其开发成为嵌入式的TCP/IP网络协议栈。所以在Linux的基础上,借鉴它的思想、结构,对其进行改造来构建嵌入式操作系统是一个明智之举。