问题描述
我已经从 kernel.org 下载了 Linux 内核的源代码并通过调用创建了头文件
I have downloaded the sources for a Linux kernel from kernel.org and created the header files by calling
make ARCH=arm headers_check
我有一个嵌入式平台,我问自己这是否足够,因为我没有供应商提供的头文件.头文件的依赖是什么?在我看来,头文件是特定于硬件的,我希望它们取决于 CPU 类型等.仅通过 ARCH=arm 指定架构就足够了吗?arm系统的供应商是否有可能为Linux内核创建自己的头文件?
I have an embedded platform and ask myself if this is enough because I don't have the header files from the vendor. What are the dependencies of header files? It looks to me that header files are quite hardware specific and I expect that they depend on the CPU type etc.. Is it enough to specify the architecture just by ARCH=arm? Is it probable that a vendor of an arm system creates its own header files for a Linux kernel?
推荐答案
如果您的项目有特定的 ARM 开发板
,您可以选择该开发板的 defconfig
.defconfig 是内核存储默认构建设置集
然后设置内核构建配置
的方式.
If you have a specific ARM board in mind
for your project, you can select that board’s defconfig
.A defconfig is the kernel’s way of storing the default set of build settings
and then sets the configuration
for the kernel build.
例如
1)make mrproper
2)make ARCH=arm integrator_defconfig
--> 上面的命令将内核构建的 configuration
设置为integrator_defconfig
文件.集成器是 ARM 创建的用于开发工作的设备,是 ARM 架构中最接近通用设备的东西.
--> here above command sets configuration
for the kernel build to the settings in theintegrator_defconfig
file. The integrator is a device created by ARM for doing development work and is the closest thing in the ARM architecture to a generic device.
同样的事情可以通过设置他们各自的特定板来为其他人做,比如versatilepb
、vexpress
、exynox
等.
same thing can be done for others by settting their respective specific board like versatilepb
,vexpress
, exynox
,...etc.
您可以在内核源代码中的 ../arch/arm/configs/
中找到默认配置.下一个
You can find default configuration in ../arch/arm/configs/
in kernel source-code.next
3)make ARCH=arm INSTALL_HDR_PATH=dest headers_install
3)make ARCH=arm INSTALL_HDR_PATH=dest headers_install
安装特定板配置的头文件
,以便这些文件包含有关如何调用的信息
C 库
用于访问内核功能的内核服务
which installs specific board configured header files
so that these files have information about how to callkernel services
that the C libraries
use to access kernel functionality
这篇关于内核头文件是否取决于处理器类型、供应商等?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!