在学习《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