步骤一:配置新内核
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,问题得以解决!