Beruflich Dokumente
Kultur Dokumente
For many contemporary microprocessor applications software development represents the bulk of the engineering effort
Development approach
Hardware manufacturers provide reference designs For Broadcom 802.11 devices this includes fully functional software based on Linux or VxWorks Equipment manufacturers take the reference design software and brand, modify or improve it for their own product Developing from scratch is generally not feasible
This session
Will approach the application software via an extended demonstration You will see all the stages involved in installing the development environment, building the software from source and downloading an image to the WRT54GL At key points we will break-off to discuss details of what is involved The laboratory sessions will give an opportunity to try this out for yourself
M07CDE Microprocessor Applications 4
Cross-platform development
IMAGE
Development Machine
Linux distribution suitable for software development Native installation on hard disk (best) Other options
Run under windows in virtual machine Run from live CD distribution Run Linux from memory stick These approaches will drop performance
M07CDE Microprocessor Applications 6
WARNING!
Editing disk partitions and installing dualboot operating systems always carries an element of risk This is especially true for inexperienced developers If you are not confident in your abilities practice on a non-critical machine first Always back-up critical data in advance
M07CDE Microprocessor Applications 8
Installation documentation
A useful tutorial on the installation of BT2 is provided in your resource pack Ref: BackTrack Development Team (2005) BackTrack Hard Drive Installation [on-line] available from remote-exploit.org There is one correction to this document, BackTrack installer source should be / not /boot Hard drive partitions used will also vary with development machine configuration
M07CDE Microprocessor Applications 9
10
Linux familiarisation
Once you have the Linux development machine operational it is necessary to become familiar with essential operations Using the file manager (Konqueror) Running commands in a console window (Terminal) Editing files with a suitable editor (eg KWrite)
M07CDE Microprocessor Applications 11
GPL Source
This can be downloaded from www.linksys.com The version used here is WRT54GL_US_v4.30.12.tgz Also provided on resources CD Copy this file to your home directory and unpack using tar tar xvvfz <filename> A file manager may do this for you in a window
12
13
15
16
Toolchains
For cross-platform development the native x86 compiler cannot be used An x86 to MIPS32 cross compiler is needed Two of these are supplied with the distribution, one for the Linux kernel and the other for the wireless router application packages The toolchains need correct installation before the router firmware can be built
17
Toolchain installation
Copy /tools/brcm to /opt/brcm This is necessary since parts of the build are looking for tools in this location Ensure both toolchains and the auxiliary binary tools are in the path before starting a build This was done by editing the make_all.sh script in the source installation tree
M07CDE Microprocessor Applications 18
19
Editing make_all.sh
20
Trying a build
At this stage you should be ready to build Simply go to the top level installation directory of the build tree and run the make script ./make.sh Watch the console output as many source packages are compiled and the firmware image is built
M07CDE Microprocessor Applications 22
23
GCC
gcc, the gnu c compiler is employed for cross compilation It must be pre-configured to generate MIPS32 output and requires suitable libraries for standard functions For any serious software modifications a good competence working in the C language in a Linux environment is essential
M07CDE Microprocessor Applications 24
Make
The Linux make utility is used to control conditional compilation of the source packages In general every source package has its own make file which is called by higher level make files until the entire application can be built with one call The details of make are complex and require significant study and experience to master all the intricate details
M07CDE Microprocessor Applications 25
Configuring
Kernel developers employ the Linux configuration system to specify exactly what kernel modules and features are included in a particular build Here the approach is extend to the packages employed within the wireless router application The configurator can be run by executing make menuconfig in the /release/src/router directory
27
.config files
The results from the menu configure utility are stored in .config files which are then included into the make files during the build You may need to set your file manager to Show hidden files before you can see the .configs In some systems a number of .configs will be stored for different target systems and swapped to control the build
28
29
30
33
34
Exercise
Gain familiarity with the build environment by browsing around the directory tree Make a few changes in configuration and source files (cosmetic changes suggested) Re-build the system and confirm that you produce a final firmware image Please do not install trial images on a real router as it is quite a big job to recover them from a bad image
M07CDE Microprocessor Applications 35
Further issues
Working at the command line is a little archaic an IDE front end can be used to the software development and build process Eclipse is one of the best known examples of this under Linux Version control features will often also be involved Others ?
M07CDE Microprocessor Applications 36