移植新内核

本文详细介绍了移植新内核的步骤,包括配置、编译以及遇到的问题和解决办法,如缺少库文件、mkimage 命令缺失、启动时的波特率和晶振频率设置,以及内核大小超过分配空间导致的数据CRC错误等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

步骤一:配置新内核

1.make s3c2410_defconfig ARCH=arm CROSS_COMPILE=arm-linux-

或修改Makefile 在顶级makefile 查找ARCH,CROSS_CIMPILE 并修改

ARCH=arm

CROSS_COMPILE=arm-linux-

步骤2:编译新内核

make uImage  ARCH=arm CROSS_COMPILE=arm-linux- 或者 make uImage

 

问题1:

/opt/arm9/FriendlyARM/toolschain/4.4.3/bin/../libexec/gcc/arm-none-linux-gnueabi/4.4.3/cc1: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

解决办法:

sudo apt-get install libstdc++6   lib32stdc++6

问题2:

opt/arm9/FriendlyARM/toolschain/4.4.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.3/../../../../arm-none-linux-gnueabi/bin/as: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory

解决办法:

sudo apt-get install lib32z1

问题3:

"mkimage" command not found - U-Boot images will not be built
make[1]: *** [arch/arm/boot/uImage] 错误 1
make: *** [uImage] 错误 2

解决办法:缺少命令mkimage

编译uboot 后产生mkimage并将其复制到

sudo cp uboot/tools/mkimage /usr/local/bin/ -rf即可

最后产生内核文件uImage

  Kernel: arch/arm/boot/Image is ready
  Kernel: arch/arm/boot/zImage is ready
  UIMAGE  arch/arm/boot/uImage
Image Name:   Linux-3.4.2
Created:      Fri Jan 18 23:33:30 2019
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    2389056 Bytes = 2333.06 kB = 2.28 MB
Load Address: 0x30108000
Entry Point:  0x30108000
  Image arch/arm/boot/uImage is ready

问题3:将新编译的内核少些到开发板之后启动开发板显示乱码

原因1:波特率设置有问题;原因2: 晶振频率设置有问题

原因3:

解决办法:波特率设置吗晶振频率设置

bootargs=root=/dev/nfs rw console=ttySAC,115200 init=/linuxrc nfsroot=192.168.100.2:/home/wzb/nfsdir/rootfs ip=192.168.100.12:192.168.100.2:192.168.100.1:255.255.255.0::eth0:off

问题4:

解决办法:需要修改分区

static struct mtd_partition smdk_default_nand_part[] = {
        [0] = {
                .name   = "bootloader",
                .size   = SZ_256K,
                .offset = 0,
        },
        [1] = {
                .name   = "params",
                .offset = MTDPART_OFS_APPEND,
                .size   = SZ_128K,
        },
        [2] = {
                .name   = "kernel",
                .offset = MTDPART_OFS_APPEND,
                .size   = SZ_2M,
        },
        [3] = {
                .name   = "rootfs",
                .offset = MTDPART_OFS_APPEND,
                .size   = MTDPART_SIZ_FULL,
        }
};

问题5:将编写的内核烧写到nandflash 之后启动

## Booting image at 30007fc0 ...
   Image Name:   Linux-3.4.2
   Created:      2019-01-19   3:43:44 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2388848 Bytes =  2.3 MB
   Load Address: 30108000
   Entry Point:  30108000
   Verifying Checksum ... Bad Data CRC

可能原因:我分配给kernel 的nandflash大小为 2M 但是内核大小超过2M引起的;

解决办法去除一些模块指内核的大小小于2M,问题得以解决!

 

 


 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值