S5PV210 Linux3.8.3内核移植

交叉编译工具链:arm-linux-gcc4.4.1    

1. 下载linux内核

 在ubuntu系统终端输入: wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.8.3.tar.xz

 (内核下载官网:www.kernel.org)

2.解压内核

   tar xvf  linux-3.8.3.tar.xz

3.将uboot2012.10  tools目录下的mkimage文件复制到/usr/bin目录下

 cp u-boot-2012.10/tools/mkimage /usr/bin

4.进入linux内核顶层目录,进行配置清除

 cd linux-3.8.3

 make distclean

 

5.修改顶层Makefile,指定处理器类型和交叉编译工具链

   修改 ARCH            ?= $(SUBARCH)  为 ARCH            ?= arm

   修改  CROSS_COMPILE   ?= $(CONFIG_CROSS_COMPILE:"%"=%)  为  CROSS_COMPILE   ?= arm-linux-

 

6.初步配置内核

  make s5pv210_defconfig

   注意:s5pv210_defconfig 可以通过查看  /arch/arm/configs  下的配置文件得到

7.修改内核配置

  make menuconfig

出错:

缺少库,接下来安装ncurses库

     apt-get install libncurses*

再重新  make menuconfig

8.按默认配置初步编译内核

   make uImage

9.修改加载地址和入口地址

vim scripts/Makefile.lib

将 UIMAGE_ENTRYADDR ?= $(UIMAGE_LOADADDR)  修改为 UIMAGE_ENTRYADDR ?= $(shell echo $(UIMAGE_LOADADDR)|sed -e "s/..$$/40/")

10.烧写内核到sd卡

dd iflag=sync oflag=sync if=uImage of=/dev/sdb seek=1000

运行下程序,卡死在  starting kernel 。。。

首先 怀疑打印信息的串口  是否是正确的    我使用的是串口0作为调试接口

make menuconfig    查看  果然 linux内核用的是串口1  修改配置如下

System Type  ---> (0) S3C UART to use for low-level messages

S5PV210 Machines  --->[*] SMDKV210

再次烧写,串口就有信息了。

猜你喜欢

转载自www.linuxidc.com/Linux/2016-11/137078.htm