一、【s3c2440移植linux-3.5】移植准备

(一)编译内核

1、修改Makefile
book@ubuntu:~$ cd linux-3.5/
diff -urN linux-3.5/Makefile linux-3.5_s3c2440/Makefile
--- linux-3.5/Makefile  2012-07-22 04:58:29.000000000 +0800
+++ linux-3.5_s3c2440/Makefile  2018-06-18 15:26:04.857250091 +0800
@@ -192,8 +192,8 @@
 # Default value for CROSS_COMPILE is not to prefix executables
 # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
 export KBUILD_BUILDHOST := $(SUBARCH)
-ARCH       ?= $(SUBARCH)
-CROSS_COMPILE  ?= $(CONFIG_CROSS_COMPILE:"%"=%)
+ARCH       ?= arm
+CROSS_COMPILE  ?= arm-linux-

 # Architecture as present in compile.h
 UTS_MACHINE    := $(ARCH)
2、查看默认配置文件
book@ubuntu:~/linux-3.5$ ls -l arch/arm/configs | grep "s3c*"
-rw-rw-r-- 1 david david  1829 722  2012 cns3420vb_defconfig
-rw-rw-r-- 1 david david 11286 722  2012 s3c2410_defconfig
-rw-rw-r-- 1 david david  2134 722  2012 s3c6400_defconfig
book@ubuntu:~/linux-3.5$ cp arch/arm/configs/s3c2410_defconfig arch/arm/configs/s3c2440_defconfig
3、尝试编译内核
book@ubuntu:~/linux-3.5$ make s3c2440_defconfig
book@ubuntu:~/linux-3.5$ make uImage
...
Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at kernel/timeconst.pl line 373.
/work/s3c2440/source/linux-3.5_s3c2440/kernel/Makefile:133: recipe for target 'kernel/timeconst.h' failed
make[1]: *** [kernel/timeconst.h] Error 255
Makefile:775: recipe for target 'kernel' failed
make: *** [kernel] Error 2
4、修改kernel/timeconst.pl
diff -urN linux-3.5/kernel/timeconst.pl linux-3.5_s3c2440/kernel/timeconst.pl
--- linux-3.5/kernel/timeconst.pl   2012-07-22 04:58:29.000000000 +0800
+++ linux-3.5_s3c2440/kernel/timeconst.pl   2018-06-18 15:43:05.479306091 +0800
@@ -370,7 +370,7 @@
    }

    @val = @{$canned_values{$hz}};
-   if (!defined(@val)) {
+   if (!@val) {
        @val = compute_values($hz);
    }
    output($hz, @val);
5、再次编译内核
book@ubuntu:~/linux-3.5$ make uImage
...
"mkimage" command not found - U-Boot images will not be built
/work/s3c2440/source/linux-3.5_s3c2440/arch/arm/boot/Makefile:89: recipe for target 'arch/arm/boot/uImage' failed
make[1]: *** [arch/arm/boot/uImage] Error 1
/work/s3c2440/source/linux-3.5_s3c2440/arch/arm/Makefile:277: recipe for target 'uImage' failed
make: *** [uImage] Error 2
book@ubuntu:~/linux-3.5$ sudo apt-get install u-boot-tools
book@ubuntu:~/linux-3.5$ sudo apt-get install uboot-mkimage
book@ubuntu:~/linux-3.5$ make uImage
6、尝试用新内核启动
book@ubuntu:~/linux-3.5$ sudo gedit /etc/exports
增加一行/work/s3c2440/nfs/ *(rw,sync,no_subtree_check,no_root_squash)
book@ubuntu:~/linux-3.5$ sudo service nfs-kernel-server restart

这里写图片描述
Nand中MTD分区表
这里写图片描述
这里写图片描述
启动内核失败,下一节我们开始修改mtd分区

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值