学习《linux设备驱动程序》遇到问题之 配置一个测试系统

本文详细介绍了Linux内核驱动程序的学习过程中遇到的问题,包括‘内核源代码树’的概念解释以及如何配置新系统的步骤。通过使用makeconfig、makemenuconfig或makeoldconfig等命令进行内核配置,简化了配置过程并提供了新内核版本引入配置项的交互式选择。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在学习《linux设备驱动程序》第二章时,首先书中要提到设置测试系统。

遇到两个问题:1.“内核源代码树 ”的概念 2.如何配置一个新的系统

问题1.答案:

所谓的内核源代码树其实就是内核源代码,只是源代码的组织方式是树状,所以称为内核源代码树。

问题2解决方案:

在配合内核时可以利用 make config 或者make menuconfig 或者make oldconfig。由于前两者要一一配置选项太多,所以利用make oldconfig简单,该命令会保留.config已有的配置项的值,而对于新Kernel版本引入的新配置项提供交互式的选择


Previously, we used the make menuconfig or gconfig or xconfig method to change different configuration options. But once you have a working configuration, the only thing that is necessary is to update it with any new options that have been added to the kernel since the last release. To do this, the make oldconfig and make silentoldconfig options should be used.

make oldconfig takes the current kernel configuration in the .config file, and updates it based on the new kernel release. To do this, it prints out all configuration questions, and provides an answer for them if the option is already handled in the configuration file. If there is a new option, the program stops and asks the user what the new configuration value should be set to. After answering the prompt, the program continues on until the whole kernel configuration is finished.

make silentoldconfig works exactly the same way as oldconfig does, but it does not print anything to the screen, unless it needs to ask a question about a new configuration option.

Usually, when upgrading between different versions of the stable releases, no new configuration options are added, as this is supposed to be a stable kernel series. If this happens, there are no new questions that need to be answered for the kernel configuration, so the program continues successfully without any need for user intervention.


参考文献:http://www.averainy.info/ye_tan_linux_kernel_hacking_nei_he_pei_zhi_bian_yi_yu_an_zhuang/

               http://www.linuxtopia.org/online_books/linux_kernel/kernel_configuration/ch07s03.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值