嵌入式Linux内核制作 —— OK6410

系统组成

10747454

嵌入式linux系统由linux内核根文件系统两部分构成,两者缺一不可。

内核制作

制作嵌入式平台使用的linux内核,方法和制作pc平台的linux内核基本一致,下面使用对比的方式介绍如何制作用于OK6410开发板的内核。

1. 清除原有配置与中间文件

x86: make distclean

arm: make distclean

13286324

2. 配置内核

x86: make menuconfig 后面默认加了ARCH=i386

arm: make menuconfig ARCH=arm

解压linux-2.6.36.tar.gz :

tar zxvf linux-2.6.36.tar.gz

cd linux-2.6.36

make s3c6400_defconfig ARCH=arm

(在linux-2.6.36/arch/arm/configs/下面有很多开发板的默认配置文件,利用这个命令就可以在一些开发板的出厂配置文件基础上进行配置)

make menuconfig ARCH=arm

30285222

System Type -->

30481284

5267342

5299197

5331178

5351583

ARM system type --->

30449881

3. 编译内核

x86: make bzImage

arm: make uImage ARCH=arm CROSS_COMPILE=arm-linux-

33594144

===========================================================================================

arch/arm/mach-s3c64xx/built-in.o: In function `smdk6410_machine_init':

/forlinux/work/kernel/linux-2.6.36/arch/arm/mach-s3c64xx/mach-smdk6410.c:916: undefined reference to `s3c_ts_set_platdata'

arch/arm/mach-s3c64xx/built-in.o:(.init.data+0x288): undefined reference to `s3c_device_ts'

arch/arm/mach-s3c64xx/built-in.o:(.init.data+0x298): undefined reference to `s3c_device_tvenc'

arch/arm/mach-s3c64xx/built-in.o:(.init.data+0x29c): undefined reference to `s3c_device_tvscaler'

arch/arm/mach-s3c64xx/built-in.o:(.init.data+0x2a0): undefined reference to `s3c_device_vpp'

arch/arm/mach-s3c64xx/built-in.o:(.init.data+0x2a4): undefined reference to `s3c_device_mfc'

arch/arm/mach-s3c64xx/built-in.o:(.init.data+0x2a8): undefined reference to `s3c_device_rotator'

arch/arm/mach-s3c64xx/built-in.o:(.init.data+0x2ac): undefined reference to `s3c_device_jpeg'

arch/arm/mach-s3c64xx/built-in.o:(.init.data+0x2b0): undefined reference to `s3c_device_g2d'

arch/arm/mach-s3c64xx/built-in.o:(.init.data+0x2b4): undefined reference to `s3c_device_g3d'

make: *** [.tmp_vmlinux1] Error 1

[root@localhost linux-2.6.36]# make menuconfig ARCH=arm

scripts/kconfig/mconf arch/arm/Kconfig

*** End of Linux kernel configuration.

*** Execute 'make' to build the kernel or try 'make help'.

[root@localhost linux-2.6.36]#

============================================================================================

[root@localhost linux-2.6.36]# vim /forlinux/work/kernel/linux-2.6.36/arch/arm/mach-s3c64xx/mach-smdk6410.c

打开这个文件,将里面的这些都注释掉

// s3c_ts_set_platdata(&s3c_ts_platform);

// &s3c_device_ts,

&s3c_device_tvenc,

&s3c_device_tvscaler,

&s3c_device_vpp,

&s3c_device_mfc,

&s3c_device_rotator,

&s3c_device_jpeg,

&s3c_device_g2d,

&s3c_device_g3d,

然后编译:

3768110

为什么会出现如下的错误呢:

mkimage" command not found - U-Boot images will not be built
  Image arch/arm/boot/uImage is ready

因为使用make uImage编译生成的内核能由uboot引导,编译时会用到mkimage工具,出现这种错误是因为编译器无法找到mkimage工具,该工具在uboot/tools目录下,以下两种方法可以解决问题:
方法一:在/etc/bashrc的末行加入以下语句:
export PATH:=$PATH:[uboot所在目录]/tools
方法二:将uboot/tools目录下的mkimage文件拷备到交叉编译环境的BIN目录:
cd [uboot所在目录]/tools
cp mkimage /usr/local/arm/3.4.1/bin

在红帽下测试:

7566048

如果在Ubuntu下编译内核uImage出现

"mkimage" command not found - U-Boot images will not be built问题

解决方法:

如果使用的是Ubuntu 9.10及以上版本,可以使用下面的命令安装mkimage:

#apt-get install uboot-mkimage  当然也可以按照上面拷贝工具的方法来解决。

6377976

安装完成后在编译内核make umage ARCH=arm CROSS_COMPILE=arm-linux-,就可以生成uImage文件

6417927

转载于:https://my.oschina.net/u/914989/blog/129929

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值