首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >linux内核配置文件中代码的含义

linux内核配置文件中代码的含义
EN

Stack Overflow用户
提问于 2017-06-21 08:22:33
回答 2查看 1.5K关注 0票数 2

我想为raspberry 3配置并构建一个内核,但是当我读取一个配置文件时,我不知道linux-kernel配置文件中代码的含义。我试着搜,但找不到。

例:

CONFIG_SYSVIPC=y -> CONFIG_SYSVIPC是什么意思?

CONFIG_POSIX_MQUEUE=y -> CONFIG_POSIX_MQUEUE是什么意思?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2017-06-21 19:25:44

我试着搜,但找不到。

使用find管道到grep定位内核源代码中Kconfig*文件中配置参数的定义:

代码语言:javascript
复制
find . -name "Kconfig*" | xargs grep "config PARM"

其中PARM是CONFIG_PARM的文本。

https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt中记录了Kconfig*文件的树结构和菜单实体。

CONFIG_SYSVIPC=y -> CONFIG_SYSVIPC是什么意思?

使用搜索方法生成

代码语言:javascript
复制
/home/test/linux-4.4.1$ find . -name "Kconfig*" | xargs grep "config SYSVIPC"
./arch/x86/Kconfig:config SYSVIPC_COMPAT
./arch/mips/Kconfig:config SYSVIPC_COMPAT
./arch/powerpc/Kconfig:config SYSVIPC_COMPAT
./arch/parisc/Kconfig:config SYSVIPC_COMPAT
./arch/s390/Kconfig:config SYSVIPC_COMPAT
./arch/ia64/Kconfig.debug:config SYSVIPC_COMPAT
./arch/sparc/Kconfig:config SYSVIPC_COMPAT
./arch/tile/Kconfig:config SYSVIPC_COMPAT
./arch/arm64/Kconfig:config SYSVIPC_COMPAT
./init/Kconfig:config SYSVIPC
./init/Kconfig:config SYSVIPC_SYSCTL
/home/test/linux-4.4.1$

除了与拱形相关的条目外,init/Kconfig.中的init子系统还具有主要的配置条目。

如果你幸运的话,在“帮助”部分有一个很好的解释。

代码语言:javascript
复制
config SYSVIPC
        bool "System V IPC"
        ---help---
          Inter Process Communication is a suite of library functions and
          system calls which let processes (running programs) synchronize and
          exchange information. It is generally considered to be a good thing,
          and some programs won't run unless you say Y here. In particular, if
          you want to run the DOS emulator dosemu under Linux (read the
          DOSEMU-HOWTO, available from <http://www.tldp.org/docs.html#howto>),
          you'll need to say Y here.

          You can find documentation about IPC with "info ipc" and also in
          section 6.4 of the Linux Programmer's Guide, available from
          <http://www.tldp.org/guides.html>.

CONFIG_POSIX_MQUEUE=y -> CONFIG_POSIX_MQUEUE是什么意思?

使用搜索方法生成

代码语言:javascript
复制
/home/test/linux-4.4.1$ find . -name "Kconfig*" | xargs grep "config POSIX_MQUEUE"
./init/Kconfig:config POSIX_MQUEUE
./init/Kconfig:config POSIX_MQUEUE_SYSCTL
/home/test/linux-4.4.1$ 

init/Kconfig的检查发现这个配置条目:

代码语言:javascript
复制
config POSIX_MQUEUE
        bool "POSIX Message Queues"
        depends on NET
        ---help---
          POSIX variant of message queues is a part of IPC. In POSIX message
          queues every message has a priority which decides about succession
          of receiving it by a process. If you want to compile and run
          programs written e.g. for Solaris with use of its POSIX message
          queues (functions mq_*) say Y here.

          POSIX message queues are visible as a filesystem called 'mqueue'
          and can be mounted somewhere if you want to do filesystem
          operations on message queues.

          If unsure, say Y.

当然,您不应该直接编辑.config文件。

使用menuconfig (或类似的) make目标(例如make menuconfig)确保满足所有依赖项,并启用所有自动选择。

票数 1
EN

Stack Overflow用户

发布于 2017-06-21 09:36:32

用于配置内核的内核配置文件,比如启用/禁用驱动程序。

CONFIG_PCI=y意味着,内核源代码中的PCI部分将包括在编译中。如果PCI接口在硬件上可用,我们将在配置文件中启用PCI。

CONFIG_SYSVIPC=y在内核中启用消息队列、信号量集和共享内存段。

CONFIG_POSIX_MQUEUE=y在内核中启用posix消息队列。

为了更好地理解,http://www.tldp.org/HOWTO/SCSI-2.4-HOWTO/kconfig.html,请参考下面的链接

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44670591

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档