Docstoc

g4

Document Sample
g4 Powered By Docstoc
					CROSS DEVELOPMENT
  BUILDING & PORTING OPERATING SYSTEMS
        WHAT IS A TOOL CHAIN?
A set of software utilities used to perform
an operation.



GNU Toolchain - a blanket term for a
collection of programming tools produced
by the GNU Project. Used for OS and
application development.
       FOR EMBEDDED SYSTEMS

Usual development tools available on
a GNU/Linux workstation is a native
toolchain

Embedded systems typically run on
one platform while building
applications for another.

Therefore, cross-compiling toolchains
are generally used. They run on your
workstation but generate code for
your target.
        EMBEDDED SYSTEMS


               Source code

                                           Compilation
                                            machine
                         Cross-compiling
Native toolchain
                            toolchain
                   x86


                                           Execution
  x86 binary                 ARM binary    machine

     x86                        ARM
build          host          target   build         host           target



          Native build                          Cross build
  used to build the normal gcc        used to build a toolchain that runs
        of a workstation              on your workstation but generates
                                            binaries for the target
                                      The most common solution in embedded




build         host           target   build         host           target



      Cross-native build                         Canadian build
  used to build a toolchain that          used to build on architecture
    runs on your target and                 A a toolchain that runs on
   generates binaries for the             architecture B and generates
              target                       binaries for architecture C
      WHAT IS IT COMPOSED OF?


             Binutils        Kernel headers



       C/C++ libraries       GCC compiler


       GDB debugger
         (optional)


Source: free-electrons.com
                       BINUTILS

 Binutils set of tools to generate and manipulate binaries
    for a given CPU architecture. The main ones are:

        ld - the linker.
        as - the assembler.
        Ar, ranlib - A utility for creating, modifying and
         extracting from archives.
        c++filt - Filter to demangle encoded C++ symbols.
        addr2line - Converts addresses into filenames and
         line numbers.
   Others: Gprof, Nlmconv, nm, objcopy, objdump, ranlib,
    Readelf, Size, Strings, strip, windres
                       C LIBRARY

 Interface between the applications
  and the kernel
 Provides the well-known standard C            Kernel
  API to ease application
  development
 Several C libraries are available:          C Library
  glibc, uClibc, eglibc, dietlibc, newlib,
  etc.
                                             Applications
 The choice of the C library must be
  made at the time of the cross-
  compiling toolchain generation, as
  the GCC compiler is compiled
  against a specific C library.
                        KERNEL HEADERS


  The C library and compiled programs               Kernel
     needs to interact with the kernel
    Available system calls and their
     numbers                                    Kernel headers
    Constant definitions
    Data structures, etc.
                                                C Library
    Therefore, compiling the C library
     requires kernel headers, and many
     applications also require them.              Applications

Available in <linux/...> and <asm/...> and a few other directories
corresponding to the ones visible in include/ in the kernel sources
                   GCC COMPILER

 GCC: GNU C Compiler, the famous free software
  compiler
 Can compile C, C++, Ada, Fortran, Java,
  Objective-C, Objective-C++, and generate code
  for a large number of CPU architectures, including
  ARM, AVR, Blackfin, CRIS, FRV, M32, MIPS,
  MN10300, PowerPC, SH, v850, i386, x86_64, IA64,
  Xtensa, etc.
 Available under the GPL license, libraries under
  the LGPL.
                  GDB DEBUGGER


• The debugger on GNU/Linux,
  available for most embedded architectures.
• Console interface or GUI available, also gdbserver
• Can be used to control the execution of a program,
  set breakpoints or change internal variables. Can
  also see memory images, useful if system crashes.
• Use of terminal emulators – Ensure you can access
  the serial port (/dev/ttys0) (chmod to change rights
  of files)– Minicom most commonly used, usually
  installed in distribution, Others include UUCP cu and
  C-Kermit
  Video:
 Compiling
   ARM
                     USING ‘MAKE’

 make – used after every tool if built from scratch
   Brings all of the tools together, and makes use
    of them to build the project
   Processes a makefile that dictates the build
    procedure
   Generated files depend on source files, if a
    source file is updated so is the generated file!
   Likewise, if a source is not updated, and the
    generated file already exists... It isn’t re-built
   Pseudo targets, allow for install and clean etc..
  Tip: Use SVN/Configuration facility
         WHERE DOES IT FIT IN?




     Basic example of a typical self-build GNU toolchain
Source: eejournal.com
   CROSS DEVELOPMENT ENVIRONMENT

• In today’s embedded development or development as
  a whole, is rare that developers develop & write code
  on the devices themselves.

• Because of this, it means there is a need for cross
  development environments which differ dependent on
  the target hardware.

• Mobile Applications – Android, iOS, Windows, all have
  different cross development environments – which
  enable programmers to develop for there chosen
  platform.
                  DEVICE DEVELOPMENT

• When developing system software for embedded devices,
  one of the important facts is figuring out how to the code on
  the board, and proceeding with the code execution.

• The deployment of code on devices can be achieved in
  many ways which depends on the target product device that
  the build was built for and its on board features.

• With most of ‘OUR’ late embedded development
  experiences, it was achieved by populating an micro SD card
  with kernel/boot loader images along with file systems which
  are recognized by the boards CPU’s and booted accordingly.

• Difficulties – Errors downloading from git repositories
  •   Bad or corrupt repos
               DATA TRANSFERS

• Ethernet Cables
 • Year 2, Configuring Puppeteer boards




• COM Ports
 • Virtual USB COM port
 • RS-232



