分类: LINUX
2007-10-26 09:31:42
Embedded Linux
Develop Platform Creating Experience
By Stephen_Du
Part 1 Platform
Choosing
1.Fedora
Core5(linux-
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-
b.Binutils
tarball(binutils-2.16.tar.gz)
c.Glibc(glibc-2.16;glibc-linuxthreads-
•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>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