comparison doc/Compiling @ 0:e7502631a0f9

initial import from freecalypso-sw rev 1033:5ab737ac3ad7
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 11 Jun 2016 00:13:35 +0000
parents
children 6a029ad28212
comparison
equal deleted inserted replaced
-1:000000000000 0:e7502631a0f9
1 There are 3 parts to the complete FreeCalypso software suite which are built
2 independently of each other:
3
4 * The tools that run on a GNU/Linux PC or other host system are the most
5 straightforward: there is a top level Makefile (named Makefile.hosttools if
6 you looking at a development source snapshot, will be renamed to just
7 Makefile in packaged releases of the host tools) that coordinates building
8 and installing all of them.
9
10 * The gsm-fw tree, which will eventually become our main GSM firmware, needs to
11 be built with a GNU cross-compiler toolchain for ARM7. This firmware can be
12 built for several different target devices and with different feature
13 configurations, hence there is no singular build for it - it's more like the
14 Linux kernel in terms of its build configuration management.
15
16 * We also have a few utilities which need to be compiled to run on Calypso
17 targets, but which are not part of gsm-fw; they are gathered in the
18 target-utils tree. They are built with the same GNU toolchain for ARM7 as
19 gsm-fw, but don't have any fancy configuration system.
20
21 Building and installing FreeCalypso host tools
22 ==============================================
23
24 If you are working with a packaged FC host tools release, just run 'make', then
25 'make install' as root. If you are working with a development source snapshot,
26 do 'make -f Makefile.hosttools' instead.
27
28 The "standard" install directories are /usr/local/bin for binaries and
29 /usr/local/share/freecalypso for helper files. If you need to change these
30 paths to something else, you'll need to edit a bunch of individual component
31 Makefiles, and possibly also some source files like loadtools/defpath.c -
32 sorry, FreeCalypso is not GNU and does not use autotools.
33
34 All FreeCalypso host tools are written in plain C, and with the exception of a
35 few utilities in the "special-purpose hacks" category, they have absolutely no
36 library dependencies beyond libc. In other words, they are very friendly to
37 those who like bare bones minimalist systems. The only exceptions are
38 fc-getpirimei and fc-pirhackinit which use libcrypto from OpenSSL for DES
39 functions, and fc-lcdemu which needs libX11 to compile and an X11 display to
40 run. But as you can read in Host-tools-overview, these utilities are not
41 particularly important, so if your system lacks those libraries, just edit the
42 Makefiles to not build these utilities - it is very unlikely that you will miss
43 them.
44
45 To those who are going to build distro packages from these fc-host-tools: it
46 is recommended that you leave fc-getpirimei, fc-pirhackinit and fc-lcdemu out
47 of the basic package - please don't create extra dependencies just to support a
48 few odd hacks which are unlikely to ever be used by anyone other than the
49 developer who needed them at one time and no longer even uses them herself as
50 their original one-time purpose has already been served.
51
52 Building and installing the ARM7 toolchain
53 ==========================================
54
55 The current "official" GNU ARM toolchain for FreeCalypso consists of
56 binutils-2.21.1, gcc-4.5.4 and newlib-2.0.0 with a specific set of patches and
57 build configuration options. Build it as follows:
58
59 1. Download these 3 source tarballs for the standard GNU+newlib components:
60
61 binutils-2.21.1a.tar.bz2
62 gcc-core-4.5.4.tar.bz2
63 newlib-2.0.0.tar.gz
64
65 2. Run the build+install.sh script in the toolchain directory. Read the
66 comments in the script first for the usage instructions.
67
68 The toolchain thus built will need to be in your PATH before you can compile
69 gsm-fw or target-utils.
70
71 Please note: the toolchain that is prescribed for FreeCalypso as above is
72 *believed* to be equivalent to the one used by OsmocomBB, but there are no
73 guarantees. Use any other toolchain at your own risk.
74
75 Compiling target-utils
76 ======================
77
78 Running 'make' in the target-utils tree with the ARM7 toolchain present in your
79 PATH will result in compalstage and loadagent being built; these are the two
80 components needed in order to use FreeCalypso loadtools. Run 'make install' to
81 install these target binaries in /usr/local/share/freecalypso, which is where
82 loadtools will look for them.
83
84 Run 'make all' in target-utils to build some other components that aren't
85 really needed.
86
87 Compiling FreeCalypso GSM firmware
88 ==================================
89
90 The firmware in our gsm-fw tree can be built in many different configurations,
91 hence there is no singular build for it. The configuration choices consist of:
92
93 * Which target device the firmware should be built for: the target device
94 selection is made at compile time; do not attempt to take a firmware image
95 built for one target device and flash or fc-xram it into another!
96
97 * What functionality is to be included. As the FreeCalypso firmware subproject
98 moves forward, we gradually add chunks of functionality, slowly approaching
99 what each target device is ultimately capable of. However, each time we add
100 a new piece of functionality, the ability to build a firmware image that works
101 like before, without the newly added functionality, still remains. Each
102 feature to be included needs to be explicitly selected.
103
104 * Miscellaneous configuration: which Calypso UART should be used for what,
105 should the firmware use a real FFS (flash file system) in flash or a fake one
106 in RAM, etc.
107
108 The GSM firmware build configuration is set by way of an editable text file
109 named build.conf; the configuration and build procedure is as follows:
110
111 1. Look at the available repertoire of standard configurations under
112 gsm-fw/configs and choose which one you would like to use, either as-is or
113 as a basis for your own;
114
115 2. Copy the configuration you selected to build.conf in the gsm-fw directory;
116
117 3. Optionally edit it to taste - the configuration language is Bourne shell;
118
119 4. Run 'make' in the gsm-fw directory.
120
121 Depending on the configuration, either a flashable or a RAM-loadable image will
122 be built by default. A flashable image will appear in finlink/flashImage.bin;
123 these images are meant to be programmed with fc-loadtool's flash program-bin
124 command; the starting flash address at which the image needs to be programmed
125 depends on the target device - see target-specific notes. A RAM-loadable image
126 will appear in finlink/ramImage.srec; these images are meant to be loaded and
127 run with the fc-xram utility.
128
129 It is possible to build either a flashable or a RAM-loadable image, or both,
130 without changing build.conf: run 'make flashImage' or 'make ramImage' as
131 desired. (The compilation of each module from source into a .o and all
132 intermediate linking steps are agnostic to whether a flashImage or a ramImage
133 is being built, only the very final link step differs.) Any otherwise working
134 configuration can be built into a flashImage, even if it makes no logical sense
135 to do so, but the ability to build a ramImage for a given configuration depends
136 on the code image size (which in turn depends on the selected feature set) and
137 the amount of RAM available on the target in question: most Calypso GSM devices
138 have small RAM, enough to satisfy a GSM firmware's data space requirements, but
139 not enough to hold the entire firmware code in RAM as well. Please see target-
140 specific notes for more details.