• Micro SD Cards & Reader
 • Loading Kernel Images, boot loaders & File systems
                   BUILDROOT


• Build root is a set of Makefiles and patches which
  make it easy to generate a complete embedded
  Linux system.

• It is very useful for people working with embedded
  systems using various CPU architectures: ARM, x86,
  MIPS, PowerPC and more.

• Automating the build process for your chosen
  embedded system & easing the cross compilation
  generation.
MAJOR BUILD ROOT FEATURES
                THE “MAKE” COMMAND


• The ‘Make’ Utilities purpose is to determine automatically which
  pieces of a large program need to be recompiled & then issue
  certain commands to recompile them.

• Using make requires Makefiles to be written, which describes
  relationships amongst files in your program – stating commands for
  updating each file.

• Once a Makefile exists, each time source files are changed the
  simple shell command make performs all necessary recompilations,
  executing commands in the Makefile to update one or more target
  names.

• Few Make Options: ( -b, -C dir, -d, -e, -f file, -j jobs, -k and many more)

• The GNU implantation of the make command was written by Richard
  Stallman and Roland McGrath.
                      DEBUGGING

• Embedded systems development relies on debuggers
  talking to chips to perform operating like single stepping &
  break pointing. Debugging stages may be performed at
  different levels, depending on facilities that are available
  to the debugger.

• It can be achieved in two ways , internally or externally.

• Internal Debugging by Running pieces of software through
  tools viewing the code running on the processor. Allowing
  the starting or stopping operations , which can be done
  using emulators.
        DEBUGGING EXTERNAL

• Using serial ports (RS232/USB COM PORT) and
  JTAG(Joint Test Action Group) hardware interfaces.

• JTAG adapters uses JTAG as the transport
  mechanism to access on-chip debug modules
  inside the CPU. These modules let developers
  debug the software directly at machine instruction
  level.

• Most Digital electronic products today's such as
  mobile phones or a wireless access point generally
  have no other debug or test interfaces.
    SOFTWARE DEVELOPMENT KIT (SDK)

•    Set of software development tools that allows for the creation of
    applications for a certain software package, software framework,
    hardware platform, computer system, video game console, operating
    system or similar platform

• A software engineer typically receives the SDK from the target system
  developer

• Providers of SDKs for specific systems or subsystems may sometimes
  substitute a more specific term instead of software. For instance, both
  Microsoft and Apple provide driver development kits (DDK) for
  developing device drivers
                       WINDOWS SDK


• Microsoft Windows SDK, Platform SDK and .NET Framework SDK



• Platform SDK specializes in developing applications for Windows
  2000, XP and Windows Server 2003. .NET Framework SDK is
  dedicated to developing applications for .NET Framework 1.1 and .NET
  Framework 2.0. Windows SDK is the successor of the two and
  supports developing applications for Windows XP, Windows Vista,
  Windows 7, Windows Server 2008, .NET Framework 3.0, .NET
  Framework 3.5, and .NET Framework 4.0.
        THE WINDOWS SDK CONTAINS THE FOLLOWING



• For Win32 development:
  o 1,915 Headers
  o 348 Libraries
  o 100 Tools

• For .NET (managed code) development:
  o 14 Reference Assemblies supporting .NET, Tablet PC, Windows
    PowerShell, MMC, etc.
  o 33 Intellisense Files
  o 70 .NET 2.0 Tools + 10 .NET 3.0 Tools + 35 .NET 4.0 Tools

• For Visual Studio 2005/2008/2010 integration
  o Utilities to enable Visual Studio 2005/2008 to easily use Windows
    SDK headers and libraries
  o Visual Studio 2005/2008 Wizards for creating Windows Media
    Player applications
      ANDROID SDK AND ECLIPSE

• Latest version of JDK ( Java Development Kit)

• Eclipse IDE

• SDK Starter Package (it includes only the core SDK Tools)

• ADT Plugin for Eclipse

• Android SDK and AVD Manager (a tool included in the SDK
  starter package) to download essential SDK components into
  your development environment.
                  ANDROID SDK TOOLS

• Android Emulator
  A QEMU-based device-emulation tool that you can use to design,
  debug, and test your applications in an actual Android run-time
  environment.
   Hierarchy Viewer (hierarchyviewer)
  Lets you debug and optimize an Android application's user interface.
  layoutopt
  Lets you quickly analyse your application's layouts in order to optimize
  them for efficiency.
  Mksdcard
  Helps you create a disk image that you can use with the emulator, to
  simulate the presence of an external storage card (such as an SD card).
  Monkey
  Runs on your emulator or device and generates pseudo-random streams
  of user events such as clicks, touches, or gestures, as well as a number of
  system-level events. You can use the Monkey to stress-test applications
  that you are developing, in a random yet repeatable manner.
             ANDROID SDK TOOLS
• Monkey runner
  Provides an API for writing programs that control an Android
  device or emulator from outside of Android code.
  ProGuard
  Shrinks, optimizes, and obfuscates your code by removing unused
  code and renaming classes, fields, and methods with
  semantically obscure names.
  sqlite3
  Lets you access the SQL Lite data files created and used by
  Android applications.
  traceview
  Provides a graphical viewer for execution logs saved by your
  application.
  zipalign
  Optimizes .apk files by ensuring that all uncompressed data starts
  with a particular alignment relative to the start of the file. This
  should always be used to align .apk files after they have been
  signed.
QUESTIONS?

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:0
posted:6/7/2013
language:simple
pages:28
jiang lifang jiang lifang
About