<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ozAndroid</title>
	<atom:link href="http://kernel.ozandroid.info/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://kernel.ozandroid.info</link>
	<description>Low level Android and Kernel Information</description>
	<lastBuildDate>Tue, 12 Feb 2013 01:17:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Inside Nexus S Kernel</title>
		<link>http://kernel.ozandroid.info/?p=280</link>
		<comments>http://kernel.ozandroid.info/?p=280#comments</comments>
		<pubDate>Tue, 12 Feb 2013 01:17:58 +0000</pubDate>
		<dc:creator>nanik</dc:creator>
				<category><![CDATA[Kernel]]></category>
		<category><![CDATA[3.0]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[nexus s]]></category>
		<category><![CDATA[samsung]]></category>
		<category><![CDATA[vanilla]]></category>

		<guid isPermaLink="false">http://kernel.ozandroid.info/?p=280</guid>
		<description><![CDATA[This is to outline the difference between Nexus S 3.0.8 kernel code with mainline kernel version. This is useful to see what exactly is added into the Linux kernel by Android vendors to make it work in the device. The version for Nexus S kernel is obtained from https://github.com/netarchy/nexus-s arch In the arch\arm\common folder there is a [...]]]></description>
				<content:encoded><![CDATA[<p>This is to outline the difference between Nexus S 3.0.8 kernel code with mainline kernel version. This is useful to see what exactly is added into the Linux kernel by Android vendors to make it work in the device.</p>
<p>The version for Nexus S kernel is obtained from https://github.com/netarchy/nexus-s</p>
<ul>
<li><span style="line-height: 13px;"><em>arch</em><br />
</span></li>
</ul>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2013/02/image08.png"><img class="size-full wp-image-293 aligncenter" alt="image08" src="http://kernel.ozandroid.info/wp-content/uploads/2013/02/image08.png" width="251" height="166" /></a></p>
<p style="text-align: left; padding-left: 60px;">In the arch\arm\common folder there is a FIQ handler code. The <strong>fiq_debugger.c </strong>contains the FIQ handler that is registered as a device driver. The driver’s probe code registers the interrupt routine.</p>
<p style="padding-left: 60px;">From what I&#8217;ve read FIQ is a high priority interrupt where it can&#8217;t be interrupted when it is executed. Normal interrupts can still be interrupted but FIQ cannot. This is useful in Linux if for example the kernel hangs because of some interrupt code or some hardware issue. The other thing to remember is that FIQ handler must be implemented in ASM not in C (however, there are few places that I saw the handler is implemented using C, for example, Samsung kernel code is implemented in C). There is a good thread about why writing in ASM is better than C → <a href="http://www.spinicst.net/lists/arm-kernel/msg30890.html">http://www.spinicst.net/lists/arm-kernel/msg30890.html</a></p>
<p style="padding-left: 60px;">This website <a href="http://aelmahmoudy.users.sourceforge.net/electronix/arm/chapter3.htm">http://aelmahmoudy.users.sourceforge.net/electronix/arm/chapter3.htm</a> outlines the different interrupts (one of them FIQ) and explains in details the working</p>
<p style="padding-left: 60px;">ARM vector location for FIQ is at 0xffff001c.</p>
<p style="padding-left: 60px;">In order to create our own FIQ handler we must make sure that when our interrupt routine is called register housekeeping need to be done beforehand and mostly this is done in ASM. The sample for this housekeeping can be seen at fiq_glue.S from the Samsung code</p>
<p style="padding-left: 60px;">Following are some links that provides more information to understand how FIQ works in Linux and how it is used in embedded world.</p>
<p style="padding-left: 60px;"><a href="https://lwn.net/Articles/526754/">https://lwn.net/Articles/526754/</a></p>
<p style="padding-left: 60px;"><a href="http://www.spinics.net/lists/newbies/msg45652.html">http://www.spinics.net/lists/newbies/msg45652.html</a></p>
<p style="padding-left: 60px;"><a href="http://warmcat.com/at91-fiq.patch">http://warmcat.com/at91-fiq.patch</a></p>
<p style="padding-left: 60px;"><a href="http://stackoverflow.com/questions/2962473/problem-calling-linux-c-code-from-fiq-handler">http://stackoverflow.com/questions/2962473/problem-calling-linux-c-code-from-fiq-handler</a></p>
<p style="padding-left: 60px;"><a href="https://geekwentfreak-raviteja.rhcloud.com/2011/01/writing-interrupt-routines-using-gcc-for-arm/">https://geekwentfreak-raviteja.rhcloud.com/2011/01/writing-interrupt-routines-using-gcc-for-arm/</a></p>
<p style="padding-left: 60px;"><a href="http://www.embedded.com/design/mcus-processors-and-socs/4007119/Building-Bare-Metal-ARM-Systems-with-GNU-Part-1--Getting-Started#">http://www.embedded.com/design/mcus-processors-and-socs/4007119/Building-Bare-Metal-ARM-Systems-with-GNU-Part-1&#8211;Getting-Started#</a></p>
<p style="padding-left: 60px;"><a href="http://www.gnudd.com/sw/fiq-engine.html">http://www.gnudd.com/sw/fiq-engine.html</a> (library that assist in building our own fiq handler, it provides utility such as print, etc)</p>
<p style="padding-left: 60px;">In the \arm\include\asm\mach there is  file called mmc.h which is a cut down version from the the plain vanilla kernel that resides inside arch\arm\mach-msm\include\mach</p>
<p style="padding-left: 60px;"><a href="http://kernel.ozandroid.info/wp-content/uploads/2013/02/image07.png"><img class="size-large wp-image-292 aligncenter" alt="image07" src="http://kernel.ozandroid.info/wp-content/uploads/2013/02/image07-1024x476.png" width="600" height="278" /></a></p>
<p style="padding-left: 60px;">There are few changes in the arch\arm\kernel directory</p>
<p>&nbsp;</p>
<p><img class="aligncenter" alt="" src="http://kernel.ozandroid.info/wp-content/uploads/2013/02/image03.png" /></p>
<p style="padding-left: 60px;">the biggest changes inside this directory is in the etm.c file. The file contains Macrocell code. Few observations for the other files</p>
<ol>
<ol>
<ol>
<ol>
<ol>
<li>leds.c → contains code for led notification, it is does as part of sysdev (/sys filesystem)</li>
<li>process.c → new code has been added to print out more information about the registers</li>
</ol>
</ol>
</ol>
</ol>
</ol>
<p style="padding-left: 60px;"> The folder mach-s5pv210 contains most of the code to define the processor of the device, in Nexus S case it is the S5PV210 application processor.  Some interesting observation</p>
<ol start="1">
<ol>
<ol>
<ol>
<ol>
<li>in the cpufreq.c there is a definition called SLEEP_FREQ that defined the speed of the processor when it is in sleep mode, in the code it is specified as 800Mhz</li>
<li>the MACHINE_START declaration can be found inside mach-herring.c file</li>
<li>there are few interrupts that are being registered such as &#8211; UARTs, Timer, ADC, Alarm, RTC, etc inside irq.c in the plat-s5p directory</li>
<li>the memory definitions can be seen in file map.h inside arch\arm\mach-s5pv210\include\mach\</li>
</ol>
</ol>
</ol>
</ol>
</ol>
<p style="padding-left: 60px;">GPIO pins configuration can be found inside the file gpio-herring.h inside arch/arm/mach-s5pv210/include/mach. The GPIO pin configuration will show which pin is configured for what and based on that information it is possible to trace through the kernel source code to see where the code specific to a particular functionality lives in. For example the there is a GPIO called GPIO_PHONE_ACTIVE and by searching for that string in the kernel I was able to find a file called dev-herring-phone.c containing code on how it handles phone calls. Most of the processor/phone configuration (GPS, buttons, leds, etc) and how it is handled inside Linux can be found inside in the arch/arm/mach-s5pv210 directory</p>
<ul>
<li><em>drivers</em></li>
</ul>
<p style="padding-left: 60px;">Lots of new and modified code in this directory, which is understandable as the crux of kernel are normally the interfacing with hardware and this directory is where the majority of code lives. The  Android drivers resides in the staging/ directory</p>
<ul>
<li><em>firmware</em></li>
</ul>
<p style="padding-left: 60px;">There is  a binary blob file called samsung_mfc_fw.bin.ihex. The file is a video driver file as can be seen in the Makefile. This is a proprietary driver for video which can only work for a specific kernel version.</p>
<p>&nbsp;</p>
<p><img class="aligncenter" alt="" src="http://kernel.ozandroid.info/wp-content/uploads/2013/02/image05.png" /></p>
<ul>
<li><em>fs</em></li>
</ul>
<p style="padding-left: 60px;">yaffs2 is the default filesystem used inside Android. This filesystem is used to mount the image file so that it can be accessed as normal filesystem.  Not obvious from the code which version of branch it is from, can be explored further from the project website <a href="http://www.yaffs.net/">www.yaffs.net</a></p>
<p style="padding-left: 60px;">Few files have been modified inside this directory</p>
<p><img class="aligncenter" alt="" src="http://kernel.ozandroid.info/wp-content/uploads/2013/02/image01.png" /></p>
<p style="padding-left: 60px;">Most of the changes are very minor except inside the file base.c in the proc directory</p>
<p>&nbsp;</p>
<p><img class="aligncenter" alt="" src="http://kernel.ozandroid.info/wp-content/uploads/2013/02/image02.png" /></p>
<ul>
<li><em>kernel</em></li>
</ul>
<p style="padding-left: 60px;"> Quite a number of changes inside this directory as can be seen in the screenshot below.  There are few new files which are related to wakelock and suspend features. Power management code mostly added inside here</p>
<p> <img class="aligncenter" alt="" src="http://kernel.ozandroid.info/wp-content/uploads/2013/02/image09.png" /></p>
<ul>
<li> <em>mm</em></li>
</ul>
<p style="padding-left: 60px;"> This directory contains the ashmem.c which is the memory management driver for Android.</p>
<p><img class="aligncenter" alt="" src="http://kernel.ozandroid.info/wp-content/uploads/2013/02/image04.png" /></p>
<ul>
<li><em>net</em></li>
</ul>
<p style="padding-left: 60px;">Lots of changes inside this directory, the following screenshot shows the file that have been modified.</p>
<p>&nbsp;</p>
<p><img class="aligncenter" alt="image00" src="http://kernel.ozandroid.info/wp-content/uploads/2013/02/image00.png" /></p>
<ul>
<li><em>sound</em></li>
</ul>
<p style="padding-left: 60px;">Contains the sound drivers inside the board. Looking at the code it is using WM8994 (<a href="http://www.wolfsonmicro.com/products/audio_hubs/WM8994/">http://www.wolfsonmicro.com/products/audio_hubs/WM8994/</a>) chipset. Memory management for the sound drivers are also available.</p>
<p><img class="aligncenter" alt="" src="http://kernel.ozandroid.info/wp-content/uploads/2013/02/image06.png" /></p>
<p>&nbsp;</p>
<p>My personal observation doing this exercise are as follows</p>
<ol start="1">
<li>Most of Samsung code are readily available in the vanilla kernel, so any additional code that are added are for new features or some bug fixes that have been done in new kernel version but not backported to old version.</li>
<li>Most of new code are in the machine configuration &#8211; this is the place information about the processor clock, pins configuration, interrupts, etc can be found. This is understandable as each board/machine have their own specific configuration not to mention the different GPIO pins. Due to this it is noticeable that the drivers code take the most chunk of new code added into the Android-ify kernel.</li>
</ol>
<ol start="3">
<li>Few changes are made to made to the main kernel code to ease debugging by adding new debug log messages.</li>
<li>Video is proprietary as this got to do with the GPU</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://kernel.ozandroid.info/?feed=rss2&#038;p=280</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git 1.7.1 Issue With Android</title>
		<link>http://kernel.ozandroid.info/?p=259</link>
		<comments>http://kernel.ozandroid.info/?p=259#comments</comments>
		<pubDate>Fri, 02 Nov 2012 23:42:05 +0000</pubDate>
		<dc:creator>nanik</dc:creator>
				<category><![CDATA[Kernel]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[sourcecode]]></category>

		<guid isPermaLink="false">http://kernel.ozandroid.info/?p=259</guid>
		<description><![CDATA[If you follow Android source code progress religiously you will come across a recent problem with their checkout repo script if you are using Git version 1.7.1 and before. When you checkout the Android source code you will bump into the following error error: Exited sync due to gc errors This error happens because the [...]]]></description>
				<content:encoded><![CDATA[<p>If you follow Android source code progress religiously you will come across a recent problem with their checkout repo script if you are using Git version 1.7.1 and before. When you checkout the Android source code you will bump into the following error </p>
<blockquote><p>error: Exited sync due to gc errors</p></blockquote>
<p>This error happens because the script is using the -c parameter which is only available in Git version 1.7.2 and above. To solve this problem upgrade your Git to the latest version or if you are using Ubuntu you can follow this step</p>
<blockquote><p>
# add the ppa repo:<br />
$ sudo apt-add-repository ppa:git-core/ppa</p>
<p>$ sudo nano /etc/apt/sources.list<br />
  # add the following lines, then exit (ctrl-X) and save (Y):<br />
  deb http://ppa.launchpad.net/git-core/ppa/ubuntu lucid main<br />
  deb-src http://ppa.launchpad.net/git-core/ppa/ubuntu lucid main</p>
<p># add the server&#8217;s key:<br />
$ sudo apt-key adv &#8211;keyserver keyserver.ubuntu.com &#8211;recv-keys E1DF1F24<br />
$ sudo apt-get update</p>
<p># remove and reinstall:<br />
$ sudo apt-get remove git-core<br />
$ sudo apt-get install git
</p></blockquote>
<p><a href="https://groups.google.com/forum/?fromgroups=#!topic/android-platform/slw9-s3lCHk" class="postlink" target="_blank">Android Building Link</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kernel.ozandroid.info/?feed=rss2&#038;p=259</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android 4.0.3 Source Code Layout</title>
		<link>http://kernel.ozandroid.info/?p=249</link>
		<comments>http://kernel.ozandroid.info/?p=249#comments</comments>
		<pubDate>Fri, 25 May 2012 06:37:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Kernel]]></category>

		<guid isPermaLink="false">http://kernel.ozandroid.info/?p=249</guid>
		<description><![CDATA[Android source code is huge and it takes sometime for a developer to get around it to know what is stored inside it. The reason why Android source code is big is because of the sheer amount of different open source projects that are used internally and the task of looking into each directory to [...]]]></description>
				<content:encoded><![CDATA[<p>Android source code is huge and it takes sometime for a developer to get around it to know what is stored inside it. The reason why Android source code is big is because of the sheer amount of different open source projects that are used internally and the task of looking into each directory to see what is inside each one of them can be a very daunting tasks. The first time I looked into the source code I thought there must be someway easier to look into this, something like a page that explains what does each directories inside Android contains. </p>
<p>Because of my own need and to make my life easier I created a document explaining the different directories inside Android  containing simple description what is its contents. At the moment the document contains information for Android 4.0.3_r1, as source code keep on changing I will try to keep it up to date to the latest version that are available in the Android repository.</p>
<p>Click here to view the <a href="https://docs.google.com/document/pub?id=17PySzW_2nZF9dDiV9ov-8d7dY3B0vzZ6trFSQbQNSFs" class="postlink" target="_blank">document</a></p>
<p>Feel free to leave to comment or correction for the document in this post</p>
]]></content:encoded>
			<wfw:commentRss>http://kernel.ozandroid.info/?feed=rss2&#038;p=249</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building GCC From Scratch</title>
		<link>http://kernel.ozandroid.info/?p=125</link>
		<comments>http://kernel.ozandroid.info/?p=125#comments</comments>
		<pubDate>Tue, 27 Dec 2011 12:48:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AppDev]]></category>

		<guid isPermaLink="false">http://kernel.ozandroid.info/?p=125</guid>
		<description><![CDATA[Preparing Linux Development Environment This tutorial uses Linux to build and use GCC and the distro flavour used is the Ubuntu distro. This tutorial uses the Xubuntu distro but you can use different kind of Ubuntu distro. If you are not experienced with Linux than it is recommended that you use the same version and [...]]]></description>
				<content:encoded><![CDATA[<h1>Preparing Linux Development Environment</h1>
<p>This tutorial uses Linux to build and use GCC and the distro flavour used is the Ubuntu distro. This tutorial uses the Xubuntu distro but you can use different kind of Ubuntu distro. If you are not experienced with Linux than it is recommended that you use the same version and distro with this tutorial to save time and pain down the track in troubleshooting problems. The screenshot shows the Linux Kernel and Xubuntu version I&#8217;m using for this tutorial, to make it easier I&#8217;m outlining the Linux version information here</p>
<blockquote><p>Linux ubuntu 3.0.0-12-generic #20-Ubuntu SMP &#8230; x86_64 GNU/Linux</p></blockquote>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure1.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure1-300x263.png" alt="" title="Figure1" width="300" height="263" class="alignnone size-medium wp-image-132" /></a></p>
<h1>Toolchain Script Preparation</h1>
<p>There are a number of ways you can build GCC from the ground up but most of the scripts that I came across are either out of date, buggy or worse not maintained and out of date. I found the <a href="http://www.hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-binutils-gcc-newlib-and-gdb-from-source">scripts</a> created by Uwe Hermann is the most easiest to use and it is also maintained up to date in <a href="https://github.com/esden/summon-arm-toolchain">github</a> by Piotr Esden-Tempski. Use the latest source from github by checking it out as follows (if you don&#8217;t have git installed on your machine follows the instructions in the troubleshooting section)</p>
<blockquote><p>git clone https://github.com/esden/summon-arm-toolchain.git</p></blockquote>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure4.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure4-300x67.png" alt="" title="Figure4" width="300" height="67" class="alignnone size-medium wp-image-135" /></a></p>
<p>The next step, which is the most crucial step in the whole process is to install all the necessary libraries that are required by GCC. Execute the following command to install the libraries</p>
<blockquote><p>sudo apt-get install flex bison libgmp3-dev libmpfr-dev libncurses5-dev libmpc-dev autoconf texinfo build-essential libftdi-dev zlib1g-dev</p></blockquote>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure5.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure5-300x168.png" alt="" title="Figure5" width="300" height="168" class="alignnone size-medium wp-image-136" /></a></p>
<p>Press Y when it asked Do you want to continue. It will take sometime but you will see few lines of messages coming out to inform you about the installation progress. You will get something similar as below</p>
<blockquote><p>
Get:1 http://us.archive.ubuntu.com/ubuntu/ oneiric/main autoconf all 2.68-1ubuntu1 [560 kB]<br />
Get:2 http://us.archive.ubuntu.com/ubuntu/ oneiric/main autotools-dev all 20110511.1 [44.7 kB]<br />
Get:3 http://us.archive.ubuntu.com/ubuntu/ oneiric/main automake all 1:1.11.1-1ubuntu1 [544 kB]<br />
Get:4 http://us.archive.ubuntu.com/ubuntu/ oneiric/main libstdc++6-4.6-dev amd64 4.6.1-9ubuntu3 [1,644 kB]<br />
Get:5 http://us.archive.ubuntu.com/ubuntu/ oneiric/main g++-4.6 amd64 4.6.1-9ubuntu3 [6,970 kB]<br />
Get:6 http://us.archive.ubuntu.com/ubuntu/ oneiric/main g++ amd64 4:4.6.1-2ubuntu5 [1,444 B]<br />
Get:7 http://us.archive.ubuntu.com/ubuntu/ oneiric/main libdpkg-perl all 1.16.0.3ubuntu5 [171 kB]<br />
Get:8 http://us.archive.ubuntu.com/ubuntu/ oneiric/main dpkg-dev all 1.16.0.3ubuntu5 [473 kB]<br />
Get:9 http://us.archive.ubuntu.com/ubuntu/ oneiric/main build-essential amd64 11.5ubuntu1 [5,928 B]<br />
Get:10 http://us.archive.ubuntu.com/ubuntu/ oneiric/main fakeroot amd64 1.17-1 [107 kB]<br />
Get:11 http://us.archive.ubuntu.com/ubuntu/ oneiric/main libalgorithm-diff-perl all 1.19.02-2 [50.7 kB]<br />
Get:12 http://us.archive.ubuntu.com/ubuntu/ oneiric/main libalgorithm-diff-xs-perl amd64 0.04-1build1 [13.4 kB]<br />
Get:13 http://us.archive.ubuntu.com/ubuntu/ oneiric/main libalgorithm-merge-perl all 0.08-2 [12.7 kB]<br />
Get:14 http://us.archive.ubuntu.com/ubuntu/ oneiric/main libgmpxx4ldbl amd64 2:5.0.1+dfsg-7ubuntu2 [10.7 kB]<br />
Get:15 http://us.archive.ubuntu.com/ubuntu/ oneiric/main libgmp-dev amd64 2:5.0.1+dfsg-7ubuntu2 [367 kB]<br />
Get:16 http://us.archive.ubuntu.com/ubuntu/ oneiric/main libgmp3-dev amd64 2:5.0.1+dfsg-7ubuntu2 [3,814 B]<br />
Get:17 http://us.archive.ubuntu.com/ubuntu/ oneiric/main libmpfr-dev amd64 3.0.1-5 [234 kB]<br />
Get:18 http://us.archive.ubuntu.com/ubuntu/ oneiric/main libtinfo-dev amd64 5.9-1ubuntu5 [71.2 kB]<br />
Get:19 http://us.archive.ubuntu.com/ubuntu/ oneiric/main libncurses5-dev amd64 5.9-1ubuntu5 [252 kB]<br />
Get:20 http://us.archive.ubuntu.com/ubuntu/ oneiric/main texinfo amd64 4.13a.dfsg.1-8ubuntu1 [458 kB]<br />
Get:21 http://us.archive.ubuntu.com/ubuntu/ oneiric/main libmpc-dev amd64 0.9-3 [53.1 kB]<br />
Fetched 12.0 MB in 1min 17s (156 kB/s)<br />
Selecting previously deselected package autoconf.<br />
(Reading database &#8230; 148533 files and directories currently installed.)<br />
Unpacking autoconf (from &#8230;/autoconf_2.68-1ubuntu1_all.deb) &#8230;<br />
Selecting previously deselected package autotools-dev.<br />
Unpacking autotools-dev (from &#8230;/autotools-dev_20110511.1_all.deb) &#8230;<br />
Selecting previously deselected package automake.<br />
Unpacking automake (from &#8230;/automake_1%3a1.11.1-1ubuntu1_all.deb) &#8230;<br />
Selecting previously deselected package libstdc++6-4.6-dev.<br />
Unpacking libstdc++6-4.6-dev (from &#8230;/libstdc++6-4.6-dev_4.6.1-9ubuntu3_amd64.deb) &#8230;<br />
Selecting previously deselected package g++-4.6.<br />
Unpacking g++-4.6 (from &#8230;/g++-4.6_4.6.1-9ubuntu3_amd64.deb) &#8230;<br />
Selecting previously deselected package g++.<br />
Unpacking g++ (from &#8230;/g++_4%3a4.6.1-2ubuntu5_amd64.deb) &#8230;<br />
Selecting previously deselected package libdpkg-perl.<br />
Unpacking libdpkg-perl (from &#8230;/libdpkg-perl_1.16.0.3ubuntu5_all.deb) &#8230;<br />
Selecting previously deselected package dpkg-dev.<br />
Unpacking dpkg-dev (from &#8230;/dpkg-dev_1.16.0.3ubuntu5_all.deb) &#8230;<br />
Selecting previously deselected package build-essential.<br />
Unpacking build-essential (from &#8230;/build-essential_11.5ubuntu1_amd64.deb) &#8230;<br />
Selecting previously deselected package fakeroot.<br />
Unpacking fakeroot (from &#8230;/fakeroot_1.17-1_amd64.deb) &#8230;<br />
Selecting previously deselected package libalgorithm-diff-perl.<br />
Unpacking libalgorithm-diff-perl (from &#8230;/libalgorithm-diff-perl_1.19.02-2_all.deb) &#8230;<br />
Selecting previously deselected package libalgorithm-diff-xs-perl.<br />
Unpacking libalgorithm-diff-xs-perl (from &#8230;/libalgorithm-diff-xs-perl_0.04-1build1_amd64.deb) &#8230;<br />
Selecting previously deselected package libalgorithm-merge-perl.<br />
Unpacking libalgorithm-merge-perl (from &#8230;/libalgorithm-merge-perl_0.08-2_all.deb) &#8230;<br />
Selecting previously deselected package libgmpxx4ldbl.<br />
Unpacking libgmpxx4ldbl (from &#8230;/libgmpxx4ldbl_2%3a5.0.1+dfsg-7ubuntu2_amd64.deb) &#8230;<br />
Selecting previously deselected package libgmp-dev.<br />
Unpacking libgmp-dev (from &#8230;/libgmp-dev_2%3a5.0.1+dfsg-7ubuntu2_amd64.deb) &#8230;<br />
Selecting previously deselected package libgmp3-dev.<br />
Unpacking libgmp3-dev (from &#8230;/libgmp3-dev_2%3a5.0.1+dfsg-7ubuntu2_amd64.deb) &#8230;<br />
Selecting previously deselected package libmpfr-dev.<br />
Unpacking libmpfr-dev (from &#8230;/libmpfr-dev_3.0.1-5_amd64.deb) &#8230;<br />
Selecting previously deselected package libtinfo-dev.<br />
Unpacking libtinfo-dev (from &#8230;/libtinfo-dev_5.9-1ubuntu5_amd64.deb) &#8230;<br />
Selecting previously deselected package libncurses5-dev.<br />
Unpacking libncurses5-dev (from &#8230;/libncurses5-dev_5.9-1ubuntu5_amd64.deb) &#8230;<br />
Selecting previously deselected package texinfo.<br />
Unpacking texinfo (from &#8230;/texinfo_4.13a.dfsg.1-8ubuntu1_amd64.deb) &#8230;<br />
Selecting previously deselected package libmpc-dev.<br />
Unpacking libmpc-dev (from &#8230;/libmpc-dev_0.9-3_amd64.deb) &#8230;<br />
Processing triggers for man-db &#8230;<br />
Processing triggers for doc-base &#8230;<br />
Processing 1 added doc-base file&#8230;<br />
Registering documents with scrollkeeper&#8230;<br />
Processing triggers for install-info &#8230;<br />
Setting up autoconf (2.68-1ubuntu1) &#8230;<br />
Setting up autotools-dev (20110511.1) &#8230;<br />
Setting up automake (1:1.11.1-1ubuntu1) &#8230;<br />
update-alternatives: using /usr/bin/automake-1.11 to provide /usr/bin/automake (automake) in auto mode.<br />
Setting up libdpkg-perl (1.16.0.3ubuntu5) &#8230;<br />
Setting up dpkg-dev (1.16.0.3ubuntu5) &#8230;<br />
Setting up fakeroot (1.17-1) &#8230;<br />
update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode.<br />
Setting up libalgorithm-diff-perl (1.19.02-2) &#8230;<br />
Setting up libalgorithm-diff-xs-perl (0.04-1build1) &#8230;<br />
Setting up libalgorithm-merge-perl (0.08-2) &#8230;<br />
Setting up libgmpxx4ldbl (2:5.0.1+dfsg-7ubuntu2) &#8230;<br />
Setting up libgmp-dev (2:5.0.1+dfsg-7ubuntu2) &#8230;<br />
Setting up libgmp3-dev (2:5.0.1+dfsg-7ubuntu2) &#8230;<br />
Setting up libmpfr-dev (3.0.1-5) &#8230;<br />
Setting up libtinfo-dev (5.9-1ubuntu5) &#8230;<br />
Setting up libncurses5-dev (5.9-1ubuntu5) &#8230;<br />
Setting up texinfo (4.13a.dfsg.1-8ubuntu1) &#8230;<br />
Setting up libmpc-dev (0.9-3) &#8230;<br />
Setting up libstdc++6-4.6-dev (4.6.1-9ubuntu3) &#8230;<br />
Setting up g++-4.6 (4.6.1-9ubuntu3) &#8230;<br />
Setting up g++ (4:4.6.1-2ubuntu5) &#8230;<br />
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode.<br />
Setting up build-essential (11.5ubuntu1) &#8230;<br />
Processing triggers for libc-bin &#8230;<br />
ldconfig deferred processing now taking place
</p></blockquote>
<h1>Building Toolchain</h1>
<p>This step will guide you on how to build GCC. Change to the directory that contains the checked out scripts and execute the command as follow</p>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure6.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure6-300x67.png" alt="" title="Figure6" width="300" height="67" class="alignnone size-medium wp-image-137" /></a></p>
<p>You will see the script will start downloading all the necessary dependencies that are required to build GCC. The first dependency is the <em>binutils</em></p>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure7.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure7-300x113.png" alt="" title="Figure7" width="300" height="113" class="alignnone size-medium wp-image-138" /></a></p>
<p>Next, the script will download GCC. In this case the script is downloading GCC from <a href="http://www.linaro.org">Linaro</a> website. This step will take a bit longer than the other steps as this is the core GCC source codes that are being downloaded.</p>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure8.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure8-300x60.png" alt="" title="Figure8" width="300" height="60" class="alignnone size-medium wp-image-139" /></a></p>
<p>Next, it will download <em>newlib</em> library</p>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure9.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure9-300x55.png" alt="" title="Figure9" width="300" height="55" class="alignnone size-medium wp-image-140" /></a></p>
<p>Next, it will download <em>gdb</em> debugger</p>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure10.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure10-300x42.png" alt="" title="Figure10" width="300" height="42" class="alignnone size-medium wp-image-141" /></a></p>
<p>Next, it will download <em>openocd</em></p>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure11.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure11-300x89.png" alt="" title="Figure11" width="300" height="89" class="alignnone size-medium wp-image-142" /></a></p>
<p>After completing the download process the script will unpack the source code one by one. The first one will be the binutils and you will see long list of files being extracted out looking something like the following</p>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure12.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure12-300x227.png" alt="" title="Figure12" width="300" height="227" class="alignnone size-medium wp-image-143" /></a></p>
<p>On completion of the extraction process the compilation process for <em>binutils</em> will kick in and will look as the following</p>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure13.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure13-300x194.png" alt="" title="Figure13" width="300" height="194" class="alignnone size-medium wp-image-144" /></a></p>
<p>Compilation process will take sometime to complete as it involved quite a lot of files. After completing the <em>binutils</em> compilation the script will move to extract the <em>GCC</em> and <em>newlib</em> source codes followed by the compilation process.</p>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure14.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure14-300x188.png" alt="" title="Figure14" width="300" height="188" class="alignnone size-medium wp-image-145" /></a></p>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure15.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure15-300x230.png" alt="" title="Figure15" width="300" height="230" class="alignnone size-medium wp-image-146" /></a></p>
<p>On completion of the <em>GCC</em> and <em>newlib</em> source code the <em>GCC</em> have been compiled and ready to use. The next step after this the script will compile the <em>openocd</em> and <em>gdb</em> source code too. </p>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure22.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure22-300x184.png" alt="" title="Figure22" width="300" height="184" class="alignnone size-medium wp-image-153" /></a></p>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure23.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure23-300x184.png" alt="" title="Figure23" width="300" height="184" class="alignnone size-medium wp-image-155" /></a></p>
<p>It is advisable to let the whole script complete before doing anything. At any given point of time if the script stops because of errors check the Appendix section for troubleshooting tips and fixes, once you have done the fix you can re-run the script again.</p>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure25.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure25-300x184.png" alt="" title="Figure25" width="300" height="184" class="alignnone size-medium wp-image-157" /></a></p>
<h1>Checking The New GCC</h1>
<p>Once GCC has been compiled successfully you need to test to make sure that it is working, the first and easiest step is to execute it. If you haven&#8217;t changed anything from the <em>summon-arm-toolchain</em> script the GCC binaries would have been installed in the /sat directory in your home folder, in my case it is installed in <em>/home/nanik/sat</em></p>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure26.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure26-300x235.png" alt="" title="Figure26" width="300" height="235" class="alignnone size-medium wp-image-158" /></a></p>
<p>In order to execute the newly created GCC you need to add it to your PATH environment variable as follows </p>
<blockquote><p>PATH=$PATH:~/sat/bin</p></blockquote>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure19.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure19-300x84.png" alt="" title="Figure19" width="300" height="84" class="alignnone size-medium wp-image-150" /></a></p>
<p>to print out the help menu of GCC type in (Note: help option is with double dash)</p>
<blockquote><p>arm-none-eabi-gcc &#8211;help</p></blockquote>
<p>you will the output as shown below. The output shown is a printout of the available options in GCC</p>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure20.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure20-300x159.png" alt="" title="Figure20" width="300" height="159" class="alignnone size-medium wp-image-151" /></a></p>
<p>the other way to check is to print out the supported platform/architecture that GCC can compile the source code to. Execute the following commmand (Note: target-help option is with double dash)</p>
<blockquote><p>arm-none-eabi-gcc &#8211;target-help</p></blockquote>
<p>if you scroll down the output on your screen you will see something like the following screen</p>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure21.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure21-300x108.png" alt="" title="Figure21" width="300" height="108" class="alignnone size-medium wp-image-152" /></a></p>
<p>What you are seeing on the output is the ARM CPUs that are supported by the GCC and also the ARM architectures (instruction sets) that are supported. </p>
<p>If you have reached this part of the instruction that means you have successfully compiled and run GCC. Now you can use the GCC as part of your build process.</p>
<h1>Troubleshooting</h1>
<h3>Installing git</h3>
<p>If you don&#8217;t have git installed on your machine execute the following command</p>
<blockquote><p>sudo apt-get install git</p></blockquote>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure2.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure2-300x10.png" alt="" title="Figure2" width="300" height="10" class="alignnone size-medium wp-image-133" /></a></p>
<p>You will get somewhat similar kind of messages, and once the download and installtion is done you can use git</p>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure3.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure3-300x232.png" alt="" title="Figure3" width="300" height="232" class="alignnone size-medium wp-image-134" /></a></p>
<h3>zlib compilation error</h3>
<p>During compilation process if you come across problem such as </p>
<blockquote><p>fatal error: zlib.h: No such file or directory</p></blockquote>
<p>install the zlib by using the following command</p>
<blockquote><p>sudo apt-get install zlib1g-dev</p></blockquote>
<h3>openocd compilation error</h3>
<p>During openocd compilation process if you come across error</p>
<blockquote><p>error: Cannot build &#038; run test program using libftdi</p></blockquote>
<p>install the libftdi library by using the following command</p>
<blockquote><p>sudo apt-get install libftdi-dev</p></blockquote>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure17.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure17-300x107.png" alt="" title="Figure17" width="300" height="107" class="alignnone size-medium wp-image-148" /></a></p>
<p>Enter Y to continue the installation process, once completed you will something like below</p>
<p><a href="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure18.png"><img src="http://kernel.ozandroid.info/wp-content/uploads/2011/12/Figure18-300x113.png" alt="" title="Figure18" width="300" height="113" class="alignnone size-medium wp-image-149" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://kernel.ozandroid.info/?feed=rss2&#038;p=125</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>ARM DS-5 Tutorial For Android</title>
		<link>http://kernel.ozandroid.info/?p=83</link>
		<comments>http://kernel.ozandroid.info/?p=83#comments</comments>
		<pubDate>Thu, 01 Dec 2011 10:38:56 +0000</pubDate>
		<dc:creator>nanik</dc:creator>
				<category><![CDATA[AppDev]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[DS-5]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[NDK]]></category>
		<category><![CDATA[SDK]]></category>

		<guid isPermaLink="false">http://kernel.ozandroid.info/?p=83</guid>
		<description><![CDATA[Prerequisite Must have Java 1.6+ installed on your local machine DS-5 Installation Steps 1. Download Eclipse making sure it’s Eclipse Indigo 2. Download Android SDK 3. Click on the link to download, in my case I downloaded the .zip file (android-sdk_r15-windows.zip) 4. Download the Android NDK (Native Development Kit) from http://developer.android.com/sdk/ndk 5. Unzip both the [...]]]></description>
				<content:encoded><![CDATA[<h1>Prerequisite</h1>
<p>Must have Java 1.6+ installed on your local machine</p>
<h1>DS-5 Installation Steps</h1>
<p>1. Download Eclipse making sure it’s Eclipse Indigo<br />
<a class="thumbnail" href="#thumb"><img src="/wp-content/uploads/2011/12/image001.png" alt="" /></a></p>
<p>2. Download Android SDK</p>
<p><a href="/wp-content/uploads/2011/12/image003.png"><img src="/wp-content/uploads/2011/12/image003.png" alt="" /></a></p>
<p>3. Click on the link to download, in my case I downloaded the .zip file (android-sdk_r15-windows.zip)</p>
<p><a href="/wp-content/uploads/2011/12/.png"><img src="/wp-content/uploads/2011/12/image005.png" alt="" /></a></p>
<p>4. Download the Android NDK (Native Development Kit) from http://developer.android.com/sdk/ndk</p>
<p><a href="/wp-content/uploads/2011/12/image007.png"><img src="/wp-content/uploads/2011/12/image007.png" alt="" /></a></p>
<p>5. Unzip both the NDK and SDK .zip files to a directory</p>
<p><a href="/wp-content/uploads/2011/12/image009.png"><img src="/wp-content/uploads/2011/12/image009.png" alt="" /></a></p>
<p>6. Unzip Eclipse .zip to a directory</p>
<p><a href="/wp-content/uploads/2011/12/image011.png"><img src="/wp-content/uploads/2011/12/image011.png" alt="" /></a></p>
<p>7. Launch Eclipse and specify the workspace</p>
<p><a href="/wp-content/uploads/2011/12/image013.png"><img src="/wp-content/uploads/2011/12/image013.png" alt="" /></a></p>
<p>8. Select Install New Software… from the Help menu</p>
<p><a href="/wp-content/uploads/2011/12/image015.png"><img src="/wp-content/uploads/2011/12/image015.png" alt="" /></a></p>
<p>9. Enter the repository information in the Name and Location field</p>
<p><a href="/wp-content/uploads/2011/12/image017.png"><img src="/wp-content/uploads/2011/12/image017.png" alt="" /></a></p>
<p>10. Select the ARM DS-5 Community Edition by clicking on the tickbox</p>
<p><a href="/wp-content/uploads/2011/12/image019.png"><img src="/wp-content/uploads/2011/12/image019.png" alt="" /></a></p>
<p>11. You should see the Eclipse plug-ins for DS-5 Community Edition with all the necessary components shown.</p>
<p><a href="/wp-content/uploads/2011/12/image021.png"><img src="/wp-content/uploads/2011/12/image021.png" alt="" /></a></p>
<p>12. Select the radio button for I accept the terms of the license agreements and click on Finish button</p>
<p><a href="/wp-content/uploads/2011/12/image023.png"><img src="/wp-content/uploads/2011/12/image023.png" alt="" /></a></p>
<p>13. You will see the progress of the components being installed . Depending on your internet connection it will take few minutes to 15-20min to complete the downloading and installing of the components.</p>
<p><a href="/wp-content/uploads/2011/12/image025.png"><img src="/wp-content/uploads/2011/12/image025.png" alt="" /></a></p>
<p>14. Click on Restart Now</p>
<p><a href="/wp-content/uploads/2011/12/image027.png"><img src="/wp-content/uploads/2011/12/image027.png" alt="" /></a></p>
<p>15. When Eclipse has started select the Install Community Edition license and click Continue button</p>
<p><a href="/wp-content/uploads/2011/12/image029.png"><img src="/wp-content/uploads/2011/12/image029.png" alt="" /></a></p>
<h1>Android SDK Configuration</h1>
<p>1. Install ADT (Android Development Toolkit) plugin</p>
<p><a href="/wp-content/uploads/2011/12/image031.png"><img src="/wp-content/uploads/2011/12/image031.png" alt="" /></a></p>
<p>2. Select the Developer Tools check box to select the components that need to be installed</p>
<p><a href="/wp-content/uploads/2011/12/image033.png"><img src="/wp-content/uploads/2011/12/image033.png" alt="" /></a></p>
<p>3. Check to make sure all the necessary components have been selected.</p>
<p><a href="/wp-content/uploads/2011/12/image035.png"><img src="/wp-content/uploads/2011/12/image035.png" alt="" /></a></p>
<p>4. Select I accept the terms of the license agreements</p>
<p><a href="/wp-content/uploads/2011/12/image037.png"><img src="/wp-content/uploads/2011/12/image037.png" alt="" /></a></p>
<p>5. The installation process will start and wait until it’s completed</p>
<p><a href="/wp-content/uploads/2011/12/image039.png"><img src="/wp-content/uploads/2011/12/image039.png" alt="" /></a></p>
<p>6. You will get a Warning message to tell you that the software content is not signed, for this just click Ok button</p>
<p><a href="/wp-content/uploads/2011/12/image041.png"><img src="/wp-content/uploads/2011/12/image041.png" alt="" /></a></p>
<p>7. Click on Restart Now</p>
<p><a href="/wp-content/uploads/2011/12/image027.png"><img src="/wp-content/uploads/2011/12/image027.png" alt="" /></a></p>
<p>8. Select Window &#8211;&gt; Preferences</p>
<p><a href="/wp-content/uploads/2011/12/image043.png"><img src="/wp-content/uploads/2011/12/image043.png" alt="" /></a></p>
<p>9. Select Android from the Preferences window and click on Browse… button to select the SDK location</p>
<p><a href="/wp-content/uploads/2011/12/image045.png"><img src="/wp-content/uploads/2011/12/image045.png" alt="" /></a></p>
<p>10. You will get Android SDK Verification message box, click on Ok button</p>
<p><a href="/wp-content/uploads/2011/12/image047.png"><img src="/wp-content/uploads/2011/12/image047.png" alt="" /></a></p>
<p>11. Exit Eclipse</p>
<p>12. Run SDK Manager.exe</p>
<p><a href="/wp-content/uploads/2011/12/image049.png"><img src="/wp-content/uploads/2011/12/image049.png" alt="" /></a></p>
<p>13. Make sure the following are selected</p>
<ul>
<li>Android SDK Platform-tools</li>
<li>Documentation for Android SDK</li>
<li>SDK Platform</li>
<li>Samples for SDK</li>
<li>ARM EABI v7a System Image</li>
<li>Google APIs by Google Inc.</li>
</ul>
<p><a href="/wp-content/uploads/2011/12/image051.png"><img src="/wp-content/uploads/2011/12/image051.png" alt="" /></a></p>
<p>14. Select Accept All and click Install button</p>
<p><a href="/wp-content/uploads/2011/12/image053.png"><img src="/wp-content/uploads/2011/12/image053.png" alt="" /></a></p>
<p>15. Wait until the downloading complete. The download process will take sometime as it’s downloading quite a number of files for the SDK.</p>
<p><a href="/wp-content/uploads/2011/12/image055.png"><img src="/wp-content/uploads/2011/12/image055.png" alt="" /></a></p>
<p>16. Click on Yes once you are done</p>
<p><a href="/wp-content/uploads/2011/12/image057.png"><img src="/wp-content/uploads/2011/12/image057.png" alt="" /></a></p>
<p>17. Open the AVD Manager by selecting Windows &#8211;&gt; AVD Manager</p>
<p><a href="/wp-content/uploads/2011/12/image059.png"><img src="/wp-content/uploads/2011/12/image059.png" alt="" /></a></p>
<p>18. Click on New… button</p>
<p><a href="/wp-content/uploads/2011/12/image061.png"><img src="/wp-content/uploads/2011/12/image061.png" alt="" /></a></p>
<p>19. Enter the information for creating a new AVD (Android Virtual Device) and click on Create AVD</p>
<p><a href="/wp-content/uploads/2011/12/image063.png"><img src="/wp-content/uploads/2011/12/image063.png" alt="" /></a></p>
<p>20. Click on the Start… button to bring up the Launch Options dialog box. Click on Launch button.</p>
<p><a href="/wp-content/uploads/2011/12/image065.png"><img src="/wp-content/uploads/2011/12/image065.png" alt="" /></a></p>
<p>21. If everything goes well you should be able to see the following Ice Cream Sandwich (Android 4.0) startup screen.</p>
<p><a href="/wp-content/uploads/2011/12/image067.png"><img src="/wp-content/uploads/2011/12/image067.png" alt="" /></a></p>
<p>Once you are able to see the Android home screen your setup is complete</p>
<h1>How To Run NDK Sample Application</h1>
<p>1. Change to your NDK directory and execute the command ndk-build -C samples/hello-neon in your command prompt as shown below</p>
<p><a href="/wp-content/uploads/2011/12/image069.png"><img src="/wp-content/uploads/2011/12/image069.png" alt="" /></a></p>
<p>2. Open up Eclipse and select File &#8211;&gt; New &#8211;&gt; Project and select Android Project</p>
<p><a href="/wp-content/uploads/2011/12/image071.png"><img src="/wp-content/uploads/2011/12/image071.png" alt="" /></a></p>
<p>3. Type in the name of the project and for the Location field select the sample hello-neon and click on Finish button</p>
<p><a href="/wp-content/uploads/2011/12/image073.png"><img src="/wp-content/uploads/2011/12/image073.png" alt="" /></a></p>
<p>4. Once the project has been imported double-click on AndroidManifest.xml and select the Application tab. Once it’s opened click on the Application Attributes heading, you will see the Debuggable option and select true . Save the file before moving on to the next steps.</p>
<p><a href="/wp-content/uploads/2011/12/image075.png"><img src="/wp-content/uploads/2011/12/image075.png" alt="" /></a></p>
<p>5. Run the application by right clicking on the hello-neon project and select Run As and select Android Application</p>
<p><a href="/wp-content/uploads/2011/12/image077.png"><img src="/wp-content/uploads/2011/12/image077.png" alt="" /></a></p>
<p>6. You will see on the Console tab the following messages</p>
<p><a href="/wp-content/uploads/2011/12/image079.png"><img src="/wp-content/uploads/2011/12/image079.png" alt="" /></a></p>
<p>7. You will see the application run in the emulator as follows</p>
<p><a href="/wp-content/uploads/2011/12/image081.png"><img src="/wp-content/uploads/2011/12/image081.png" alt="" /></a></p>
<h1>How To Setup Debugging</h1>
<p>1. Open the debug perspective by select Window &#8211;&gt; Open Perspective &#8211;&gt; Debug</p>
<p><a href="/wp-content/uploads/2011/12/image083.png"><img src="/wp-content/uploads/2011/12/image083.png" alt="" /></a></p>
<p>2. Open the debug perspective by select Window &#8211;&gt; Open Perspective &#8211;&gt; DS-5 Debug.You will see screen similar to the following screen shot</p>
<p><a href="/wp-content/uploads/2011/12/image085.png"><img src="/wp-content/uploads/2011/12/image085.png" alt="" /></a></p>
<p>3. Open up the debug configuration by selecting Run &#8211;&gt; Debug Configurations</p>
<p><a href="/wp-content/uploads/2011/12/image087.png"><img src="/wp-content/uploads/2011/12/image087.png" alt="" /></a></p>
<p>4. Create a new configuration by clicking on the New launch configuration button. Untick the Connect as root and check make sure that your physical device (mobile phone/tablet) is connected properly to the USB and the ID is shown in the Connections drop down box.</p>
<p>If any of the above information are not done properly the <img class="imgicon" src="/wp-content/uploads/2011/12/image089.png" alt="" /> tab will have an error on it like so <img class="imgicon" src="/wp-content/uploads/2011/12/image091.png" alt="" /></p>
<p><a href="/wp-content/uploads/2011/12/image093.png"><img src="/wp-content/uploads/2011/12/image093.png" alt="" /></a></p>
<p>5. Fill in the following under the Files and click on the Workspace… button to browse for the project and select the hello-neon project. Do the same step for both the Project directory and APK file.</p>
<p><a href="/wp-content/uploads/2011/12/image095.png"><img src="/wp-content/uploads/2011/12/image095.png" alt="" /></a></p>
<p><a href="/wp-content/uploads/2011/12/image097.png"><img src="/wp-content/uploads/2011/12/image097.png" alt="" /></a></p>
<p>6. Fill in the following under Debugger tab</p>
<p><a href="/wp-content/uploads/2011/12/image099.png"><img src="/wp-content/uploads/2011/12/image099.png" alt="" /></a></p>
<h1>Using Debugger</h1>
<p>1. Switch to DS-5 Debug mode</p>
<p><a href="/wp-content/uploads/2011/12/image101.png"><img src="/wp-content/uploads/2011/12/image101.png" alt="" /></a></p>
<p>2. Open up the helloneon.c file and put a break point on line 109 and 113. Double click on the blue line of the left side of the screen to put the breakpoint in (a small blue color circle)</p>
<p><a href="/wp-content/uploads/2011/12/image103.png"><img src="/wp-content/uploads/2011/12/image103.png" alt="" /></a></p>
<p>3. To start debugging click on the DS-5 debug icon <img class="imgicon" src="/wp-content/uploads/2011/12/image105.png" alt="" /> or go to Run &#8211;&gt; Debug Configurations and select the helloNeon under the DS-5 Debugger section. Click on the Debug button on Debug Configurations box.</p>
<p><a href="/wp-content/uploads/2011/12/image107.png"><img src="/wp-content/uploads/2011/12/image107.png" alt="" /></a></p>
<p>4. Once the application is running on your device you can see the breakpoint will be hit at the line that you setup from the previous step</p>
<p><a href="/wp-content/uploads/2011/12/image109.png"><img src="/wp-content/uploads/2011/12/image109.png" alt="" /></a></p>
<p><a href="/wp-content/uploads/2011/12/image111.png"><img src="/wp-content/uploads/2011/12/image111.png" alt="" /></a></p>
<p>5. To connect or disconnect the debugging session use the connect and disconnect button in the Debug Control</p>
<p><a href="/wp-content/uploads/2011/12/image113.png"><img src="/wp-content/uploads/2011/12/image113.png" alt="" /></a></p>
<h1>Problem and Fixes</h1>
<p>1. If your ARM menus from the Help menu does not show up it’s because it cannot find the license key. What you must do is make sure you have the proper location of your eclipse directory in your PATH folder</p>
<p>2. If you are getting the following error meaning that you have not compiled the program to generate the .so file. Follow step 1 from the How To Run NDK Sample Application section.</p>
<p><a href="/wp-content/uploads/2011/12/image115.png"><img src="/wp-content/uploads/2011/12/image115.png" alt="" /></a></p>
<p>3. If you are getting the following error this means that the .apk has not been generated</p>
<p><a href="/wp-content/uploads/2011/12/image117.png"><img src="/wp-content/uploads/2011/12/image117.png" alt="" /></a></p>
<p>the easiest way to resolve this is to run the application by right clicking on the hello-neon project and select Run As and select Android Application. Once the application has been exported to your phone do the debugging steps again.</p>
<p><a href="/wp-content/uploads/2011/12/image119.png"><img src="/wp-content/uploads/2011/12/image119.png" alt="" /></a></p>
<p>4. If your breakpoint is not triggered when the app hit that line that means that most probably the gdbserver that Eclipse is using is not from DS-5 version. This is what you have to do. Go to Help &#8211;&gt; ARM Extras</p>
<p><a href="/wp-content/uploads/2011/12/image121.png"><img src="/wp-content/uploads/2011/12/image121.png" alt="" /></a></p>
<p>It will open up a folder that contains the gator and gdbserver directories.</p>
<p><a href="/wp-content/uploads/2011/12/image123.png"><img src="/wp-content/uploads/2011/12/image123.png" alt="" /></a></p>
<p>Go to the gdbserver/android directory and copy the gdbserver-stat-7.1 file into your project folder, in my case it’s copied into the <em>C:\DS-5\android-ndk-r7-windows\samples\hello-neon\libs\armeabi</em> and <em>C:\DS-5\android-ndk-r7-windows\samples\hello-neon\libs\armeabi-v7a</em> directory. Once copied delete the old gdbserver and rename the copied file from gdbserver-stat-7.1 to gdbserver</p>
<p>Once this step is done you should be able to see your breakpoint hit.</p>
<p><a href="/wp-content/uploads/2011/12/image125.png"><img src="/wp-content/uploads/2011/12/image125.png" alt="" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>Update 2/March/2012:</strong> Added the following video uploaded by ARM</p>
<p>http://www.youtube.com/watch?feature=player_detailpage&#038;v=xfoezJgw7wA</p>
]]></content:encoded>
			<wfw:commentRss>http://kernel.ozandroid.info/?feed=rss2&#038;p=83</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Checking Out Android Source Code</title>
		<link>http://kernel.ozandroid.info/?p=10</link>
		<comments>http://kernel.ozandroid.info/?p=10#comments</comments>
		<pubDate>Wed, 19 Oct 2011 11:11:14 +0000</pubDate>
		<dc:creator>nanik</dc:creator>
				<category><![CDATA[Framework]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[cyanogenmod]]></category>
		<category><![CDATA[github]]></category>

		<guid isPermaLink="false">http://kernel.ozandroid.info/?p=10</guid>
		<description><![CDATA[We all know that android.git.kernel.org is down and there are no definite timeline as when it will up and for those of us who would like to play around with Android source code are having difficult times in finding the source. Fear not, the CyanogeMod community have got their own repository which host the complete [...]]]></description>
				<content:encoded><![CDATA[<p>We all know that android.git.kernel.org is down and there are no definite timeline as when it will up and for those of us who would like to play around with Android source code are having difficult times in finding the source. Fear not, the CyanogeMod community have got their own repository which host the complete Android source code. The following screencast will walk you through the steps on how to check out the source from CyanogenMod github.com repo</p>
<p><script type='text/javascript' src='http://kernel.ozandroid.info/wp-content/plugins/hana-flv-player/flowplayer3/example/flowplayer-3.2.6.min.js'></script>
<div >
<div id='hana_flv_flow3_1' style='display:block;width:600px;height:480px;background-color:#555555;color:#ffffff;padding:0' title=""></div>
</div>

<script  type='text/javascript'>
if (typeof g_hanaFlash !== 'undefined' && !g_hanaFlash){
    jQuery('#hana_flv_flow3_1').css( 'padding', '5px' );
	jQuery('#hana_flv_flow3_1').html("<span class='inactive_message' style='display:block'>Sorry, your browser does not support Flash Video Player</span> ");
}else{			
		flowplayer('hana_flv_flow3_1', { src: 'http://kernel.ozandroid.info/wp-content/plugins/hana-flv-player/flowplayer3/flowplayer-3.2.7.swf', wmode: 'transparent' }, { 

			canvas: { backgroundColor: '#000000', backgroundGradient: 'none',},
    		clip:  { 
    			url: '/wp-content/uploads/videos/CyanogenMod_Repo.flv',
        		scaling: 'scale', autoPlay: false, autoBuffering: true 
				   , onFinish : function () { this.seek(0); }  

	        }

		});
}
</script></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://kernel.ozandroid.info/?feed=rss2&#038;p=10</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
