Chinaunix首页 | 论坛 | 博客
  • 博客访问: 848295
  • 博文数量: 168
  • 博客积分: 5431
  • 博客等级: 大校
  • 技术积分: 1560
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-22 11:56
文章存档

2015年(2)

2014年(1)

2013年(12)

2012年(12)

2011年(15)

2010年(5)

2009年(16)

2008年(41)

2007年(64)

分类: LINUX

2007-10-26 09:31:42

Embedded Linux Develop  Platform Creating Experience



By Stephen_Du

07-4-19




Part 1 Platform Choosing



1.Fedora Core5(linux-2.16.15 kernel)



Part 2 Cross Compile Toolchain For Arm9tdmi



•1>Two choice:

 a.Download one compiled by other guys

 b.Compile our own

&Problem to a:

 Hard to find a toolchain fitting for the specific kernel,and sometimes really strange problem comes out;Such as “cpp0 can’t found”, “your toolchain is such bad one!” or other long long errors! So the best is:make our own toolchain, but so hard! 

•2>How to compile:

     Resource needed:

a.Kernel source tarball(Here I choose linux-2.6.14.7.tar.gz)

b.Binutils tarball(binutils-2.16.tar.gz)

c.Glibc(glibc-2.16;glibc-linuxthreads-2.3.5.tar.gz)

•Steps for compiling

    a.Prepairing the head files

Part 3 Creat Related Files



•1.Linux driver development needs lots of headerfiles and module lib,but not contained in the system so, it required us to build for ourself;Steps are as followed:

–1]Download the kernel tarball needed;

–2]Build the kernel with all functions needed

–1>cp /boot/config-2.6.15-1.FC.********(use the config the system used) $(KERNELPATH) /.config

–2>Make menuconfig -> load the .config

–3>make all ->make moduels_install ->make install



Part 4 Update System Related



•1>Update system glibc

 a.After got the tarball make another directory for building glibc(Reason:if any error ,the orignal source will not be infuenced and  just remove the “new directory” )

b.Go into the new directory we made in step a,and configure for it;as:

../glibc-2.3.5/configure ARGS

ARGS are as follows:

•--prefix= PATH

 Path is where you want to install glibc,default is /usr/local/

 --enable-add-ons=…

 With this option on but not “=” all the character will be added(normally used but take longer to compile)

 The detail can be seen with ./configure –help

Attention:we must make a new direcrory in the new tarball and at least –prefix is given or else no makefile appear under the present path,so that can’t execute make  and make install!

• c.Execute make

• d.make check(not forced unles error occurs)

• e.make install

•Attentions:

•1)It’s really good habit for back up the important files before update any thing in system!

   The /usr/include and /lib are most important ones;and /usr/lib are for  user applications so will not be influenced!

•  2)Read the “INSTALL””README” and the alike files carefully will save so much time and keep away from a lot of unimaginable problems!

• 3)The gcc tools need to be new enough for compiling files



Part 5 Kernel Compile



•1>Adding the nand table info into kernel source

•2>Configure the kernel

•3>Modify the makefile under kernel tree root

•4>make

•Attentions:

•1)serial port must be supported in kernel or else nothing seen after bootloader




•1)If needs devfs supported the init parameter needed to changed as

•noinitrd root=/dev/mtblock/2 init=linuxrc console=ttySAC0,115200

   while not

   noinitrd root=/dev/mtblock2 init=linuxrc console=ttySAC0,115200

 

阅读(1284) | 评论(0) | 转发(0) |
0

上一篇:Linux下driver开发

下一篇:个人介绍

给主人留下些什么吧!~~