Friday, December 10, 2010

MADDE (Meego Application Developement and Debug Environment)

INTRO:
       
MADDE(Meego Application Development & Debug Environment) is SDK for cross compile and debug  
new application for Maemo and MeeGo.It is not meant to use to build debian packages that use Autotools 
 or anything that  aids compilation by figuring out native system information. 
  • Command-line cross-compiling
  • Multi-platform support (Linux (32-bit/64-bit), Windows, Mac OS X)
  • Configurable for different targets & toolchains
  • Client for the device to simplify the development process
  • Simplicity 
MADDE  is actually a tool that assists in the download and installation of the Target.A Target is used to build programs using the MeeGo toolchain and libraries (sysroot). "mad-admin" is the MADDE command-line tool. You can install multiple Targets and switch easily between them in Qt Creator
 Target is downloaded as a large (~250MB) .bz2 file using the commands below.

Lets check out the various commands and its functions
        

Commands "mad" and "mad-admin"

Basically MADDE can be used and configured by using these two basic commands with different parameters:
  • mad is used for cross-compiling and getting general information.
  • mad-admin is needed to set up and configure the development environment. 

Check the configuration

Before it is possible to use MADDE for cross-compiling, it has to be configured correctly.  To check, which targets of the MeeGo OS  are available, installable or set as default or installed use the command:
       $ mad-admin list
Example output of the above command:       

Targets:
fremantle-1030            (installable)
maemo412-1                (installable)
meego-core-armv7l-1.1     (default)
meego-core-armv7l-trunk   (installable)
meego-core-ia32-1.1       (installable)
meego-core-ia32-trunk     (installable)
meego-handset-ia32-1.1    (installed)
meego-handset-ia32-trunk  (installable)
meego-netbook-ia32-1.1    (installed)
meego-netbook-ia32-trunk  (installable)

Runtimes:
qemu-n900-pr12                                         (installable)
rx48-diablo                                                  (installable)
meego-handset-ia32-qemu-1.1.20101031.2201-sda-runtime  (installed)
meego-netbook-ia32-qemu-1.1.20101031.2037-sda-runtime  (installable)

     From above displayed list  it implies that ,  meego-core-armv7l-1.1 target is installed and set as default. Diablo and others  can be installed, but is not available yet. If a target is set as default, it means that it will be used automatically for cross-compiling, if nothing else is specified.and we can have various targets installed simultaneously and we can switch between them using the Qtcreator which will be discussed later.
 
What actually are these various targets?
 
we need to have a different set of tool chains and libraries in order to build 
MeeGo applications that run on various targets(handset,Netbook,ConnectedTV,along 
with Arm and ia32 etc)
  • meego-core-armv7l-1.1: Build applications for ARM handheld devices (such as N900)
  • meego-handset-ia32-w32-1.1: Build applications for x86 handheld devices (such as Aava)
  • meego-netbook-ia32-w32-1.1: Build applications for x86 netbooks.
What actually are MeeGo runtimes  & QEMU ?

            A Runtime is the MeeGo OS image that is run with QEMU when debugging applications on your host system. It is not required if you develop against real hardware running MeeGo. It is downloaded as a large (~650MB) .bz2 file using MADDE. The Runtime is not needed until you have finished configuring Qt Creator.

            QEMU is a generic and open source machine emulator and virtualizer.
When used as a machine emulator, QEMU can run OSes and programs made for one machine (e.g. an ARM board) on a different machine (e.g. your own PC). By using dynamic translation, it achieves very good performance.When used as a virtualizer, QEMU achieves near native performances by executing the guest code directly on the host CPU. QEMU supports virtualization when executing under the Xen hypervisor or using the KVM kernel module in Linux. When using KVM, QEMU can virtualize x86, server and embedded PowerPC, and S390 guests.

Install a target/runtime :

If a target is marked as 'installable', it has to be installed, before it can be taken into use. This is done by:
>sudo mad-admin create -f <target/runtime> 
 
 -f instructs the Madde to fetch the tarball(bz2) file and then create the target.
their are chances that this step might fail if we are connected to the internet 
using a proxy .So the solution could be 
 
$ sudo mad-admin fetch [-x proxyhost[:port]] URL|URL_ALIAS

Examples:
$ sudo mad-admin fetch -x http://proxy.host:8080 http://server/path/file.tgz
 Or you can do it like this:

$ zypper addrepo -f http://repo.meego.com/MeeGo/sdk/host/repos/meego/1.1/meego-sdk.repo"
$ export http_proxy="http://username:passwd@<proxy_IP>:<proxy_port>"
$ mad-admin create -f <target> 
 
If the one of the above command goes fine we actually start up the process of downloading 
the tarball file which will take some time and status of the download will be updated in 
the command terminal.
  
Finally Creating the target/runtime :
 
$ sudo mad-admin create <Target/Runtime>
 
example output if runtime is meego-handset-ia32-qemu-1.1.20101031.2201-sda-runtime
$ sudo mad-admin create meego-handset-ia32-qemu-1.1.20101031.2201-sda-runtime
:Extracting QEMU runtime meego-handset-ia32-qemu-1.1.20101031.2201-sda-runtime
.....9....8....7....6....5....4....3....2....1....0
Creating missing links... done.
 
 
Important Note :
Check if the target is installed or not by using  >mad list  at higher level and at lower level check by 
running the following commands . Replace <target> with the ones which are dispalyed as installed in >mad-admin list 
output .
 
 $ mad -t <target> pscreate -t qt-simple qthello $ cd qthello
 $ mad -t <target> qmake
 $ mad -t <target> make

To check that the qt-simple application is created for the correct target, run:
$ file build/qthello

output should be based on the target used which is listed below
1)If you compiled with an IA32 toolchain, you should see something like  this:
 build/qttest: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), for GNU/Linux 2.6.25,  
dynamically linked (uses shared libs), for GNU/Linux 2.6.25, not stripped.                 

2)While compiling with an ARM toolchain should yield something like:
 build/qttest: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.25, dynamically linked (uses shared libs), for GNU/Linux 2.6.25, not stripped.


Madde FAQ s: http://meego.gitorious.org/meego-developer-tools/madde/blobs/master/docs/FAQ.rst 

Note: All information posted here is a collection of information from wiki.meego.com and wiki.maemo.org
 

No comments:

Post a Comment