与新的驱动程序模块交叉编译Linux Arm Kernel [英] Cross Compiling Linux Arm Kernel with new driver module
问题描述
我正试图在我的arch linux arm机器上包括一个驱动程序.我尝试使用这些步骤来包含驱动程序模块,但是添加了驱动程序的交叉编译内核无法加载.
I am trying to include a driver for use on my arch linux arm machine. I tried using these steps to include the driver module, but my cross-compiled kernel with the added driver doesn't load.
1) Include the driver I want to add by making it have < M > beside it's
name in make ARCH=arm menuconfig
2) run: make ARCH=arm CROSS_COMPILE=/home/z3/bin/arm- (the path for my cross-compiling toolchain)
3) run: make ARCH=arm CROSS_COMPILE=/home/z3/bin/arm- modules
4) run: make ARCH=arm CROSS_COMPILE=/home/z3/bin/arm- install
5) run: make ARCH=arm CROSS_COMPILE=/home/z3/bin/arm- modules_install
6) copy my uImage from: arch/arm/boot
to my boot location: /tftpboot/
然后,当我的嵌入式linux臂尝试加载内核uImage时,它挂起: 将入口点地址更改为80008000,所以现在它挂起:
Then when my embedded linux arm tries to load the kernel uImage, it hangs with: Changed the entry point address to 80008000, so now it hangs with:
Filename '/tftpboot/uImage'.
Load address: 0x81800000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
####################################
done
传输的字节数= 3174848(十六进制3701c0)
Bytes transferred = 3174848 (3071c0 hex)
图片名称:2.6.35-ModifiedEntry
图像类型:ARM Linux内核图像(未压缩)
数据大小:3174784字节= 3 MiB
加载地址:80008000
入口点:80008000
正在验证校验和...确定
正在加载内核图像...确定
确定
Image Name: 2.6.35-ModifiedEntry
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3174784 Bytes = 3 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK
正在启动内核...
我交叉编译内核错了吗?它无法加载uImage.我要做的就是用新包含的驱动程序(包含在make menuconfig的config中)为linux arm机器交叉编译我的内核.我是否还缺少其他任何步骤?
Am I cross-compiling my kernel wrong? It cannot load the uImage. All I want to do is cross compile my kernel for the linux arm machine with a newly included driver (included in the config from make menuconfig). Am I missing any additional steps?
推荐答案
您在内核构建过程中犯了两个错误.
You have done two mistake in kernel building procedure.
1)在make menuconfig
您需要有一个.config
文件,该文件应以源代码形式退出.
you need to have a .config
file should exit in source-code.
您如何获得它
1)使ARCH = arm board_defconfig
1) make ARCH=arm board_defconfig
在/arch/arm/configs中检查默认配置
check your default config in /arch/arm/configs
例如,使ARCH = arm通用型_defconfig
e.g make ARCH=arm versatile_defconfig
这会将default
配置写入.config
2)如果您不知道默认配置,则可以在目标板文件系统中获取它.
2)if you dont know your default configuration you can get it in target board Filesystem.
它将在/proc/config.gz中复制到您的主机,并将其解压缩并在顶部的源代码中复制为.config
.
或者它可能出现在/boot/config.x.x.x
it will be in /proc/config.gz copy to your host untar it and copy as .config
in top source-code.
or it may present in /boot/config.x.x.x
如果不执行上述步骤,则使ARCH = arm menuconfig将从/boot/config-x.x.x复制主机x86配置文件,这将是错误的配置文件
if dont follow above step make ARCH=arm menuconfig this will copy host x86 config file from /boot/config-x.x.x which will be wrong config file
完成上述步骤后,下一步进行ARCH = arm menuconfig启用驱动程序.
Once above step is done then next step make ARCH=arm menuconfig here enable your driver.
第二个错误是make ARCH=arm CROSS_COMPILE=/home/z3/bin/arm- modules_install
这将在x86主机的/lib/modules中安装模块.
This will install modules in /lib/modules of x86 host machine.
所以跟随下面的一个
make ARCH=arm CROSS_COMPILE=(path to arm) uImage modules
创建目录以安装动态可加载模块
create a directory to install your dynamic loadable modules
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- modules_install INSTALL_MOD_PATH=<path to install modules>
然后,您需要将模块复制到目标.
Then you need to copy modules to your target.
有关更多详细信息,您可以参考以下运行Qemu后仅出现黑屏
For more details you can refer this Just black screen after running Qemu
这篇关于与新的驱动程序模块交叉编译Linux Arm Kernel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!