[英]Cross Compiling Linux Arm Kernel with new driver module
I am trying to include a driver for use on my arch linux arm machine. 我试图包括一个在我的arch linux arm机器上使用的驱动程序。 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/
Then when my embedded linux arm tries to load the kernel uImage, it hangs with: EDIT: Changed the entry point address to 80008000, so now it hangs with: 然后,当我的嵌入式Linux手臂尝试加载内核uImage时,它挂起:编辑:将入口点地址更改为80008000,所以现在它挂起:
Filename '/tftpboot/uImage'.
Load address: 0x81800000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
####################################
done
Bytes transferred = 3174848 (3071c0 hex) 传输的字节数= 3174848(十六进制3071c0)
Image Name: 2.6.35-ModifiedEntry 图像名称:2.6.35-ModifiedEntry
Image Type: ARM Linux Kernel Image (uncompressed) 映像类型:ARM Linux内核映像(未压缩)
Data Size: 3174784 Bytes = 3 MiB 数据大小:3174784字节= 3 MiB
Load Address: 80008000 加载地址:80008000
Entry Point: 80008000 入口点:80008000
Verifying Checksum ... OK 正在验证校验和...确定
Loading Kernel Image ... OK 正在加载内核映像...确定
OK 好
Starting kernel ... 启动内核...
Am I cross-compiling my kernel wrong? 我交叉编译内核错了吗? It cannot load the uImage. 它无法加载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). 我要做的就是用新包含的驱动程序(包含在make menuconfig的config中)为linux arm计算机交叉编译我的内核。 Am I missing any additional steps? 我是否还缺少其他步骤?
You have done two mistake in kernel building procedure. 您在内核构建过程中犯了两个错误。
1)before make menuconfig
1)在make menuconfig
之前
you need to have a .config
file should exit in source-code. 您需要有一个.config
文件,该文件应以源代码形式退出。
How u can get it 你如何得到它
1) make ARCH=arm board_defconfig 1)使ARCH = arm board_defconfig
check your default config in /arch/arm/configs 检查/ arch / arm / configs中的默认配置
eg make ARCH=arm versatile_defconfig 例如,使ARCH = arm fully_defconfig
this will write default
configuration to .config
这会将default
配置写入.config
2)if you dont know your default configuration you can get it in target board Filesystem. 2)如果您不知道默认配置,则可以在目标板文件系统中获取它。
it will be in /proc/config.gz copy to your host untar it and copy as .config
in top source-code. 它会在/proc/config.gz中复制到您的主机,解压缩并在顶部源代码中复制为.config
。 or it may present in /boot/config.xxx 或者它可能出现在/boot/config.xxx中
if dont follow above step make ARCH=arm menuconfig this will copy host x86 config file from /boot/config-xxx which will be wrong config file 如果不执行上述步骤,则使ARCH = arm menuconfig将从/ boot / config-xxx复制主机x86配置文件,这将是错误的配置文件
Once above step is done then next step make ARCH=arm menuconfig here enable your driver. 完成上述步骤后,下一步使ARCH = arm menuconfig在此处启用您的驱动程序。
2nd mistake is make ARCH=arm CROSS_COMPILE=/home/z3/bin/arm- modules_install
第二个错误是make ARCH=arm CROSS_COMPILE=/home/z3/bin/arm- modules_install
This will install modules in /lib/modules of x86 host machine. 这将在x86主机的/ lib / modules中安装模块。
so follow below one 所以按照下面的一个
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. 然后,您需要将模块复制到目标。
For more details you can refer this Just black screen after running Qemu 有关更多详细信息,您可以在运行Qemu后引用此Just black屏幕
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.