2440 上内核3.4.2移植

来源:互联网 发布:access数据库实例下载 编辑:程序博客网 时间:2024/06/18 13:03
win7下不能使用dnw烧写的替代方法
两种替代方法:
1.用网络下载
u-boot:
tftp 30000000 u-boot.bin;
protect off all; 
erase 0 3ffff;
cp.b 30000000 0 40000
kernel:
tftp 30000000 uImage
nand erase kernel
nand write.jffs2 30000000 kernel


fs:
tftp 30000000 fs_qtopia.yaffs2
nand erase root
mtdpart 查看分区地址
nand write.yaffs 30000000 260000         2f76b40
                          root分区的地址  大小


1.2 NFS
kernel:
nfs 30000000 10.108.141.214:/work/nfs_root/uImage
nand erase kernel
nand write.jffs2 30000000 kernel


fs:
nfs 30000000 10.108.141.214:/work/nfs_root/fs_qtopia.yaffs2
nand erase root
nand write.yaffs 30000000 260000 2f76b40


2.用linux下的dnw
2.1 把linux下的dnw应用程序放到/bin目录
sudo chmod +x /bin/dnw
sudo chmod +x /bin/dnw
2.2如果试用VMWAER,让VMWARE位于前台,然后再用USB线连接PC和开发板USB DEVICE接口
linux上用lsusb命令确认VMWARE LINUX 已经识别出 UBOOT的USB设备


2.3 在UBOOT界面输入k 
  然后在Linux下执行 dnw uImage
2.4 在UBOOT界面输入y
  然后在Linux下执行 dnw fs_qtopia.yaffs2


uboot、内核打补丁
u-boot
tar xjf u-boot-1.1.6.tar.bz2
cd u-boot-1.1.6/
patch -p1 < ../u-boot-1.1.6_jz2440.patch
内核同理


编译内核
cp config_ok .config 编译内核时先读取本服务器的内核配置,防止编译内核的时候本地内核配载冲突
make uImage


出现
   error1:
scripts/kconfig/conf --silentoldconfig Kconfig
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
  CC      kernel/bounds.s
cc1: error: invalid option `abi=aapcs-linux'
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2
原因为make menuconfig内核配置EABI和OABI冲突

   error2:

make uImage
arch/arm/mm/tlb-v4wbi.S: Assembler messages:
arch/arm/mm/tlb-v4wbi.S:64: Error: too many positional arguments
但出现了错误,编译没有通过。上网没有查到解决问题。
那试试换一下交叉编译连,是不是交叉编译连太老了?
[root@localhost linux-3.4.2]# arm-linux-gcc -v
Reading specs from /home/hyx/gcc-3.4.5-glibc-2.3.6/bin/../lib/gcc/arm-linux/3.4.5/specs
Configured with: /work/tools/create_crosstools/crosstool-0.43/build/arm-linux/gcc-3.4.5-glibc-2.3.6/gcc-3.4.5/configure --target=arm-linux --host=i686-host_pc-linux-gnu --prefix=/work/tools/gcc-3.4.5-glibc-2.3.6 --with-float=soft --with-headers=/work/tools/gcc-3.4.5-glibc-2.3.6/arm-linux/include --with-local-prefix=/work/tools/gcc-3.4.5-glibc-2.3.6/arm-linux --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c,c++ --enable-shared --enable-c99 --enable-long-long
Thread model: posix
gcc version 3.4.5
这个是原来的交叉编译版本。
在韦东山的资料D:\韦东山Linux视频驱动第2期\韦东Linux视频第1第2期所有源码文档图片芯片手册(1)\韦东Linux视频第1第2期所有源码文档图片芯片手册\毕业班_文档_图片_源码_bin\中找到了arm-linux-gcc-4.3.2.tar.bz2交叉编译工具
并复制到E:\ARM6410实验资料hyx\6410实验源码包hyx后上传到虚拟机。


解压、编译、安装交叉编译连arm-linux-gcc-4.3.2.tar.bz2
tar -vxf arm-linux-gcc-4.3.2.tar.bz2 但这个是解压到了/home/hyx/usr/local/arm/4.3.2下
现在将其解压到根目录下
tar -xjf arm-linux-gcc-4.3.2.tar.bz2 -C /
ps:查看现在命令的环境变量路径
[root@localhost hyx]# echo $PATH 
/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/home/hyx/gcc-3.4.5-glibc-2.3.6/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
修改环境变量:
方法1:(强烈推荐)


[root@localhost bin]# export PATH=/usr/local/arm/4.3.2/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[root@localhost bin]# arm-linux-gcc -v
方法2:


vi /etc/profile
# Path manipulation
if [ "$EUID" = "0" ]; then
          pathmunge /sbin
           pathmunge /usr/sbin
           pathmunge /usr/local/sbin
           pathmunge /home/hyx/usr/local/arm/4.3.2/bin/
        fi
        wq  退出
        source /etc/profile
        arm-linux-gcc -v
显示:
Thread model: posix
gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) 
编译成功后,在内核的arch/arm/boot目录下即生成uImage文件


修复error后,重新
make distclean
cp config_ok .config
make menuconfig //去掉EABI
make uImage 


编译成功后,在内核的/work/system/linux-3.4.2/arch/arm/boot目录下生成uImage文件
烧写内核参考上面

详情见百问网精智JZ2440开发板4.3寸LCD版使用手册
0 0