SlideShare a Scribd company logo
1 of 40
Download to read offline
1
Leveraging Android's
Linux Heritage
AnDevCon 2013
Karim Yaghmour
@karimyaghmour
2
These slides are made available to you under a Creative Commons
Share-Alike 3.0 license. The full terms of this license are here:
https://creativecommons.org/licenses/by-sa/3.0/
Attribution requirements and misc., PLEASE READ:
● This slide must remain as-is in this specific location (slide #2),
everything else you are free to change; including the logo :-)
●
Use of figures in other documents must feature the below
“Originals at” URL immediately under that figure and the below
copyright notice where appropriate.
●
You are free to fill in the “Delivered and/or customized by” space
on the right as you see fit.
● You are FORBIDEN from using the default “About” slide as-is or
any of its contents.
(C) Copyright 2010-2013, Opersys inc.
These slides created by: Karim Yaghmour
Originals at: www.opersys.com/community/docs
Delivered and/or customized by
3
About
● Author of:
● Introduced Linux Trace Toolkit in 1999
● Originated Adeos and relayfs (kernel/relay.c)
● Training, Custom Dev, Consulting, ...
4
“Android took GNU out the back door,
shot him in the head, and
ran away with the penguin”
-- Surely from Tarantino's next flick
5
Agenda
● Goal
● Rationale
● Stack Comparison
● Roadblocks
● Where do I start?
● Coexistence Approaches
● Unresolved / Uncharted
● Demo
6
1. Goal
● Opening as many cans of worms as possible
● Can “Linux” and Android Coexist and Interact?
7
2. Rationale
● A ton of mature user-space packages available
● Linux has been around for 20 years
● Linux's user-space has been developed in the open
● A ton of “Linux”-centric stacks have been developed
through the years
● “Porting” to Android not always possible/desirable/realistic
● Android doesn't provide everything
● Touch-based, consumer-oriented
● Linux is very strong on backend/server side
● Android exhibits symptoms of “my way or the highway”
design
8
3. Stack Comparison
● Overall Architecture EL
● Overall Architecture Android
9
10
3.3. Overall Architecture – Android
11
4. Roadblocks
● Filesystem
● Android is non-FHS-compliant
● C library
● Bionic vs. glibc
● Interconnect fabric
● Intents vs. DBUS
● IPC
● Binder vs. Sockets and other std Unix IPC
● Display management
● SurfaceFlinger vs. X
● I/O
● Framebuffer, keyboard, mouse, disk, ...
12
5. Where do I start?
● Android-side:
● AOSP
● “Linux”-side:
● Traditional distro
– Ubuntu, Fedora, Debian, Gentoo, ...
● Embedded distro
– Yocto, Buildroot, LTIB, ...
● Build Your Own
● Cherry-picking
13
6. Coexistence Approaches
● Single filesystem
● Build system integration
● Build-time aggregation
● Image repackaging
● chroot jails
● Have a look at AlwaysInnovating Gregoire Gentil's ELC presentation
● Patching to lots of pieces of the OS
● Use of one FB for each OS or chvt
● Virtualization / Paravirtualization
● QEMU
● XEN?
14
15
7. Been there done that
● BusyBox in CyanogenMod
● Gstreamer vs. Stagefright
● UML Android
● Don't know how they do it:
● Alien Dalvik: Android on Meego
● ...
16
8. Unresolved / Uncharted
● Binder from glibc
● Intent <-> DBUS bridge
● Running Android apps in X
● Running X apps in Android
“The easier thing to do, which would work on just about all Android phones
without having to modify the system software at all, would be to port an X
server to the NDK, using a SurfaceFlinger Surface as its root window.
You could do a generic "X11WrapperApp" that has you XSurfaceFlinger
bundled and launches whatever X based app you want, and have it all play
nice together.
A bit more work would be to just do an implementation of xlib that sits on top of
a native Android window (opengl ES 2 if you like) without any server in the
middle, and again bundle this and the X based app of your choice and you
have something that is a first class app on the phone without any need for
modifying the OS.”
17
9. Tools
● GNU cross-development toolchain:
● gcc - compiler
● as - assembler
● ld - linker
● gdb/gdbserver - debugger
● etc.
● C library: uClibc, eglibc or glibc
18
10. Embedded Linux Workspace
● Need to organize the components used during
cross-platform development. Workspace layout:
bootldr: target bootloader (s)
build-tools: toolchain build packages and sources
debug: debugging tools
doc: project documentation
images: binary images ready to be used on target
kernel: sources and build directories for target kernels
project: your own custom code for the target
rootfs: root filesystem as seen on the target
sysapps: sources for target's system applications
tmp: temporary data and experiments
tools: toolchain and all other tools required to build
software for the target.
19
10.1. Workspace env. vars. script
● Complete workspace script (devex)
export PROJECT=emblinux
export PRJROOT=/home/karim/${PROJECT}
export TARGET=arm-none-linux-gnueabi
export PATH=${PATH}:[CODESOURCERY_DIR]/bin
cd $PRJROOT
● To use this script:
$ .⌴devex
● Possible values for $TARGET:
● ARM: arm-linux, arm-unknown-linux-gnueabi
● MIPS: mips-linux, mipsel-unknown-linux-gnu
● I386: i386-linux, i586-geode-linux-uclibc
20
11. Basic root filesystem structure
● Unix FS structured for multi-user systems
● Some directories not necessary for embedded
● Filesystem Hierarchy Standard (FHS):
● /bin => Essential user binaries
● /boot => Bootloader and kernel images
● /dev => Device files
● /etc => System configuration
● /home => User home directories
● /lib => Essential shared libs and kernel modules
● /mnt => Temporary mount point
● /opt => Add-on software packages
● /sbin => Essential system binaries
● /tmp => Temporary files
● /usr => Secondary hierarchy (mostly user apps)
● /var => Variable data generated by daemons
21
● Non-essential multi-user dirs:
● /home, /mnt, /opt, /root
● Depends on bootloader:
● /boot
● Traditionally “essential”:
● /bin, /dev, /etc, /lib, /proc, /sbin, /usr, /tmp, /var
● Careful with “/etc”, Android needs it to point to
“/system/etc” for Dbus config ... Just hack it.
● Contain their own hierarchy:
● /usr, /var
22
● What are all these binaries directories for?
● /bin => Essential binaries for user and admin
● /sbin => Essential binaries for admin
● /usr/bin => Non-essential user and admin binaries
● /usr/sbin=> Non-essential admin binaries
● What are all those libraries directories for?
● /lib => Essential system libraries
● /usr/lib => Non-essential libraries
● The kernel does not force FS layout. Layout is
“universally” agree upon (i.e. FHS.)
23
● To start working on rootfs:
$ cd ${PRJROOT}/rootfs
● Create core rootfs directories:
$ mkdir bin lib sbin usr var
● Create the /usr hierarchy:
$ mkdir usr/{bin,lib,sbin}
● Create the /var hierarchy:
$ mkdir var/{lib,lock,log,run,tmp}
$ chmod 1777 var/tmp
24
12. Libraries
1.glibc
2.uClibc
25
12.1. glibc
● glibc components:
● Actual shared libraries:
– Format: libLIB_NAME-GLIBC_VER.so
– Examples: libm-2.3.2.so, libc-2.3.2.so
● Major revision version symbolic links:
– Format: libLIB_NAME.so.MAJOR_REV_VER
– Examples: libdl.so.2, libc.so.6
● Version-independent symbolic links to the major
revision version symbolic links:
– Format: libLIB_NAME.so
– Examples: libdl.so, libm.so
● Static library archives:
– Format: libLIB_NAME.a
– Examples: libdl.a, libm.a
26
● For target, need:
● The actual shared libs
● The major revision version symbolic links
● Also need dynamic linker:
● Actual linker: ld-GLIBC_VER.so
● Symbolic link to linker:
– x86, ARM, SH, m68k => ld-linux.so.MAJOR_REV_VER
– MIPS, PPC => ld.so.MAJOR_REV_VER
● Must determine exact library components required.
● BELS table 6.2 contains complete list
27
● Most important components:
● ld => the dynamic linker
● libc => the C library
● libm => the math library
● libdl => the shared objects manipulation library
● Must determine exact dependencies of your
applications.
● Native ldd is not cross-platform-capable
● Can use readelf or uclibc-ldd:
28
● Copying all libraries:
$ cp -d [CODESOURCERY_DIR]/arm-none-linux-gnueabi/libc/lib/* 
> ${PRJROOT}/rootfs/lib
● Stripping all target libraries for space efficiency:
$ arm-none-linux-gnueabi-strip ${PRJROOT}/rootfs/lib/*.so*
29
12.2. uClibc
● Same naming conventions as glibc
● Implements most of the glibc components:
● ld, libc, libcrypt, libdl, libm, libpthread, libresolv, libutil.
● uClibc libraries can coexist with glibc libraries in
target's /lib directory.
● Copying all uClibc components:
$ cd ${PREFIX}/uclibc/lib
$ cp *-*.so ${PRJROOT}/rootfs/lib
$ cp -d *.so.[*0-9] ${PRJROOT}/rootfs/lib
● No need to strip uClibc libraries, they are stripped
by the uClibc build script
30
13. Main system applications
● Unix systems rely on a common set of commands
● Standard distros have one binary per command
● May compile each relevant command one-by-one
or use packages that provide many commands in
a single binary:
1.Busybox
2.Distro
31
13.1. BusyBox
● Main package used in embedded Linux to provide
core set of Unix commands: busybox.net
[, [[, acpid, add-shell, addgroup, adduser, adjtimex, arp, arping, ash, awk, base64, basename, beep, blkid, blockdev,
bootchartd, brctl, bunzip2, bzcat, bzip2, cal, cat, catv, chat, chattr, chgrp, chmod, chown, chpasswd, chpst, chroot, chrt,
chvt, cksum, clear, cmp, comm, cp, cpio, crond, crontab, cryptpw, cttyhack, cut, date, dc, dd, deallocvt, delgroup, deluser,
depmod, devmem, df, dhcprelay, diff, dirname, dmesg, dnsd, dnsdomainname, dos2unix, du, dumpkmap, dumpleases,
echo, ed, egrep, eject, env, envdir, envuidgid, ether-wake, expand, expr, fakeidentd, false, fbset, fbsplash, fdflush, fdformat,
fdisk, fgconsole, fgrep, find, findfs, flock, fold, free, freeramdisk, fsck, fsck.minix, fsync, ftpd, ftpget, ftpput, fuser, getopt,
getty, grep, gunzip, gzip, halt, hd, hdparm, head, hexdump, hostid, hostname, httpd, hush, hwclock, id, ifconfig, ifdown,
ifenslave, ifplugd, ifup, inetd, init, insmod, install, ionice, iostat, ip, ipaddr, ipcalc, ipcrm, ipcs, iplink, iproute, iprule, iptunnel,
kbd_mode, kill, killall, killall5, klogd, last, length, less, linux32, linux64, linuxrc, ln, loadfont, loadkmap, logger, login,
logname, logread, losetup, lpd, lpq, lpr, ls, lsattr, lsmod, lspci, lsusb, lzcat, lzma, lzop, lzopcat, makedevs, makemime, man,
md5sum, mdev, mesg, microcom, mkdir, mkdosfs, mke2fs, mkfifo, mkfs.ext2, mkfs.minix, mkfs.vfat, mknod, mkpasswd,
mkswap, mktemp, modinfo, modprobe, more, mount, mountpoint, mpstat, mt, mv, nameif, nbd-client, nc, netstat, nice,
nmeter, nohup, nslookup, ntpd, od, openvt, passwd, patch, pgrep, pidof, ping, ping6, pipe_progress, pivot_root, pkill, pmap,
popmaildir, poweroff, powertop, printenv, printf, ps, pscan, pwd, raidautorun, rdate, rdev, readahead, readlink, readprofile,
realpath, reboot, reformime, remove-shell, renice, reset, resize, rev, rm, rmdir, rmmod, route, rpm, rpm2cpio, rtcwake, run-
parts, runlevel, runsv, runsvdir, rx, script, scriptreplay, sed, sendmail, seq, setarch, setconsole, setfont, setkeycodes,
setlogcons, setsid, setuidgid, sh, sha1sum, sha256sum, sha512sum, showkey, slattach, sleep, smemcap, softlimit, sort,
split, start-stop-daemon, stat, strings, stty, su, sulogin, sum, sv, svlogd, swapoff, swapon, switch_root, sync, sysctl, syslogd,
tac, tail, tar, tcpsvd, tee, telnet, telnetd, test, tftp, tftpd, time, timeout, top, touch, tr, traceroute, traceroute6, true, tty, ttysize,
tunctl, udhcpc, udhcpd, udpsvd, umount, uname, unexpand, uniq, unix2dos, unlzma, unlzop, unxz, unzip, uptime, usleep,
uudecode, uuencode, vconfig, vi, vlock, volname, wall, watch, watchdog, wc, wget, which, who, whoami, xargs, xz, xzcat,
yes, zcat, zcip
32
● Download BusyBox (1.18.3) to your $
{PRJROOT}/sysapps directory and extract it there.
● Move to the directory for the rest of the setup:
$ cd ${PRJROOT}/sysapps/busybox-1.18.3
● Configuration of BusyBox's options:
$ make menuconfig
33
34
● “Busybox Settings”:
● “Build Options” -> Cross-compiler prefix:
${TARGET}-
● “Installation Options” -> Installation prefix:
${PRJROOT}/rootfs
● Build:
$ make
● Install:
$ make install
35
14. Demos
● Demo 1 and 2:
● AOSP
● BYO glibc-based rootfs
● Demo 1: BusyBox
● Demo 2: Client-Server app talking through socket
● glibc client
● bionic server
● Demo 3: Buildroot integration
● Demo 4: systrace/atrace/ftrace
36
14.1. Demo 1 - BusyBox
● Configure, build and “install” BusyBox
● Get it copied into final RAM disk image
● Modify AOSP to:
● Make sure /lib/* is executable
● Path start with “/bin”
● adb shell is BusyBox, not Toolbox
37
14.2. Demo 2 - Architecture
38
14.3. Demo 3 - Buildroot integration
39
14.4. Demo 4 – systrace / atrace /
ftrace
● ftrace is built into the kernel
● Use systrace/atrace to collect data
● Use Chrome browser to view data
40
Thank you ...
karim.yaghmour@opersys.com

More Related Content

What's hot

Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in AndroidOpersys inc.
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in AndroidOpersys inc.
 
Android Jumpstart ESC SV 2012 Part I
Android Jumpstart ESC SV 2012 Part IAndroid Jumpstart ESC SV 2012 Part I
Android Jumpstart ESC SV 2012 Part IOpersys inc.
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowOpersys inc.
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android WorkshopOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Opersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Headless Android at AnDevCon3
Headless Android at AnDevCon3Headless Android at AnDevCon3
Headless Android at AnDevCon3Opersys inc.
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things InternalsOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentKarim Yaghmour
 
Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013Opersys inc.
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave InternalsOpersys inc.
 
Inside Android's UI at AnDevCon IV
Inside Android's UI at AnDevCon IVInside Android's UI at AnDevCon IV
Inside Android's UI at AnDevCon IVOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in AndroidOpersys inc.
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in AndroidOpersys inc.
 

What's hot (20)

Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 
Android Jumpstart ESC SV 2012 Part I
Android Jumpstart ESC SV 2012 Part IAndroid Jumpstart ESC SV 2012 Part I
Android Jumpstart ESC SV 2012 Part I
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Headless Android at AnDevCon3
Headless Android at AnDevCon3Headless Android at AnDevCon3
Headless Android at AnDevCon3
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things Internals
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave Internals
 
Inside Android's UI at AnDevCon IV
Inside Android's UI at AnDevCon IVInside Android's UI at AnDevCon IV
Inside Android's UI at AnDevCon IV
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
 

Viewers also liked

Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System ServerOpersys inc.
 
Android Microconf at Linux Plumber 2012
Android Microconf at Linux Plumber 2012Android Microconf at Linux Plumber 2012
Android Microconf at Linux Plumber 2012Opersys inc.
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android WorkshopOpersys inc.
 
Android Platform Debugging and Development at ABS 2014
Android Platform Debugging and Development at ABS 2014Android Platform Debugging and Development at ABS 2014
Android Platform Debugging and Development at ABS 2014Opersys inc.
 
Is Android the New King of Embedded OSes at Embedded World 2014
Is Android the New King of Embedded OSes at Embedded World 2014Is Android the New King of Embedded OSes at Embedded World 2014
Is Android the New King of Embedded OSes at Embedded World 2014Opersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in AndroidOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in AndroidOpersys inc.
 
Android Storage - Internal and External Storages
Android Storage - Internal and External StoragesAndroid Storage - Internal and External Storages
Android Storage - Internal and External StoragesWilliam Lee
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in AndroidOpersys inc.
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with NougatOpersys inc.
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things InternalsOpersys inc.
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with NougatOpersys inc.
 
Android Things: Android for IoT
Android Things: Android for IoTAndroid Things: Android for IoT
Android Things: Android for IoTOpersys inc.
 
Android Variants, Hacks, Tricks and Resources
Android Variants, Hacks, Tricks and ResourcesAndroid Variants, Hacks, Tricks and Resources
Android Variants, Hacks, Tricks and ResourcesOpersys inc.
 

Viewers also liked (19)

Porting Android
Porting AndroidPorting Android
Porting Android
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System Server
 
Android Microconf at Linux Plumber 2012
Android Microconf at Linux Plumber 2012Android Microconf at Linux Plumber 2012
Android Microconf at Linux Plumber 2012
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
 
Android Platform Debugging and Development at ABS 2014
Android Platform Debugging and Development at ABS 2014Android Platform Debugging and Development at ABS 2014
Android Platform Debugging and Development at ABS 2014
 
Is Android the New King of Embedded OSes at Embedded World 2014
Is Android the New King of Embedded OSes at Embedded World 2014Is Android the New King of Embedded OSes at Embedded World 2014
Is Android the New King of Embedded OSes at Embedded World 2014
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Project Ara
Project AraProject Ara
Project Ara
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 
Android Storage - Internal and External Storages
Android Storage - Internal and External StoragesAndroid Storage - Internal and External Storages
Android Storage - Internal and External Storages
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with Nougat
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things Internals
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with Nougat
 
Android Things: Android for IoT
Android Things: Android for IoTAndroid Things: Android for IoT
Android Things: Android for IoT
 
Android Variants, Hacks, Tricks and Resources
Android Variants, Hacks, Tricks and ResourcesAndroid Variants, Hacks, Tricks and Resources
Android Variants, Hacks, Tricks and Resources
 

Similar to Leveraging Android's Linux Heritage at AnDevCon VI

Leveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVLeveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVOpersys inc.
 
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConIIAndroid Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConIIOpersys inc.
 
Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Opersys inc.
 
Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012Opersys inc.
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux DevelopersOpersys inc.
 
Is Android the New Embedded Linux? at AnDevCon V
Is Android the New Embedded Linux? at AnDevCon VIs Android the New Embedded Linux? at AnDevCon V
Is Android the New Embedded Linux? at AnDevCon VOpersys inc.
 
Is Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VIIs Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VIOpersys inc.
 
Leveraging Android's Linux Heritage
Leveraging Android's Linux HeritageLeveraging Android's Linux Heritage
Leveraging Android's Linux HeritageOpersys inc.
 
embedded-linux-120203.pdf
embedded-linux-120203.pdfembedded-linux-120203.pdf
embedded-linux-120203.pdftwtester
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave InternalsOpersys inc.
 
Android on Intel Architecture: ROM Cooking Tutorial
Android on Intel Architecture: ROM Cooking TutorialAndroid on Intel Architecture: ROM Cooking Tutorial
Android on Intel Architecture: ROM Cooking TutorialRon Munitz
 
Extending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteExtending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteOpersys inc.
 
OVERVIEW: Chromium Source Tree
OVERVIEW: Chromium Source TreeOVERVIEW: Chromium Source Tree
OVERVIEW: Chromium Source TreeChang W. Doh
 
Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011Opersys inc.
 
Crafting GNU/ linux distributions for embedded target using Builroot
Crafting GNU/ linux distributions for embedded target using BuilrootCrafting GNU/ linux distributions for embedded target using Builroot
Crafting GNU/ linux distributions for embedded target using BuilrootSourabh Singh Tomar
 
Embedded Android Workshop part I ESC SV 2012
Embedded Android Workshop part I ESC SV 2012Embedded Android Workshop part I ESC SV 2012
Embedded Android Workshop part I ESC SV 2012Opersys inc.
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'acorehard_by
 
Inside Android's UI
Inside Android's UIInside Android's UI
Inside Android's UIOpersys inc.
 

Similar to Leveraging Android's Linux Heritage at AnDevCon VI (20)

Leveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVLeveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IV
 
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConIIAndroid Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
 
Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3
 
Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
 
Is Android the New Embedded Linux? at AnDevCon V
Is Android the New Embedded Linux? at AnDevCon VIs Android the New Embedded Linux? at AnDevCon V
Is Android the New Embedded Linux? at AnDevCon V
 
Is Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VIIs Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VI
 
Leveraging Android's Linux Heritage
Leveraging Android's Linux HeritageLeveraging Android's Linux Heritage
Leveraging Android's Linux Heritage
 
embedded-linux-120203.pdf
embedded-linux-120203.pdfembedded-linux-120203.pdf
embedded-linux-120203.pdf
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave Internals
 
Android on Intel Architecture: ROM Cooking Tutorial
Android on Intel Architecture: ROM Cooking TutorialAndroid on Intel Architecture: ROM Cooking Tutorial
Android on Intel Architecture: ROM Cooking Tutorial
 
Headless Android
Headless AndroidHeadless Android
Headless Android
 
Android Platform Debugging & Development
Android Platform Debugging & Development Android Platform Debugging & Development
Android Platform Debugging & Development
 
Extending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteExtending Android's Platform Toolsuite
Extending Android's Platform Toolsuite
 
OVERVIEW: Chromium Source Tree
OVERVIEW: Chromium Source TreeOVERVIEW: Chromium Source Tree
OVERVIEW: Chromium Source Tree
 
Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011
 
Crafting GNU/ linux distributions for embedded target using Builroot
Crafting GNU/ linux distributions for embedded target using BuilrootCrafting GNU/ linux distributions for embedded target using Builroot
Crafting GNU/ linux distributions for embedded target using Builroot
 
Embedded Android Workshop part I ESC SV 2012
Embedded Android Workshop part I ESC SV 2012Embedded Android Workshop part I ESC SV 2012
Embedded Android Workshop part I ESC SV 2012
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'a
 
Inside Android's UI
Inside Android's UIInside Android's UI
Inside Android's UI
 

More from Opersys inc.

Android Automotive
Android AutomotiveAndroid Automotive
Android AutomotiveOpersys inc.
 
Android 10 Internals Update
Android 10 Internals UpdateAndroid 10 Internals Update
Android 10 Internals UpdateOpersys inc.
 
Embedded Android Workshop with Pie
Embedded Android Workshop with PieEmbedded Android Workshop with Pie
Embedded Android Workshop with PieOpersys inc.
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALOpersys inc.
 
Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Opersys inc.
 
Embedded Android Workshop with Oreo
Embedded Android Workshop with OreoEmbedded Android Workshop with Oreo
Embedded Android Workshop with OreoOpersys inc.
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with NougatOpersys inc.
 
Brillo/Weave Internals
Brillo/Weave InternalsBrillo/Weave Internals
Brillo/Weave InternalsOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowOpersys inc.
 

More from Opersys inc. (11)

Android Automotive
Android AutomotiveAndroid Automotive
Android Automotive
 
Android 10 Internals Update
Android 10 Internals UpdateAndroid 10 Internals Update
Android 10 Internals Update
 
Embedded Android Workshop with Pie
Embedded Android Workshop with PieEmbedded Android Workshop with Pie
Embedded Android Workshop with Pie
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HAL
 
Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?
 
Embedded Android Workshop with Oreo
Embedded Android Workshop with OreoEmbedded Android Workshop with Oreo
Embedded Android Workshop with Oreo
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with Nougat
 
Brillo/Weave Internals
Brillo/Weave InternalsBrillo/Weave Internals
Brillo/Weave Internals
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
 
Project Ara
Project AraProject Ara
Project Ara
 

Recently uploaded

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Recently uploaded (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Leveraging Android's Linux Heritage at AnDevCon VI

  • 1. 1 Leveraging Android's Linux Heritage AnDevCon 2013 Karim Yaghmour @karimyaghmour
  • 2. 2 These slides are made available to you under a Creative Commons Share-Alike 3.0 license. The full terms of this license are here: https://creativecommons.org/licenses/by-sa/3.0/ Attribution requirements and misc., PLEASE READ: ● This slide must remain as-is in this specific location (slide #2), everything else you are free to change; including the logo :-) ● Use of figures in other documents must feature the below “Originals at” URL immediately under that figure and the below copyright notice where appropriate. ● You are free to fill in the “Delivered and/or customized by” space on the right as you see fit. ● You are FORBIDEN from using the default “About” slide as-is or any of its contents. (C) Copyright 2010-2013, Opersys inc. These slides created by: Karim Yaghmour Originals at: www.opersys.com/community/docs Delivered and/or customized by
  • 3. 3 About ● Author of: ● Introduced Linux Trace Toolkit in 1999 ● Originated Adeos and relayfs (kernel/relay.c) ● Training, Custom Dev, Consulting, ...
  • 4. 4 “Android took GNU out the back door, shot him in the head, and ran away with the penguin” -- Surely from Tarantino's next flick
  • 5. 5 Agenda ● Goal ● Rationale ● Stack Comparison ● Roadblocks ● Where do I start? ● Coexistence Approaches ● Unresolved / Uncharted ● Demo
  • 6. 6 1. Goal ● Opening as many cans of worms as possible ● Can “Linux” and Android Coexist and Interact?
  • 7. 7 2. Rationale ● A ton of mature user-space packages available ● Linux has been around for 20 years ● Linux's user-space has been developed in the open ● A ton of “Linux”-centric stacks have been developed through the years ● “Porting” to Android not always possible/desirable/realistic ● Android doesn't provide everything ● Touch-based, consumer-oriented ● Linux is very strong on backend/server side ● Android exhibits symptoms of “my way or the highway” design
  • 8. 8 3. Stack Comparison ● Overall Architecture EL ● Overall Architecture Android
  • 9. 9
  • 11. 11 4. Roadblocks ● Filesystem ● Android is non-FHS-compliant ● C library ● Bionic vs. glibc ● Interconnect fabric ● Intents vs. DBUS ● IPC ● Binder vs. Sockets and other std Unix IPC ● Display management ● SurfaceFlinger vs. X ● I/O ● Framebuffer, keyboard, mouse, disk, ...
  • 12. 12 5. Where do I start? ● Android-side: ● AOSP ● “Linux”-side: ● Traditional distro – Ubuntu, Fedora, Debian, Gentoo, ... ● Embedded distro – Yocto, Buildroot, LTIB, ... ● Build Your Own ● Cherry-picking
  • 13. 13 6. Coexistence Approaches ● Single filesystem ● Build system integration ● Build-time aggregation ● Image repackaging ● chroot jails ● Have a look at AlwaysInnovating Gregoire Gentil's ELC presentation ● Patching to lots of pieces of the OS ● Use of one FB for each OS or chvt ● Virtualization / Paravirtualization ● QEMU ● XEN?
  • 14. 14
  • 15. 15 7. Been there done that ● BusyBox in CyanogenMod ● Gstreamer vs. Stagefright ● UML Android ● Don't know how they do it: ● Alien Dalvik: Android on Meego ● ...
  • 16. 16 8. Unresolved / Uncharted ● Binder from glibc ● Intent <-> DBUS bridge ● Running Android apps in X ● Running X apps in Android “The easier thing to do, which would work on just about all Android phones without having to modify the system software at all, would be to port an X server to the NDK, using a SurfaceFlinger Surface as its root window. You could do a generic "X11WrapperApp" that has you XSurfaceFlinger bundled and launches whatever X based app you want, and have it all play nice together. A bit more work would be to just do an implementation of xlib that sits on top of a native Android window (opengl ES 2 if you like) without any server in the middle, and again bundle this and the X based app of your choice and you have something that is a first class app on the phone without any need for modifying the OS.”
  • 17. 17 9. Tools ● GNU cross-development toolchain: ● gcc - compiler ● as - assembler ● ld - linker ● gdb/gdbserver - debugger ● etc. ● C library: uClibc, eglibc or glibc
  • 18. 18 10. Embedded Linux Workspace ● Need to organize the components used during cross-platform development. Workspace layout: bootldr: target bootloader (s) build-tools: toolchain build packages and sources debug: debugging tools doc: project documentation images: binary images ready to be used on target kernel: sources and build directories for target kernels project: your own custom code for the target rootfs: root filesystem as seen on the target sysapps: sources for target's system applications tmp: temporary data and experiments tools: toolchain and all other tools required to build software for the target.
  • 19. 19 10.1. Workspace env. vars. script ● Complete workspace script (devex) export PROJECT=emblinux export PRJROOT=/home/karim/${PROJECT} export TARGET=arm-none-linux-gnueabi export PATH=${PATH}:[CODESOURCERY_DIR]/bin cd $PRJROOT ● To use this script: $ .⌴devex ● Possible values for $TARGET: ● ARM: arm-linux, arm-unknown-linux-gnueabi ● MIPS: mips-linux, mipsel-unknown-linux-gnu ● I386: i386-linux, i586-geode-linux-uclibc
  • 20. 20 11. Basic root filesystem structure ● Unix FS structured for multi-user systems ● Some directories not necessary for embedded ● Filesystem Hierarchy Standard (FHS): ● /bin => Essential user binaries ● /boot => Bootloader and kernel images ● /dev => Device files ● /etc => System configuration ● /home => User home directories ● /lib => Essential shared libs and kernel modules ● /mnt => Temporary mount point ● /opt => Add-on software packages ● /sbin => Essential system binaries ● /tmp => Temporary files ● /usr => Secondary hierarchy (mostly user apps) ● /var => Variable data generated by daemons
  • 21. 21 ● Non-essential multi-user dirs: ● /home, /mnt, /opt, /root ● Depends on bootloader: ● /boot ● Traditionally “essential”: ● /bin, /dev, /etc, /lib, /proc, /sbin, /usr, /tmp, /var ● Careful with “/etc”, Android needs it to point to “/system/etc” for Dbus config ... Just hack it. ● Contain their own hierarchy: ● /usr, /var
  • 22. 22 ● What are all these binaries directories for? ● /bin => Essential binaries for user and admin ● /sbin => Essential binaries for admin ● /usr/bin => Non-essential user and admin binaries ● /usr/sbin=> Non-essential admin binaries ● What are all those libraries directories for? ● /lib => Essential system libraries ● /usr/lib => Non-essential libraries ● The kernel does not force FS layout. Layout is “universally” agree upon (i.e. FHS.)
  • 23. 23 ● To start working on rootfs: $ cd ${PRJROOT}/rootfs ● Create core rootfs directories: $ mkdir bin lib sbin usr var ● Create the /usr hierarchy: $ mkdir usr/{bin,lib,sbin} ● Create the /var hierarchy: $ mkdir var/{lib,lock,log,run,tmp} $ chmod 1777 var/tmp
  • 25. 25 12.1. glibc ● glibc components: ● Actual shared libraries: – Format: libLIB_NAME-GLIBC_VER.so – Examples: libm-2.3.2.so, libc-2.3.2.so ● Major revision version symbolic links: – Format: libLIB_NAME.so.MAJOR_REV_VER – Examples: libdl.so.2, libc.so.6 ● Version-independent symbolic links to the major revision version symbolic links: – Format: libLIB_NAME.so – Examples: libdl.so, libm.so ● Static library archives: – Format: libLIB_NAME.a – Examples: libdl.a, libm.a
  • 26. 26 ● For target, need: ● The actual shared libs ● The major revision version symbolic links ● Also need dynamic linker: ● Actual linker: ld-GLIBC_VER.so ● Symbolic link to linker: – x86, ARM, SH, m68k => ld-linux.so.MAJOR_REV_VER – MIPS, PPC => ld.so.MAJOR_REV_VER ● Must determine exact library components required. ● BELS table 6.2 contains complete list
  • 27. 27 ● Most important components: ● ld => the dynamic linker ● libc => the C library ● libm => the math library ● libdl => the shared objects manipulation library ● Must determine exact dependencies of your applications. ● Native ldd is not cross-platform-capable ● Can use readelf or uclibc-ldd:
  • 28. 28 ● Copying all libraries: $ cp -d [CODESOURCERY_DIR]/arm-none-linux-gnueabi/libc/lib/* > ${PRJROOT}/rootfs/lib ● Stripping all target libraries for space efficiency: $ arm-none-linux-gnueabi-strip ${PRJROOT}/rootfs/lib/*.so*
  • 29. 29 12.2. uClibc ● Same naming conventions as glibc ● Implements most of the glibc components: ● ld, libc, libcrypt, libdl, libm, libpthread, libresolv, libutil. ● uClibc libraries can coexist with glibc libraries in target's /lib directory. ● Copying all uClibc components: $ cd ${PREFIX}/uclibc/lib $ cp *-*.so ${PRJROOT}/rootfs/lib $ cp -d *.so.[*0-9] ${PRJROOT}/rootfs/lib ● No need to strip uClibc libraries, they are stripped by the uClibc build script
  • 30. 30 13. Main system applications ● Unix systems rely on a common set of commands ● Standard distros have one binary per command ● May compile each relevant command one-by-one or use packages that provide many commands in a single binary: 1.Busybox 2.Distro
  • 31. 31 13.1. BusyBox ● Main package used in embedded Linux to provide core set of Unix commands: busybox.net [, [[, acpid, add-shell, addgroup, adduser, adjtimex, arp, arping, ash, awk, base64, basename, beep, blkid, blockdev, bootchartd, brctl, bunzip2, bzcat, bzip2, cal, cat, catv, chat, chattr, chgrp, chmod, chown, chpasswd, chpst, chroot, chrt, chvt, cksum, clear, cmp, comm, cp, cpio, crond, crontab, cryptpw, cttyhack, cut, date, dc, dd, deallocvt, delgroup, deluser, depmod, devmem, df, dhcprelay, diff, dirname, dmesg, dnsd, dnsdomainname, dos2unix, du, dumpkmap, dumpleases, echo, ed, egrep, eject, env, envdir, envuidgid, ether-wake, expand, expr, fakeidentd, false, fbset, fbsplash, fdflush, fdformat, fdisk, fgconsole, fgrep, find, findfs, flock, fold, free, freeramdisk, fsck, fsck.minix, fsync, ftpd, ftpget, ftpput, fuser, getopt, getty, grep, gunzip, gzip, halt, hd, hdparm, head, hexdump, hostid, hostname, httpd, hush, hwclock, id, ifconfig, ifdown, ifenslave, ifplugd, ifup, inetd, init, insmod, install, ionice, iostat, ip, ipaddr, ipcalc, ipcrm, ipcs, iplink, iproute, iprule, iptunnel, kbd_mode, kill, killall, killall5, klogd, last, length, less, linux32, linux64, linuxrc, ln, loadfont, loadkmap, logger, login, logname, logread, losetup, lpd, lpq, lpr, ls, lsattr, lsmod, lspci, lsusb, lzcat, lzma, lzop, lzopcat, makedevs, makemime, man, md5sum, mdev, mesg, microcom, mkdir, mkdosfs, mke2fs, mkfifo, mkfs.ext2, mkfs.minix, mkfs.vfat, mknod, mkpasswd, mkswap, mktemp, modinfo, modprobe, more, mount, mountpoint, mpstat, mt, mv, nameif, nbd-client, nc, netstat, nice, nmeter, nohup, nslookup, ntpd, od, openvt, passwd, patch, pgrep, pidof, ping, ping6, pipe_progress, pivot_root, pkill, pmap, popmaildir, poweroff, powertop, printenv, printf, ps, pscan, pwd, raidautorun, rdate, rdev, readahead, readlink, readprofile, realpath, reboot, reformime, remove-shell, renice, reset, resize, rev, rm, rmdir, rmmod, route, rpm, rpm2cpio, rtcwake, run- parts, runlevel, runsv, runsvdir, rx, script, scriptreplay, sed, sendmail, seq, setarch, setconsole, setfont, setkeycodes, setlogcons, setsid, setuidgid, sh, sha1sum, sha256sum, sha512sum, showkey, slattach, sleep, smemcap, softlimit, sort, split, start-stop-daemon, stat, strings, stty, su, sulogin, sum, sv, svlogd, swapoff, swapon, switch_root, sync, sysctl, syslogd, tac, tail, tar, tcpsvd, tee, telnet, telnetd, test, tftp, tftpd, time, timeout, top, touch, tr, traceroute, traceroute6, true, tty, ttysize, tunctl, udhcpc, udhcpd, udpsvd, umount, uname, unexpand, uniq, unix2dos, unlzma, unlzop, unxz, unzip, uptime, usleep, uudecode, uuencode, vconfig, vi, vlock, volname, wall, watch, watchdog, wc, wget, which, who, whoami, xargs, xz, xzcat, yes, zcat, zcip
  • 32. 32 ● Download BusyBox (1.18.3) to your $ {PRJROOT}/sysapps directory and extract it there. ● Move to the directory for the rest of the setup: $ cd ${PRJROOT}/sysapps/busybox-1.18.3 ● Configuration of BusyBox's options: $ make menuconfig
  • 33. 33
  • 34. 34 ● “Busybox Settings”: ● “Build Options” -> Cross-compiler prefix: ${TARGET}- ● “Installation Options” -> Installation prefix: ${PRJROOT}/rootfs ● Build: $ make ● Install: $ make install
  • 35. 35 14. Demos ● Demo 1 and 2: ● AOSP ● BYO glibc-based rootfs ● Demo 1: BusyBox ● Demo 2: Client-Server app talking through socket ● glibc client ● bionic server ● Demo 3: Buildroot integration ● Demo 4: systrace/atrace/ftrace
  • 36. 36 14.1. Demo 1 - BusyBox ● Configure, build and “install” BusyBox ● Get it copied into final RAM disk image ● Modify AOSP to: ● Make sure /lib/* is executable ● Path start with “/bin” ● adb shell is BusyBox, not Toolbox
  • 37. 37 14.2. Demo 2 - Architecture
  • 38. 38 14.3. Demo 3 - Buildroot integration
  • 39. 39 14.4. Demo 4 – systrace / atrace / ftrace ● ftrace is built into the kernel ● Use systrace/atrace to collect data ● Use Chrome browser to view data