Currently, still under heavy
development. |
How to build an embedded Linux system anyway?
The 3 steps for building a complete flash root filesystem
Useful Links and Tips - Various Boot Setup (ramdisk, NFA, Flash, etc.)
How long it take to build things
This is a set of shell scripts and patches to help you to build a complete embedded Linux system from scratch, including the host GNU development tools, for several reference boards (x86, PowerPC and Arm9 based):
a GNU cross-compiler (C, C++) and associates utilities and libraries,
a 2.6.x Linux kernel,
several useful libraries (ssl, zlib, expat, xlib, sqlite, etc.) and utilities (busybox, ssh, etc.),
a complete root filesystem
for
the Freescale LITE5200 evaluation board (PowerPC MPC5200);
the Cirrus Logic EP9315A (ARM9-based SOC);
the Advantech PCM-3350 (Geode GX1) [works also for an old Cyrix Media GXm 233 MHz board I have];
the Evalue EEV-EX01 (with an ESM-CN700 module)
the TI DaVinci DVEVM board;
the Technologic Systems TS-7800 board (Marvell ARM9 SOC)
the Freescale MPC8249E-mITX evaluation board..
the Atmel AT91SAM9260-EK evaluation board
from
a Linux-based host cross-development machine.
or (maybe!) a Windows machine (using Cygwin).
It took me sometime to be successful, so I thought this work might be useful to the community. I either own or have used all these references boards, and I have tested at some point all the scripts with the boards I reference.
This project allows you to build the cross-development tools, including the GLIB C/C++ libraries, all additional libraries and utilities, the kernel and finally the root file system from the sources.
Please be aware that building everything from the sources is a relatively long process which can take up to an hour or so.
In order to be able to build an embedded Linux system, obviously you need:
The GNU cross-development tools installed on your host machine (presumably a Linux PC machine).
Your target system will need to have these different pieces of software:
Firmware (or boot loader), such as u-boot, redboot or a BIOS: you can these choose to boot from Flash, network (tftp), or disk;
Kernel (linux): the kernel must be compiled with support for your board (cpu and peripherals);
Root file system (contains the C/C++ libraries, the shell, etc.).
If your board comes with a ‘good’ firmware, you might not need at all a JTAG programmer. Using the firmware, you might be able to program the flash with the kernel and/or the root filesystem. Both u-boot and redboot let you do this, assuming they have the drive for the Flash you are using.
Introduction
There are basically 5 major steps to follow:
Download all requested packages.
Build the C/C++ cross-compilers and the C/C++ librariesThis has to be done only once. This step can take a significant time (for instance about 20 minutes on a 2 GHz machine). Obviously you need to do this only for the processor you are interested in (PowerPC, ARM or x86).
Build the linux kernel. Unless you want to change your kernel configuration (new driver, new filesystem, etc), this can be done also only once.
Build libraries and utilities (busybox, ssl, ssh, etc.). This step takes also a significant time (about 20-25 minutes on a 2 GHz machine).
Create the root file system (ramdisk, flash, NFS, disk).
The good news is that all steps 1, 2, 3, 4 and 5 are combined into a single script: build-rootfs.sh. This shell script contains a section that can be edited (using your favorite text editor) to customize the root file system: do you want X ? Which file system ? Do you want use ssh or telnet ? Do you want to include SQLite ? etc.
LITE5200 (PowerPC 603e)
To build everything (cross-compiler, kernel, all libraries, and finally the root file system), you need to do this:
~$ svn co https://svn.sourceforge.net/svnroot/cross-stuff cross-stuff
~$ cd cross-stuff/common/scripts/
~/cross-stuff/ppcbe/LITE5200/scripts$ ./build-rootfs.sh
build-rootfs.sh: build to root filesystem (ramdisk, nfs mounted, Flash).
PCM3350 (Pentium)
To build everything (cross-compiler, kernel, all libraries, and finally the root file system), you need to do this:
~/cross-stuff/common/scripts$ cd cross-stuff/x86/PCM3350/scripts/
~/cross-stuff/x86/PCM3350/scripts$ ./build-rootfs.sh
EDB9315A (ARM9)
To build everything (cross-compiler, kernel, all libraries, and finally the root file system), you need to do this:
~/cross-stuff/common/scripts$ cd cross-stuff/armle/EDB9315A/scripts/
~/cross-stuff/armle/EDB9315A /scripts$ ./build-rootfs.sh
The first thing we need for sure is a cross-compiler! In the past, after several long evenings of real frustration I was finally able to build a PowerPC cross-compiler for GCC 2.95.3. I never quite succeeded with GCC 3. After a couple of Google search, I finally found the Dan Kegel web site. After a few months, I decided to switch to uclibc, for 2 main reasons:
o better support when it comes to builld cross-compilers
o smaller than glibc (still important in the embedded space).
To build the C/C++ cross-compilers and libraries, I use buildroot.
Using the cross-compiler, it is then pretty straightforward to cross-compile Linux for the board, assuming the board vendor provides a patch to the kernel to support all or most of all peripherals.
All the build scripts are the same for all supported architectures (x86, ppcbe and armlet).
You can take a look at them on-line here.
Name |
Version |
Comment |
Notes/Status |
1.10.3 |
Common UNIX utilities into
a single small executable |
ok |
|
124 |
Allows Linux users to have a
dynamic /dev directory and it provides the ability to have persistent device
names. |
ok |
|
0.9.8g |
SSL v2/v3 and TLS protocols |
Ok |
|
4.7.1p1 |
SSH1 and SSH2
implementation |
ok |
|
1.12 |
|
|
|
5.2 |
|
ok |
|
1.3.1 |
|
ok |
|
1.2.3 |
|
ok |
|
3.5.7 |
Embedded SQL library |
ok |
|
1.7 |
|
|
|
1.00.3 |
|
|
|
uuid |
|
|
ok |
2l11 |
Create and check MS-DOS
filesystems under Linux (includes support for FAT32 and VFAT. |
ok |
|
1.1.12 |
|
ok |
|
2.9.8-16 |
High-performance journaling
filesystem |
nok (uclibc misses aio) |
|
1.40.7 |
Ext2 Filesystem Utilities |
ok |
|
snapshot 20060415 |
|
ok |
|
6.8 |
The GNU Project Debugger |
ok |
|
2007.08.03a |
RTP/RTSP library |
compiled, not tested |
|
0.6.22 |
Service discovery on a
local network |
not fully tested |
|
2.0.1 |
|
ok |
|
4.78 |
|
ok |
|
5.6 |
|
ok |
|
3.2.7 |
|
ok |
|
2.0.3 |
|
|
|
7.18.0 |
command line tool for
transferring files |
not tested |
|
6b |
JPEG image compression library |
not tested |
|
1.2.25 |
PNG image compression
library |
not tested |
|
3.2 |
|
ok |
|
lua |
|
|
|
pdel |
0.5.3 |
|
|
4.4.0 |
kdrive / tinyX |
ok |
|
2.8.6 |
|
ok |
|
2.8.17 |
|
* work in progress * |
|
1.2.1 |
lightweight Window Manager |
fails to load font |
|
snapshot 20060519 |
A/V codecs and file format |
ok |
|
1.0pre7try2 |
Movie player |
* work in progress * |
|
2.3 |
Communication program |
ok |
|
7.0 |
A garbage collector for C
and C++ |
not tested |
|
2.4.4b1 |
High Quality Rendering
Engine for C++ |
not tested |
|
0.6.1 |
Web Server |
not tested |
|
3.4.2 |
Free library for arbitrary
precision arithmetic |
not tested |
|
2.01 |
OCR |
not tested |
|
1.2.13 |
Cross-platform multimedia
library |
not tested |
|
2.5 |
High Quality Rendering
Engine for C++ |
not tested |
My home machine is an AMD Athlon 4200 desktop, with an Intel Core 2 Duo @ 2.0 GHz and 2 GB Ram.
It takes about 15 to 20 minutes to build the C and C++ cross-compilers and the C and C++ libraries, depending of the target architecture (arm, PowerPC or X86).
Shell scripts, Patches |
svn co
https://cross-stuff.svn.sourceforge.net/svnroot/cross-stuff |
Anonymous SVN access |
Browse SVN
repository
|
Project Statistics |
|