节点文献
Linux内核编译机制分析以及优化研究
A Study of Linux kernel Mechanism and Its Optimization
【作者】 李鹏飞;
【导师】 马志欣;
【作者基本信息】 西安电子科技大学 , 计算机系统结构, 2014, 硕士
【摘要】 Linux作为一个开源的操作系统,凭借其稳定的性能、广泛的适用性和免费的获取方式等优点已经成为各大商用产品的有力竞争者。Linux开源的特性使得用户可以按照自己的要求定制和编译内核,当用户想要给内核添加自己定制的功能时就需要对Linux内核的编译机制有一定的了解。本文详细地分析了Linux内核的Kbuild编译机制,并研究了能够加快编译速度的优化方法。本文从源码入手,按照静态结构详细分析了内核的Kconfig配置机制和Kbuild编译机制,对于组成Kbuild系统的几类Makefile根据其特性分析了其各自的作用并详述它们之间的关系。对于内核编译的动态过程,本文选取了有代表性的几个核心目标进行了分析,描述了Kbuild的机制是如何一步一步实现这些目标的。―make‖内核时可以指定参数加快速度,根据参数的特性结合系统的负载状况设计了方案找出最优参数以达到最快的编译速度。减少源代码量也可以提高内核的编译速度,本文实现了根据配置自动裁剪内核的脚本工具,可以准确有效的删减源码中没有用到的部分。
【Abstract】 As an open-source operating system, Linux, with its advantages of stableperformance, wide applicability and free access, has become a strong contender formajor commercial products.Linux‘s open source feature allows users to customize and compile the kernelaccording to their own requirements. A certain knowledge of the compile mechanismsof Linux kernel is needed when users want to add their own custom functionality. Thispaper makes a detailed analysis of the Kbuild compile mechanism of Linux kernel, andstudies the methods to accelerate the compilation speed.Starting from source code, this paper, according to the static structure, analyzes indetail the Kconfig configuration mechanism and Kbuild compilation mechanism. As tothe several kinds of Makefiles which make up the Kbuild system, this paper analyzestheir roles by their characteristics respectively and the relationship between them. Forthe dynamic process of kernel compilation, the paper selects several typical coreobjective to analyze, and describes how the Kbuild mechanism achieves these goals stepby step.Specifying the parameters of―make‖can accelerate the compile speed.In orderto find out the parameter which could achieve the fastest compilation speed, we designexperiments according to the combination of the system load status and parametercharacteristics. Reduce the amount of source code can also increase the kernelcompilation speed, this paper implements the scripting tool which can automaticallycutting kernel according to the configuration, thus making it possible to cut the uselessparts of source code accurately and effectively.
【Key words】 Linux kernel; kernel compile mechanism; Kbuildcompile optimization; Kernel source code reduction;
- 【网络出版投稿人】 西安电子科技大学 【网络出版年期】2014年 11期
- 【分类号】TP316.81
- 【被引频次】19
- 【下载频次】508