comparison README @ 663:e1f187868dc4

Add a README file.
author Rob Landley <rob@landley.net>
date Sat, 28 Mar 2009 03:32:39 -0500
parents
children 9e2a020195d3
comparison
equal deleted inserted replaced
662:1fa9eb882e3b 663:e1f187868dc4
1 This is a brief intro, see http://impactlinux.com/fwl/documentation.html for
2 full documentation.
3
4 --- What is it?
5
6 Firmware Linux (FWL) is a build system that creates cross compilers and
7 bootable system images for various targets, such as arm, mips, powerpc, and
8 x86.
9
10 --- How do I use it?
11
12 List available targets:
13
14 ./build.sh
15
16 Build the mipsel (mips little endian) target:
17
18 ./build.sh mipsel
19
20 Boot the result under qemu, right out of the build directory:
21
22 ./run-from-build.sh mipsel
23
24 After the kernel boot messages scroll by, you should have a shell prompt
25 inside qemu. Try "cat /proc/cpuinfo" to confirm it's not the same as your
26 host. Type "exit" to shut it down.
27
28 Finally, look at the output in the "build" directory.
29
30 ls -l build/*.tar.bz2
31
32 For each target you built, the build tars up the cross compiler, the
33 root filesystem, and a bootable system image. Each system image contains an
34 ext2 formatted virtual hard drive image, a kernel configured for qemu, and a
35 run-emulator.sh shell script to invoke qemu in various ways.
36
37 If you'd like to use the cross compiler to build something else, just add
38 its "bin" subdirectory to the $PATH, and use the build tools prefixed with
39 the target name:
40
41 PATH=$(pwd)/build/cross-compiler-mipsel/bin:$PATH
42 mipsel-gcc -static hello.c -o hello
43 qemu-mipsel hello
44
45 Note that the run-emulator.sh script has several command line options:
46
47 cd build/system-image-mipsel
48 ./run-emulator.sh --help
49
50 If you'd like to build every target in parallel (needs about 2 gigs of ram):
51
52 ./buildall.sh --fork
53
54 The file "configure" contains several environment variables you can set to
55 control the behavior of FWL. (If this file doesn't set them, you can set
56 them in your environment before running a build.)
57
58 --- What's it for?
59
60 Although Firmware Linux creates reusable cross compilers, the purpose of FWL
61 is actually to eliminate the need for cross compiling.
62
63 The FWL build does all the cross compiling necessary to create a minimal
64 native development environment (mini-native) for a target, then packages
65 it into a system image. Once that target system is up and running (usually
66 under qemu), you can build your software natively in there, and no longer
67 need to cross compile anything from the host.
68
69 FWL is also designed to be readable. The build is a series of bash scripts,
70 with comments where necessary. They document how to make a cross compiler,
71 how to create a simple development environment, and how to package and boot
72 the result under an emulator. If you don't know how something works, read
73 the script. If something's unclear, ask us.
74
75 --- How does it work?
76
77 The build.sh script is a wrapper around other scripts. The main three are:
78
79 cross-compiler.sh - creates a cross compiler for the target.
80
81 mini-native.sh - use the cross compiler to build a root filesystem.
82
83 system-image.sh - build a kernel and ext2 image to run under emulator.
84
85 # Or when building a cross-compile aware package, do something like:
86 # export PATH=`pwd`/build/cross-compiler-i686/bin:$PATH
87 # make CROSS_COMPILE=i686-
88
89 This file is a brief introduction, for full documentation see
90
91 http://impactlinux.com/fwl/documentation.html