基于飞凌i.MX6Q-C 的Linux-4.1.15 & xenomai-3.1 内核移植
硬件平台:飞凌i.MX6Q-C开发板
软件开发平台 ubuntu18 虚拟机系统
资源:linux-4.1.15(飞凌官方源码) + xenomai-3.1(xenomai官网)
工具链版本(ubuntu系统apt install直接安装)信息:
arm-linux-gnueabihf-gcc -v
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabihf-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/arm-linux-gnueabihf/7/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-multiarch --enable-multilib --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --disable-werror --enable-multilib --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=arm-linux-gnueabihf --program-prefix=arm-linux-gnueabihf- --includedir=/usr/arm-linux-gnueabihf/include
Thread model: posix
gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)
1.修改飞凌官方代码的工具链
(缺失部分库,无法将xenomai相关代码生成为可执行程序
checking for arm-poky-linux-gnueabi-strip... arm-poky-linux-gnueabi-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for arm-poky-linux-gnueabi-gcc... arm-poky-linux-gnueabi-gcc
checking whether the C compiler works... no
configure: error: in `/home/roger/share/ethercat-1.5.2':
configure: error: C compiler cannot create executables
See `config.log' for more details
)
//build.sh
1 #!/bin/bash
2 . /opt/fsl-imx-x11/4.1.15-2.1.0/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
3 make distclean
4 make imx_v7_defconfig
5 make zImage -j16
6 make dtbs
7 make modules -j16
》》》》》》》》》》》》》》》》》
/////////////////////////////////////////////////////
1 #!/bin/bash
2 make distclean
3 make imx_v7_defconfig
4 make zImage -j16
5 make dtbs
6 make modules -j16
//Makefile
252 ARCH = arm
253 CROSS_COMPILE = arm-poky-linux-gnueabi-
254
255 # Architecture as present in compile.h
256 UTS_MACHINE := $(ARCH)
257 SRCARCH := $(ARCH)
/////////////////////////////////////////////////////
252 ARCH = arm
253 CROSS_COMPILE = arm-linux-gnueabihf-
254
255 # Architecture as present in compile.h
256 UTS_MACHINE := $(ARCH)
257 SRCARCH := $(ARCH)
2.linux内核补丁 ipipe-core-xxx-arm-zz.patch
官网 https://xenomai.org/downloads/ipipe/
在官网上并没有linux-4.1.15对应的补丁,找一个比较靠近的版本,我们这里选择ipipe-core-4.1.18-arm-10.patch
直接将飞凌的linux源码进行ipipe-core-4.1.18-arm-10.patch补丁,最后会有报错,并生成有对应代码的xxx.rej,依据提示将补丁没有打完整的部分,手动去修改飞凌linux源码。
3.xenomai源码配置导入到linux源码,将在linux源码中生成xenomai的新增部分。
configure the linux kernel部分参考https://www.cnblogs.com/mickeyyang/articles/13262471.html
4.最后进行linu内核编译。
浙公网安备 33010602011771号