Leveraging Android’s Linux Heritage at Android Open 2011

The first Android Open Conference took place about 10 days ago. Karim Yaghmour of OperSys published the presentation slides he used during his Android presentations. See Leveraging Android’s Linux Heritage presentation slides below which explain how to use existing Linux application in Android. Those 15 slides cover the following: Goal Rationale Stack Comparison Roadblocks Where do I start? Coexistence Approaches Unresolved / Uncharted Demo You can also check out the Embedded Android Workshop presentation. Jean-Luc Aufranc (CNXSoft)Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011. www.cnx-software.com

Raspberry Pi Emulator in Ubuntu with Qemu

The Raspberry Pi board is a low cost board based on Broadcom BCM2835 media processor SoC with an ARM1176JZF-S core clocked at 700MHz. This board is currently under development and should be ready by end of November, beginning of December and will be sold for 25 USD (128MB RAM – no Ethernet) and 35 USD (256MB RAM – Ethernet). While we are waiting for the board, we can still test software using qemu to emulate a board based on an ARM1176 core with 128MB or 256 MB memory. I’ve tried to create a rootfs based on Ubuntu with rootstock but this only support processors with ARM cortex A8 and greater, so it would not work with ARM11. I’ll be using Debian Squeeze instead. Prerequisites My host computer is running Ubuntu 10.04.3 LTS, but any recent Ubuntu or Debian installation should work with these instructions. [Update: You won’t be able to […]

LLVM (Low Level Virtual Machine) Compiler Infrastructure

The Low Level Virtual Machine (LLVM) is a compiler and toolchain infrastructure, written in C++, designed for compile-time, link-time, run-time, and “idle-time” optimization of programs written in arbitrary programming languages. Originally implemented for C/C++, LLVM is now used with a variety programming languages such as Python, Ruby and may others. Code in the LLVM project is licensed under the “UIUC” BSD-Style license. LLVM can be used to replace and/or supplement the GNU tools such as gcc, g++, gdb, etc… LLVM now consists of a number of different sub-projects including: The LLVM Core libraries provide a source- and target-independent optimizer, along with code generation support for many popular CPUs. These libraries are built around a well specified code representation known as the LLVM intermediate representation (“LLVM IR”). The LLVM Core libraries are well documented, and it is particularly easy to invent your own language (or port an existing compiler) to use […]

Finding the package that contains a particular file in Ubuntu

It often happens that a file is missing during compilation and you get this kind of error: In file included from media/audio/linux/audio_manager_linux.cc:15:0: ./media/audio/linux/alsa_input.h:8:28: fatal error: alsa/asoundlib.h: No such file or directory compilation terminated. In file included from media/audio/linux/alsa_input.cc:5:0: ./media/audio/linux/alsa_input.h:8:28: fatal error: alsa/asoundlib.h: No such file or directory compilation terminated. That usually means a development package is missing. Sometime you can just guess the name of the package or you can use aptitude to find the file. There is also another (better) method in Ubuntu: apt-file utility allows you to find the package corresponding to a particular file. First install apt-file sudo apt-get install apt-file Them the first time, you need to download the files with the data for your system apt-file update Finally, you can use apt-file to find the package. For example with alsa/asoundlib.h apt-file search alsa/asoundlib.h libasound2-dev: /usr/include/alsa/asoundlib.h   Jean-Luc Aufranc (CNXSoft)Jean-Luc started CNX Software in 2010 as […]

Get CFLAGS for a Package with pkg-config

As I tried to cross-compile an application that required glibconfig.h, I found a way to retrieve the CFLAGS for a given package. Here’s the output for glib-2.0 and gtk-2.0 in qemu for overo: pkg-config –cflags glib-2.0 -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabi/glib-2.0/include pkg-config –cflags gdk-2.0 -pthread -I/usr/include/gio-unix-2.0/ -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabi/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pixman-1 Finally, I found out that glibconfig,h was in /usr/lib/arm-linux-gnueabi/glib-2.0/include as this file is generated by configure and is platform dependent. Jean-Luc Aufranc (CNXSoft)Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011. www.cnx-software.com

Finding a Missing Package in Ubuntu with Aptitude

When you configure a program before building, it will usually check for dependencies and if one is missing it will return an error such as: checking for OPENSSL… configure: error: Package requirements (openssl) were not met: No package ‘openssl’ found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. It could be a PATH issue, but usually that simply means the development version of the library is not installed. Sometimes the name is easy to guess and can be installed with apt-get: sudo apt-get install packagename-devel But sometimes it’s more difficult to guess and Google is not always very helpful. In that case you can use aptitude to search for the package. For example for nss3: sudo aptitude search nss3 i   libnss3                         – Network Security Service libraries i   libnss3-1d                   – Network Security Service libraries p   libnss3-dbg                – Development files for the Network Security p   libnss3-dev                […]

Dropbear: Lightweight SSH Server / Client

You may need to remotely access your embedded device, or your embedded systems is simply headless. You could use telnet, but this is insecure. A secure way to access a device remotly is to use SSH protocol. OpenSSH is one implementation but this is relatively too large and may use uncesary space on a device with limited storage. That’s where Dropbear comes into play. Dropbear is a lightweight implementation of an SSH client and server and is ideal for embedded systems. Dropbear ARM executable is only 200 KB. Here’s how it’s described on its website: Dropbear is a relatively small SSH 2 server and client. It runs on a variety of POSIX-based platforms. Dropbear is open source software, distributed under a MIT-style license. Dropbear is particularly useful for “embedded”-type Linux (or other Unix) systems, such as wireless routers. The main features of dropbear: A small memory footprint suitable for memory-constrained […]

Cross-comping zlib for ARM target

Zlib is defind as “A Massively Spiffy Yet Delicately Unobtrusive Compression Library” and used in many projects requiring compression. Here are the instructions cross-compile zlib for ARM: Download zlib1.25 wget http://cdnetworks-kr-2.dl.sourceforge.net/project/libpng/zlib/1.2.5/zlib-1.2.5.tar.gz Extract it tar xzvf zlib-1.2.5.tar.gz cd zlib-1.2.5 Configure, build and install zlib. CC=armv5tel-redhat-linux-gnueabi-gcc ./configure –prefix=/home/jaufranc/edev/rootfs make make install This will install libz.a (static library) and libz.so (dynamic library) in /home/jaufranc/edev/rootfs/lib and copy the header files to /home/jaufranc/edev/rootfs/include. Jean-Luc Aufranc (CNXSoft)Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011. www.cnx-software.com