SlideShare a Scribd company logo
Making a
Headless-Android
Device
Lessons Learned
Oslo Embedded S/W Meetup, 2018
Patricia Aas & Johan Herland
Pictures from pixabay.com (CC0)
Patricia Aas
Vivaldi Technologies
Cisco Systems
Opera Software
Twitter: @pati_gallardo
Johan Herland
Cisco Systems
Opera Software
Git Dev Community
Twitter: @jherland
Outline
- Why?
- Architecture
- Devices
- Composition
- Gpu Access
- Lessons Learned
So… What do we know?
And why should you care?
The Problem
Full Android
Using Google’s AOSP, or a more
customized Android Board Support
Package (BSP) from a chip vendor.
Embedded Linux
No Android parts.
Typically based on
glibc, busybox, etc.
Unchartered Territory
Important questions
Do you have:
- Existing codebase?
- Upstream BSP?
- 3rd party dependencies?
What kind of device:
- Display?
- Single or multiple apps?
- Custom H/W?
Architecture : Deep Dive
Full Stack Android
- Java App ecosystem
- Graphics infrastructure
- Supported by modern SoCs
- Linux kernel w/Android features
- Libc : Bionic
Embedded Linux
- Stable/well-known components
- “Mix-and-match”
- C/C++ or web apps
- “Vanilla” kernel (or not...)
- Libc : GNU glibc
Bionic
- Developed specifically for Android
- Focus: small size and speed
- Compatibility:
- Almost all of C11 and POSIX
- Some GNU/BSD extensions
- C++ : “It’s complicated”
GNU glibc
- Used “everywhere”
- Focus:
- Application support
- Standards compliance
- Completeness
- Compatibility: Yes ☺
Platform Architecture - Embedded Linux
Linux kernel
Device drivers GNU glibc
Libraries (SSL, SQLite, etc.) System utils (systemd, busybox)H/W abstraction (OpenGL, alsalib, etc.)
Compositor (XServer, Wayland)
Application framework (Qt, GTK)
Apps
Services/daemons (sshd, httpd)
Your application
Platform Architecture - Full Stack Android
Linux kernel (w/Android features: binder, wakelocks, etc.)
Device drivers Bionic libc
H/W Abstraction Layer (HWC, etc.) Libraries (SSL, SQLite, etc.)
Services (SurfaceFlinger, AudioFlinger, etc.)
Android runtime (ART;
previously Dalvik JVM)
Android Application Framework
Android Apps
System utils (init, ADB, toolbox)
Your application
Platform Architecture - Headless Android based on Bionic
Linux kernel (w/Android features: binder, wakelocks, etc.)
Device drivers Bionic libc
H/W Abstraction Layer (HWC, etc.) Libraries (SSL, SQLite, etc.)
Services? (SurfaceFlinger, etc.)
System utils (init, ADB, toolbox)
Your application
Platform Architecture - Headless Android based on glibc
Linux kernel (w/Android features: binder, wakelocks, etc.)
Device drivers Bionic libc
H/W Abstraction Layer (HWC, etc.) Libraries (SSL, SQLite, etc.)
Services? (SurfaceFlinger, etc.)
System utils (systemd, busybox)
GNU glibc
Hybris?
Your application
Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
Devices
Display Composition
- No display
- Single full-screen app
- Multiple apps
No display
Multi app
Single app
Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
No Display
Traditional Embedded
- Appliance / IOT
No Graphics Integration
No Composition
No display
Multi app
Single app
Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
Java app/service C/C++ app/service C/C++ app/daemon C/C++ app/daemon
No bionic dependencies
No display
Multi app
Single app
Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
Java app/service C/C++ app/service C/C++ app/daemon C/C++ app/daemon
OpenWRT et al
Single full-screen app
Single-purpose device :
- Digital signage
- Kiosk-style device
- Videoconferencing endpoint
Needs Graphics Integration
No Complex Composition
No display
Multi app
Single app
Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
Java app/service
One “home screen” app EGL Window/Framebuffer
C/C++ app/service C/C++ app/daemon C/C++ app/daemon
SurfaceFlinger/HWC SurfaceFlinger/HWC via
e.g. Hybris
Needs glibc/bionic bridge
for graphics integration
No display
Multi app
Single app
Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
Java app/service
One “home screen” app EGL Window/Framebuffer
C/C++ app/service C/C++ app/daemon C/C++ app/daemon
SurfaceFlinger/HWC SurfaceFlinger/HWC via
e.g. Hybris
Cisco Webex Board Cisco Webex Room Series
Cisco TelePresence MX/SX
Tesla Car OS?
OpenWRT et al
Multiple Apps
Consumer Device :
- Phone
- Tablet
- Smart TV
Needs App Store (e.g. Google Play)
Needs Complex Composition
No display
Multi app
Single app
Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
Java app/service
One “home screen” app
App Store (Google’s Play
Store if CDD-compliant)
Multiple apps composited
by XServer/Wayland
EGL Window/Framebuffer
C/C++ app/service C/C++ app/daemon C/C++ app/daemon
Multiple apps composited
by SurfaceFlinger/HWC
via e.g. Hybris
Multiple apps composited
by SurfaceFlinger/HWC
SurfaceFlinger/HWC SurfaceFlinger/HWC via
e.g. Hybris
Needs glibc/bionic bridge
Needs complex composition
No display
Multi app
Single app
Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
Java app/service
One “home screen” app
App Store (Google’s Play
Store if CDD-compliant)
Multiple apps composited
by XServer/Wayland
EGL Window/Framebuffer
C/C++ app/service C/C++ app/daemon C/C++ app/daemon
Multiple apps composited
by SurfaceFlinger/HWC
via e.g. Hybris
Multiple apps composited
by SurfaceFlinger/HWC
SurfaceFlinger/HWC SurfaceFlinger/HWC via
e.g. Hybris
Kindle Fire Boot2Qt (1st version) Sailfish (Jolla), Ubuntu Touch
Cisco Webex Board Cisco Webex Room Series
Samsung Tizen, LG webOS
Cisco TelePresence MX/SX
Tesla Car OS?
OpenWRT et al
Composition
Composition
Need to get pixels on screen
- Compose just one window
with OpenGL
- Compose multiple windows
using external composer /
Hardware Composer
The Hardware Composer
Standardized Android porting
API for rendering to the screen.
Takes a set of surfaces and
composes them to the full frame
for the screen.
LibHybris : Runtime Linker Magic
What is LibHybris?
Dynamically loads and links
bionic libc and bionic linked libs
into a glibc process
Gives access to the bionic libs in
a glibc process
Creator : Carsten Munk
Linux kernel (w/Android features: binder, wakelocks, etc.)
Headless Glibc Android using LibHybris
Your Compositor / GUI App
LibHybris
Bionic
SurfaceFlinger / HWC
OpenGL shared lib
GUI lib
GNU glibc
Other libs
A bionic GPU process?
Pipe GPU commands over a
local pipe to a bionic process
that does the composition.
Linux kernel (w/Android features: binder, wakelocks, etc.)
Headless Glibc Android using a Bionic GPU Process + IPC
GUI AppCompositor
GUI lib
GNU glibc
IPC-GL client
SurfaceFlinger / HWC
OpenGL shared lib
Bionic
IPC
Other libs
IPC-GL server
Chromium GPU Process Architecture
Communication Architecture
Renderer
Gpu Process
Browser Renderer
IPC Channels
Shared Memory
Gpu Memory BuffersCommand Buffers
Client
Renderer / Browser
- Write commands to
shared memory
- Update ‘put’ pointer
- Signal GPU process
@pati_gallardo
Server
GPU Process
- Read commands from
shared memory
- Validate command and
arguments
- Make actual call@pati_gallardo
Gpu
Process
Command
Buffer
IPC Channel
Command
Stream
Ordering
Barrier
Unverified Sync Token
Wait Sync Token
Wait Sync TokenCommandCommand
Command
Command
Command Command
CommandVerified Sync TokenBrowser
Renderer
Renderer
Command
Command
CommandCommand
CommandCommand
Not Exactly Cut A nd Paste
@pati_gallardo
Lessons Learned
CC image courtesy of penjelly on Flickr
Existing Codebase
Porting to Java?
Porting from glibc to Bionic?
Rewrite to Android APIs?
What about other APIs you use?
- Do they exist in Android?
3rd-party dependencies?
Port to Bionic? Really !?
Will upstream accept the port?
Remove deps if possible!
What about alternative deps?
Push towards glibc platform!
Bringup & Maintenance
Minimize custom hardware!
Decouple customizations from
upstream BSP/platform
Keep changes out of the BSP
- Above the Android APIs
- Or below user space
(kernel drivers, device tree)
Maintaining Patches
Avoid patches when you can!
Minimize changes to the BSP itself
Decouple your changes from the guts of
Android
Structure your patches!
Patches across many different repos:
- Common scheme for maintenance
- Enumerate your current patchset
- Integrating new upstream release:
- Remove and Refresh
Big Ball of Mud
Plan for updates!
AOSP / BSP : Every year
3rd-party dependencies : Varies
Strict security policies (e.g. OpenSSL)
Chromium : Every month
Chip vendor : Hopefully never!
Too many patches!
- Can’t update Android version
- Can’t update 3rd-party libs
- Security pipeline clogged
- Project stalled!
Wrap it up!
No display
Multi app
Single app
Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
Java app/service
One “home screen” app
App Store (Google’s Play
Store if CDD-compliant)
Multiple apps composited
by XServer/Wayland
EGL Window/Framebuffer
C/C++ app/service C/C++ app/daemon C/C++ app/daemon
Multiple apps composited
by SurfaceFlinger/HWC
via e.g. Hybris
Multiple apps composited
by SurfaceFlinger/HWC
SurfaceFlinger/HWC SurfaceFlinger/HWC via
e.g. Hybris
Your code + 3rd-party
dependencies built
against Bionic
Your code +
3rd-party
dependencies
built against
glibc
Bionic / Glibc
bridge
needed for
graphics &
composition
No display
Multi app
Single app
Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
Java app/service
One “home screen” app
App Store (Google’s Play
Store if CDD-compliant)
Multiple apps composited
by XServer/Wayland
EGL Window/Framebuffer
C/C++ app/service C/C++ app/daemon C/C++ app/daemon
Multiple apps composited
by SurfaceFlinger/HWC
via e.g. Hybris
Multiple apps composited
by SurfaceFlinger/HWC
SurfaceFlinger/HWC SurfaceFlinger/HWC via
e.g. Hybris
Plan for maintenance
Questions?
Feedback, please
Swag!

More Related Content

What's hot

INTEL XDK
INTEL XDKINTEL XDK
INTEL XDK
Sumit Rajpal
 
Developing On the IntelliJ Platform
Developing On the IntelliJ PlatformDeveloping On the IntelliJ Platform
Developing On the IntelliJ Platform
Yann Cébron
 
Portinig Application, Drivers And Os
Portinig Application, Drivers And OsPortinig Application, Drivers And Os
Portinig Application, Drivers And Osmomobangalore
 
The Power, and Pain, of Cordova Plugins
The Power, and Pain, of Cordova PluginsThe Power, and Pain, of Cordova Plugins
The Power, and Pain, of Cordova Plugins
Intel® Software
 
Crosswalk and the Intel XDK
Crosswalk and the Intel XDKCrosswalk and the Intel XDK
Crosswalk and the Intel XDK
Intel® Software
 
Android OS Porting: Introduction
Android OS Porting: IntroductionAndroid OS Porting: Introduction
Android OS Porting: Introduction
Jollen Chen
 
Google ART (Android RunTime)
Google ART (Android RunTime)Google ART (Android RunTime)
Google ART (Android RunTime)
Niraj Solanke
 
Sys ml helperprofile-rhapsody813-obtainandinstall-v1
Sys ml helperprofile-rhapsody813-obtainandinstall-v1Sys ml helperprofile-rhapsody813-obtainandinstall-v1
Sys ml helperprofile-rhapsody813-obtainandinstall-v1
Fraser Chadburn
 
Hybrid Mobile Applications
Hybrid Mobile ApplicationsHybrid Mobile Applications
Hybrid Mobile Applications
Ruwan Ranganath
 
Android Security Internals
Android Security InternalsAndroid Security Internals
Android Security Internals
Opersys inc.
 
P2 Introduction
P2 IntroductionP2 Introduction
P2 Introduction
irbull
 
Tizen Native Application Development with C/C++
Tizen Native Application Development with C/C++Tizen Native Application Development with C/C++
Tizen Native Application Development with C/C++
Gilang Mentari Hamidy
 
A deep dive into Android OpenSource Project(AOSP)
A deep dive into Android OpenSource Project(AOSP)A deep dive into Android OpenSource Project(AOSP)
A deep dive into Android OpenSource Project(AOSP)
Siji Sunny
 
Intro to Ionic for Building Hybrid Mobile Applications
Intro to Ionic for Building Hybrid Mobile ApplicationsIntro to Ionic for Building Hybrid Mobile Applications
Intro to Ionic for Building Hybrid Mobile Applications
Sasha dos Santos
 
The Future of Cross-Platform is Native
The Future of Cross-Platform is NativeThe Future of Cross-Platform is Native
The Future of Cross-Platform is Native
Justin Mancinelli
 
App forum2015 London - Building RhoMobile Applications with Ionic
App forum2015 London - Building RhoMobile Applications with IonicApp forum2015 London - Building RhoMobile Applications with Ionic
App forum2015 London - Building RhoMobile Applications with Ionic
robgalvinjr
 
Introductio to Docker Containers
Introductio to Docker ContainersIntroductio to Docker Containers
Introductio to Docker Containers
Houssein Ben Amor
 
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.
 
Android on Windows 11 - A Developer's Perspective (Windows Subsystem For Andr...
Android on Windows 11 - A Developer's Perspective (Windows Subsystem For Andr...Android on Windows 11 - A Developer's Perspective (Windows Subsystem For Andr...
Android on Windows 11 - A Developer's Perspective (Windows Subsystem For Andr...
Embarcadero Technologies
 

What's hot (20)

INTEL XDK
INTEL XDKINTEL XDK
INTEL XDK
 
Developing On the IntelliJ Platform
Developing On the IntelliJ PlatformDeveloping On the IntelliJ Platform
Developing On the IntelliJ Platform
 
Portinig Application, Drivers And Os
Portinig Application, Drivers And OsPortinig Application, Drivers And Os
Portinig Application, Drivers And Os
 
The Power, and Pain, of Cordova Plugins
The Power, and Pain, of Cordova PluginsThe Power, and Pain, of Cordova Plugins
The Power, and Pain, of Cordova Plugins
 
Crosswalk and the Intel XDK
Crosswalk and the Intel XDKCrosswalk and the Intel XDK
Crosswalk and the Intel XDK
 
Android OS Porting: Introduction
Android OS Porting: IntroductionAndroid OS Porting: Introduction
Android OS Porting: Introduction
 
Google ART (Android RunTime)
Google ART (Android RunTime)Google ART (Android RunTime)
Google ART (Android RunTime)
 
Sys ml helperprofile-rhapsody813-obtainandinstall-v1
Sys ml helperprofile-rhapsody813-obtainandinstall-v1Sys ml helperprofile-rhapsody813-obtainandinstall-v1
Sys ml helperprofile-rhapsody813-obtainandinstall-v1
 
Hybrid Mobile Applications
Hybrid Mobile ApplicationsHybrid Mobile Applications
Hybrid Mobile Applications
 
Android Security Internals
Android Security InternalsAndroid Security Internals
Android Security Internals
 
P2 Introduction
P2 IntroductionP2 Introduction
P2 Introduction
 
ARM
ARMARM
ARM
 
Tizen Native Application Development with C/C++
Tizen Native Application Development with C/C++Tizen Native Application Development with C/C++
Tizen Native Application Development with C/C++
 
A deep dive into Android OpenSource Project(AOSP)
A deep dive into Android OpenSource Project(AOSP)A deep dive into Android OpenSource Project(AOSP)
A deep dive into Android OpenSource Project(AOSP)
 
Intro to Ionic for Building Hybrid Mobile Applications
Intro to Ionic for Building Hybrid Mobile ApplicationsIntro to Ionic for Building Hybrid Mobile Applications
Intro to Ionic for Building Hybrid Mobile Applications
 
The Future of Cross-Platform is Native
The Future of Cross-Platform is NativeThe Future of Cross-Platform is Native
The Future of Cross-Platform is Native
 
App forum2015 London - Building RhoMobile Applications with Ionic
App forum2015 London - Building RhoMobile Applications with IonicApp forum2015 London - Building RhoMobile Applications with Ionic
App forum2015 London - Building RhoMobile Applications with Ionic
 
Introductio to Docker Containers
Introductio to Docker ContainersIntroductio to Docker Containers
Introductio to Docker Containers
 
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
 
Android on Windows 11 - A Developer's Perspective (Windows Subsystem For Andr...
Android on Windows 11 - A Developer's Perspective (Windows Subsystem For Andr...Android on Windows 11 - A Developer's Perspective (Windows Subsystem For Andr...
Android on Windows 11 - A Developer's Perspective (Windows Subsystem For Andr...
 

Similar to Making a Headless Android Device (Oslo Embedded Meetup 2018)

Making a Headless Android Device
Making a Headless Android DeviceMaking a Headless Android Device
Making a Headless Android Device
Patricia Aas
 
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...Paris Open Source Summit
 
Cross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual StudioCross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual StudioMizanur Sarker
 
lecture-2-android-dev.pdf
lecture-2-android-dev.pdflecture-2-android-dev.pdf
lecture-2-android-dev.pdf
jakjak36
 
Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11 Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11
Lars Vogel
 
Android Anatomy
Android  AnatomyAndroid  Anatomy
Android Anatomy
Bhavya Siddappa
 
Firefox OS - Hive Pilani 2015
Firefox OS - Hive Pilani 2015Firefox OS - Hive Pilani 2015
Firefox OS - Hive Pilani 2015
Nilay Binjola
 
Advance Android Application Development
Advance Android Application DevelopmentAdvance Android Application Development
Advance Android Application Development
Ramesh Prasad
 
Add the power of the Web to your embedded devices with WPE WebKit
Add the power of the Web to your embedded devices with WPE WebKitAdd the power of the Web to your embedded devices with WPE WebKit
Add the power of the Web to your embedded devices with WPE WebKit
Igalia
 
Mobile Web Apps and the Intel® XDK
Mobile Web Apps and the Intel® XDKMobile Web Apps and the Intel® XDK
Mobile Web Apps and the Intel® XDK
Intel® Software
 
Introduction to Android App Development
Introduction to Android App DevelopmentIntroduction to Android App Development
Introduction to Android App Development
Andri Yadi
 
Android Things : Building Embedded Devices
Android Things : Building Embedded DevicesAndroid Things : Building Embedded Devices
Android Things : Building Embedded Devices
Emertxe Information Technologies Pvt Ltd
 
Play With Android
Play With AndroidPlay With Android
Play With AndroidChamp Yen
 
Graphical libraries
Graphical librariesGraphical libraries
Graphical libraries
guestbd40369
 
Introduction to the Android NDK
Introduction to the Android NDKIntroduction to the Android NDK
Introduction to the Android NDK
Sebastian Mauer
 
Hybrid HTML5 Apps
Hybrid HTML5 AppsHybrid HTML5 Apps
Hybrid HTML5 Apps
Hugo Rodrigues
 
O futuro do .NET : O que eu preciso saber
O futuro do .NET : O que eu preciso saberO futuro do .NET : O que eu preciso saber
O futuro do .NET : O que eu preciso saber
Danilo Bordini
 
Android In A Nutshell
Android In A NutshellAndroid In A Nutshell
Android In A Nutshell
Ted Chien
 
Alternatives to Java for Android development
Alternatives to Java for Android developmentAlternatives to Java for Android development
Alternatives to Java for Android development
ttogrul
 

Similar to Making a Headless Android Device (Oslo Embedded Meetup 2018) (20)

Making a Headless Android Device
Making a Headless Android DeviceMaking a Headless Android Device
Making a Headless Android Device
 
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
 
Cross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual StudioCross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual Studio
 
lecture-2-android-dev.pdf
lecture-2-android-dev.pdflecture-2-android-dev.pdf
lecture-2-android-dev.pdf
 
Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11 Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11
 
Android Anatomy
Android  AnatomyAndroid  Anatomy
Android Anatomy
 
Firefox OS - Hive Pilani 2015
Firefox OS - Hive Pilani 2015Firefox OS - Hive Pilani 2015
Firefox OS - Hive Pilani 2015
 
Advance Android Application Development
Advance Android Application DevelopmentAdvance Android Application Development
Advance Android Application Development
 
Add the power of the Web to your embedded devices with WPE WebKit
Add the power of the Web to your embedded devices with WPE WebKitAdd the power of the Web to your embedded devices with WPE WebKit
Add the power of the Web to your embedded devices with WPE WebKit
 
Mobile Web Apps and the Intel® XDK
Mobile Web Apps and the Intel® XDKMobile Web Apps and the Intel® XDK
Mobile Web Apps and the Intel® XDK
 
Introduction to Android App Development
Introduction to Android App DevelopmentIntroduction to Android App Development
Introduction to Android App Development
 
Android Things : Building Embedded Devices
Android Things : Building Embedded DevicesAndroid Things : Building Embedded Devices
Android Things : Building Embedded Devices
 
Play With Android
Play With AndroidPlay With Android
Play With Android
 
Graphical libraries
Graphical librariesGraphical libraries
Graphical libraries
 
Introduction to the Android NDK
Introduction to the Android NDKIntroduction to the Android NDK
Introduction to the Android NDK
 
Android session-1-sajib
Android session-1-sajibAndroid session-1-sajib
Android session-1-sajib
 
Hybrid HTML5 Apps
Hybrid HTML5 AppsHybrid HTML5 Apps
Hybrid HTML5 Apps
 
O futuro do .NET : O que eu preciso saber
O futuro do .NET : O que eu preciso saberO futuro do .NET : O que eu preciso saber
O futuro do .NET : O que eu preciso saber
 
Android In A Nutshell
Android In A NutshellAndroid In A Nutshell
Android In A Nutshell
 
Alternatives to Java for Android development
Alternatives to Java for Android developmentAlternatives to Java for Android development
Alternatives to Java for Android development
 

More from Patricia Aas

NDC TechTown 2023_ Return Oriented Programming an introduction.pdf
NDC TechTown 2023_ Return Oriented Programming an introduction.pdfNDC TechTown 2023_ Return Oriented Programming an introduction.pdf
NDC TechTown 2023_ Return Oriented Programming an introduction.pdf
Patricia Aas
 
Telling a story
Telling a storyTelling a story
Telling a story
Patricia Aas
 
Return Oriented Programming, an introduction
Return Oriented Programming, an introductionReturn Oriented Programming, an introduction
Return Oriented Programming, an introduction
Patricia Aas
 
I can't work like this (KDE Academy Keynote 2021)
I can't work like this (KDE Academy Keynote 2021)I can't work like this (KDE Academy Keynote 2021)
I can't work like this (KDE Academy Keynote 2021)
Patricia Aas
 
Dependency Management in C++ (NDC TechTown 2021)
Dependency Management in C++ (NDC TechTown 2021)Dependency Management in C++ (NDC TechTown 2021)
Dependency Management in C++ (NDC TechTown 2021)
Patricia Aas
 
Introduction to Memory Exploitation (Meeting C++ 2021)
Introduction to Memory Exploitation (Meeting C++ 2021)Introduction to Memory Exploitation (Meeting C++ 2021)
Introduction to Memory Exploitation (Meeting C++ 2021)
Patricia Aas
 
Classic Vulnerabilities (MUCplusplus2022).pdf
Classic Vulnerabilities (MUCplusplus2022).pdfClassic Vulnerabilities (MUCplusplus2022).pdf
Classic Vulnerabilities (MUCplusplus2022).pdf
Patricia Aas
 
Classic Vulnerabilities (ACCU Keynote 2022)
Classic Vulnerabilities (ACCU Keynote 2022)Classic Vulnerabilities (ACCU Keynote 2022)
Classic Vulnerabilities (ACCU Keynote 2022)
Patricia Aas
 
Introduction to Memory Exploitation (CppEurope 2021)
Introduction to Memory Exploitation (CppEurope 2021)Introduction to Memory Exploitation (CppEurope 2021)
Introduction to Memory Exploitation (CppEurope 2021)
Patricia Aas
 
Thoughts On Learning A New Programming Language
Thoughts On Learning A New Programming LanguageThoughts On Learning A New Programming Language
Thoughts On Learning A New Programming Language
Patricia Aas
 
Trying to build an Open Source browser in 2020
Trying to build an Open Source browser in 2020Trying to build an Open Source browser in 2020
Trying to build an Open Source browser in 2020
Patricia Aas
 
Trying to build an Open Source browser in 2020
Trying to build an Open Source browser in 2020Trying to build an Open Source browser in 2020
Trying to build an Open Source browser in 2020
Patricia Aas
 
DevSecOps for Developers, How To Start (ETC 2020)
DevSecOps for Developers, How To Start (ETC 2020)DevSecOps for Developers, How To Start (ETC 2020)
DevSecOps for Developers, How To Start (ETC 2020)
Patricia Aas
 
The Anatomy of an Exploit (NDC TechTown 2019)
The Anatomy of an Exploit (NDC TechTown 2019)The Anatomy of an Exploit (NDC TechTown 2019)
The Anatomy of an Exploit (NDC TechTown 2019)
Patricia Aas
 
Elections: Trust and Critical Infrastructure (NDC TechTown 2019)
Elections: Trust and Critical Infrastructure (NDC TechTown 2019)Elections: Trust and Critical Infrastructure (NDC TechTown 2019)
Elections: Trust and Critical Infrastructure (NDC TechTown 2019)
Patricia Aas
 
The Anatomy of an Exploit (NDC TechTown 2019))
The Anatomy of an Exploit (NDC TechTown 2019))The Anatomy of an Exploit (NDC TechTown 2019))
The Anatomy of an Exploit (NDC TechTown 2019))
Patricia Aas
 
Elections, Trust and Critical Infrastructure (NDC TechTown)
Elections, Trust and Critical Infrastructure (NDC TechTown)Elections, Trust and Critical Infrastructure (NDC TechTown)
Elections, Trust and Critical Infrastructure (NDC TechTown)
Patricia Aas
 
Survival Tips for Women in Tech (JavaZone 2019)
Survival Tips for Women in Tech (JavaZone 2019) Survival Tips for Women in Tech (JavaZone 2019)
Survival Tips for Women in Tech (JavaZone 2019)
Patricia Aas
 
Embedded Ethics (EuroBSDcon 2019)
Embedded Ethics (EuroBSDcon 2019)Embedded Ethics (EuroBSDcon 2019)
Embedded Ethics (EuroBSDcon 2019)
Patricia Aas
 
Chromium Sandbox on Linux (NDC Security 2019)
Chromium Sandbox on Linux (NDC Security 2019)Chromium Sandbox on Linux (NDC Security 2019)
Chromium Sandbox on Linux (NDC Security 2019)
Patricia Aas
 

More from Patricia Aas (20)

NDC TechTown 2023_ Return Oriented Programming an introduction.pdf
NDC TechTown 2023_ Return Oriented Programming an introduction.pdfNDC TechTown 2023_ Return Oriented Programming an introduction.pdf
NDC TechTown 2023_ Return Oriented Programming an introduction.pdf
 
Telling a story
Telling a storyTelling a story
Telling a story
 
Return Oriented Programming, an introduction
Return Oriented Programming, an introductionReturn Oriented Programming, an introduction
Return Oriented Programming, an introduction
 
I can't work like this (KDE Academy Keynote 2021)
I can't work like this (KDE Academy Keynote 2021)I can't work like this (KDE Academy Keynote 2021)
I can't work like this (KDE Academy Keynote 2021)
 
Dependency Management in C++ (NDC TechTown 2021)
Dependency Management in C++ (NDC TechTown 2021)Dependency Management in C++ (NDC TechTown 2021)
Dependency Management in C++ (NDC TechTown 2021)
 
Introduction to Memory Exploitation (Meeting C++ 2021)
Introduction to Memory Exploitation (Meeting C++ 2021)Introduction to Memory Exploitation (Meeting C++ 2021)
Introduction to Memory Exploitation (Meeting C++ 2021)
 
Classic Vulnerabilities (MUCplusplus2022).pdf
Classic Vulnerabilities (MUCplusplus2022).pdfClassic Vulnerabilities (MUCplusplus2022).pdf
Classic Vulnerabilities (MUCplusplus2022).pdf
 
Classic Vulnerabilities (ACCU Keynote 2022)
Classic Vulnerabilities (ACCU Keynote 2022)Classic Vulnerabilities (ACCU Keynote 2022)
Classic Vulnerabilities (ACCU Keynote 2022)
 
Introduction to Memory Exploitation (CppEurope 2021)
Introduction to Memory Exploitation (CppEurope 2021)Introduction to Memory Exploitation (CppEurope 2021)
Introduction to Memory Exploitation (CppEurope 2021)
 
Thoughts On Learning A New Programming Language
Thoughts On Learning A New Programming LanguageThoughts On Learning A New Programming Language
Thoughts On Learning A New Programming Language
 
Trying to build an Open Source browser in 2020
Trying to build an Open Source browser in 2020Trying to build an Open Source browser in 2020
Trying to build an Open Source browser in 2020
 
Trying to build an Open Source browser in 2020
Trying to build an Open Source browser in 2020Trying to build an Open Source browser in 2020
Trying to build an Open Source browser in 2020
 
DevSecOps for Developers, How To Start (ETC 2020)
DevSecOps for Developers, How To Start (ETC 2020)DevSecOps for Developers, How To Start (ETC 2020)
DevSecOps for Developers, How To Start (ETC 2020)
 
The Anatomy of an Exploit (NDC TechTown 2019)
The Anatomy of an Exploit (NDC TechTown 2019)The Anatomy of an Exploit (NDC TechTown 2019)
The Anatomy of an Exploit (NDC TechTown 2019)
 
Elections: Trust and Critical Infrastructure (NDC TechTown 2019)
Elections: Trust and Critical Infrastructure (NDC TechTown 2019)Elections: Trust and Critical Infrastructure (NDC TechTown 2019)
Elections: Trust and Critical Infrastructure (NDC TechTown 2019)
 
The Anatomy of an Exploit (NDC TechTown 2019))
The Anatomy of an Exploit (NDC TechTown 2019))The Anatomy of an Exploit (NDC TechTown 2019))
The Anatomy of an Exploit (NDC TechTown 2019))
 
Elections, Trust and Critical Infrastructure (NDC TechTown)
Elections, Trust and Critical Infrastructure (NDC TechTown)Elections, Trust and Critical Infrastructure (NDC TechTown)
Elections, Trust and Critical Infrastructure (NDC TechTown)
 
Survival Tips for Women in Tech (JavaZone 2019)
Survival Tips for Women in Tech (JavaZone 2019) Survival Tips for Women in Tech (JavaZone 2019)
Survival Tips for Women in Tech (JavaZone 2019)
 
Embedded Ethics (EuroBSDcon 2019)
Embedded Ethics (EuroBSDcon 2019)Embedded Ethics (EuroBSDcon 2019)
Embedded Ethics (EuroBSDcon 2019)
 
Chromium Sandbox on Linux (NDC Security 2019)
Chromium Sandbox on Linux (NDC Security 2019)Chromium Sandbox on Linux (NDC Security 2019)
Chromium Sandbox on Linux (NDC Security 2019)
 

Recently uploaded

Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
КАТЕРИНА АБЗЯТОВА «Ефективне планування тестування ключові аспекти та практ...
КАТЕРИНА АБЗЯТОВА  «Ефективне планування тестування  ключові аспекти та практ...КАТЕРИНА АБЗЯТОВА  «Ефективне планування тестування  ключові аспекти та практ...
КАТЕРИНА АБЗЯТОВА «Ефективне планування тестування ключові аспекти та практ...
QADay
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 
Ransomware Mallox [EN].pdf
Ransomware         Mallox       [EN].pdfRansomware         Mallox       [EN].pdf
Ransomware Mallox [EN].pdf
Overkill Security
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 

Recently uploaded (20)

Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
КАТЕРИНА АБЗЯТОВА «Ефективне планування тестування ключові аспекти та практ...
КАТЕРИНА АБЗЯТОВА  «Ефективне планування тестування  ключові аспекти та практ...КАТЕРИНА АБЗЯТОВА  «Ефективне планування тестування  ключові аспекти та практ...
КАТЕРИНА АБЗЯТОВА «Ефективне планування тестування ключові аспекти та практ...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Ransomware Mallox [EN].pdf
Ransomware         Mallox       [EN].pdfRansomware         Mallox       [EN].pdf
Ransomware Mallox [EN].pdf
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 

Making a Headless Android Device (Oslo Embedded Meetup 2018)

  • 1.
  • 2. Making a Headless-Android Device Lessons Learned Oslo Embedded S/W Meetup, 2018 Patricia Aas & Johan Herland Pictures from pixabay.com (CC0)
  • 3. Patricia Aas Vivaldi Technologies Cisco Systems Opera Software Twitter: @pati_gallardo Johan Herland Cisco Systems Opera Software Git Dev Community Twitter: @jherland
  • 4. Outline - Why? - Architecture - Devices - Composition - Gpu Access - Lessons Learned
  • 5. So… What do we know?
  • 6.
  • 7. And why should you care?
  • 8. The Problem Full Android Using Google’s AOSP, or a more customized Android Board Support Package (BSP) from a chip vendor. Embedded Linux No Android parts. Typically based on glibc, busybox, etc.
  • 10. Important questions Do you have: - Existing codebase? - Upstream BSP? - 3rd party dependencies? What kind of device: - Display? - Single or multiple apps? - Custom H/W?
  • 12. Full Stack Android - Java App ecosystem - Graphics infrastructure - Supported by modern SoCs - Linux kernel w/Android features - Libc : Bionic Embedded Linux - Stable/well-known components - “Mix-and-match” - C/C++ or web apps - “Vanilla” kernel (or not...) - Libc : GNU glibc
  • 13. Bionic - Developed specifically for Android - Focus: small size and speed - Compatibility: - Almost all of C11 and POSIX - Some GNU/BSD extensions - C++ : “It’s complicated” GNU glibc - Used “everywhere” - Focus: - Application support - Standards compliance - Completeness - Compatibility: Yes ☺
  • 14. Platform Architecture - Embedded Linux Linux kernel Device drivers GNU glibc Libraries (SSL, SQLite, etc.) System utils (systemd, busybox)H/W abstraction (OpenGL, alsalib, etc.) Compositor (XServer, Wayland) Application framework (Qt, GTK) Apps Services/daemons (sshd, httpd) Your application
  • 15. Platform Architecture - Full Stack Android Linux kernel (w/Android features: binder, wakelocks, etc.) Device drivers Bionic libc H/W Abstraction Layer (HWC, etc.) Libraries (SSL, SQLite, etc.) Services (SurfaceFlinger, AudioFlinger, etc.) Android runtime (ART; previously Dalvik JVM) Android Application Framework Android Apps System utils (init, ADB, toolbox) Your application
  • 16. Platform Architecture - Headless Android based on Bionic Linux kernel (w/Android features: binder, wakelocks, etc.) Device drivers Bionic libc H/W Abstraction Layer (HWC, etc.) Libraries (SSL, SQLite, etc.) Services? (SurfaceFlinger, etc.) System utils (init, ADB, toolbox) Your application
  • 17. Platform Architecture - Headless Android based on glibc Linux kernel (w/Android features: binder, wakelocks, etc.) Device drivers Bionic libc H/W Abstraction Layer (HWC, etc.) Libraries (SSL, SQLite, etc.) Services? (SurfaceFlinger, etc.) System utils (systemd, busybox) GNU glibc Hybris? Your application
  • 18. Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
  • 20. Display Composition - No display - Single full-screen app - Multiple apps
  • 21. No display Multi app Single app Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
  • 22. No Display Traditional Embedded - Appliance / IOT No Graphics Integration No Composition
  • 23. No display Multi app Single app Embedded LinuxFull stack Android Headless GlibcHeadless Bionic Java app/service C/C++ app/service C/C++ app/daemon C/C++ app/daemon No bionic dependencies
  • 24. No display Multi app Single app Embedded LinuxFull stack Android Headless GlibcHeadless Bionic Java app/service C/C++ app/service C/C++ app/daemon C/C++ app/daemon OpenWRT et al
  • 25. Single full-screen app Single-purpose device : - Digital signage - Kiosk-style device - Videoconferencing endpoint Needs Graphics Integration No Complex Composition
  • 26. No display Multi app Single app Embedded LinuxFull stack Android Headless GlibcHeadless Bionic Java app/service One “home screen” app EGL Window/Framebuffer C/C++ app/service C/C++ app/daemon C/C++ app/daemon SurfaceFlinger/HWC SurfaceFlinger/HWC via e.g. Hybris Needs glibc/bionic bridge for graphics integration
  • 27. No display Multi app Single app Embedded LinuxFull stack Android Headless GlibcHeadless Bionic Java app/service One “home screen” app EGL Window/Framebuffer C/C++ app/service C/C++ app/daemon C/C++ app/daemon SurfaceFlinger/HWC SurfaceFlinger/HWC via e.g. Hybris Cisco Webex Board Cisco Webex Room Series Cisco TelePresence MX/SX Tesla Car OS? OpenWRT et al
  • 28. Multiple Apps Consumer Device : - Phone - Tablet - Smart TV Needs App Store (e.g. Google Play) Needs Complex Composition
  • 29. No display Multi app Single app Embedded LinuxFull stack Android Headless GlibcHeadless Bionic Java app/service One “home screen” app App Store (Google’s Play Store if CDD-compliant) Multiple apps composited by XServer/Wayland EGL Window/Framebuffer C/C++ app/service C/C++ app/daemon C/C++ app/daemon Multiple apps composited by SurfaceFlinger/HWC via e.g. Hybris Multiple apps composited by SurfaceFlinger/HWC SurfaceFlinger/HWC SurfaceFlinger/HWC via e.g. Hybris Needs glibc/bionic bridge Needs complex composition
  • 30. No display Multi app Single app Embedded LinuxFull stack Android Headless GlibcHeadless Bionic Java app/service One “home screen” app App Store (Google’s Play Store if CDD-compliant) Multiple apps composited by XServer/Wayland EGL Window/Framebuffer C/C++ app/service C/C++ app/daemon C/C++ app/daemon Multiple apps composited by SurfaceFlinger/HWC via e.g. Hybris Multiple apps composited by SurfaceFlinger/HWC SurfaceFlinger/HWC SurfaceFlinger/HWC via e.g. Hybris Kindle Fire Boot2Qt (1st version) Sailfish (Jolla), Ubuntu Touch Cisco Webex Board Cisco Webex Room Series Samsung Tizen, LG webOS Cisco TelePresence MX/SX Tesla Car OS? OpenWRT et al
  • 32. Composition Need to get pixels on screen - Compose just one window with OpenGL - Compose multiple windows using external composer / Hardware Composer
  • 33. The Hardware Composer Standardized Android porting API for rendering to the screen. Takes a set of surfaces and composes them to the full frame for the screen.
  • 34. LibHybris : Runtime Linker Magic
  • 35. What is LibHybris? Dynamically loads and links bionic libc and bionic linked libs into a glibc process Gives access to the bionic libs in a glibc process Creator : Carsten Munk
  • 36. Linux kernel (w/Android features: binder, wakelocks, etc.) Headless Glibc Android using LibHybris Your Compositor / GUI App LibHybris Bionic SurfaceFlinger / HWC OpenGL shared lib GUI lib GNU glibc Other libs
  • 37. A bionic GPU process? Pipe GPU commands over a local pipe to a bionic process that does the composition.
  • 38. Linux kernel (w/Android features: binder, wakelocks, etc.) Headless Glibc Android using a Bionic GPU Process + IPC GUI AppCompositor GUI lib GNU glibc IPC-GL client SurfaceFlinger / HWC OpenGL shared lib Bionic IPC Other libs IPC-GL server
  • 39. Chromium GPU Process Architecture
  • 40. Communication Architecture Renderer Gpu Process Browser Renderer IPC Channels Shared Memory Gpu Memory BuffersCommand Buffers
  • 41. Client Renderer / Browser - Write commands to shared memory - Update ‘put’ pointer - Signal GPU process @pati_gallardo
  • 42. Server GPU Process - Read commands from shared memory - Validate command and arguments - Make actual call@pati_gallardo
  • 43. Gpu Process Command Buffer IPC Channel Command Stream Ordering Barrier Unverified Sync Token Wait Sync Token Wait Sync TokenCommandCommand Command Command Command Command CommandVerified Sync TokenBrowser Renderer Renderer Command Command CommandCommand CommandCommand
  • 44. Not Exactly Cut A nd Paste @pati_gallardo
  • 45. Lessons Learned CC image courtesy of penjelly on Flickr
  • 46. Existing Codebase Porting to Java? Porting from glibc to Bionic? Rewrite to Android APIs? What about other APIs you use? - Do they exist in Android?
  • 47. 3rd-party dependencies? Port to Bionic? Really !? Will upstream accept the port? Remove deps if possible! What about alternative deps? Push towards glibc platform!
  • 48. Bringup & Maintenance Minimize custom hardware! Decouple customizations from upstream BSP/platform Keep changes out of the BSP - Above the Android APIs - Or below user space (kernel drivers, device tree)
  • 50. Avoid patches when you can! Minimize changes to the BSP itself Decouple your changes from the guts of Android
  • 51. Structure your patches! Patches across many different repos: - Common scheme for maintenance - Enumerate your current patchset - Integrating new upstream release: - Remove and Refresh
  • 52. Big Ball of Mud
  • 53. Plan for updates! AOSP / BSP : Every year 3rd-party dependencies : Varies Strict security policies (e.g. OpenSSL) Chromium : Every month Chip vendor : Hopefully never!
  • 54. Too many patches! - Can’t update Android version - Can’t update 3rd-party libs - Security pipeline clogged - Project stalled!
  • 56. No display Multi app Single app Embedded LinuxFull stack Android Headless GlibcHeadless Bionic Java app/service One “home screen” app App Store (Google’s Play Store if CDD-compliant) Multiple apps composited by XServer/Wayland EGL Window/Framebuffer C/C++ app/service C/C++ app/daemon C/C++ app/daemon Multiple apps composited by SurfaceFlinger/HWC via e.g. Hybris Multiple apps composited by SurfaceFlinger/HWC SurfaceFlinger/HWC SurfaceFlinger/HWC via e.g. Hybris Your code + 3rd-party dependencies built against Bionic Your code + 3rd-party dependencies built against glibc Bionic / Glibc bridge needed for graphics & composition
  • 57. No display Multi app Single app Embedded LinuxFull stack Android Headless GlibcHeadless Bionic Java app/service One “home screen” app App Store (Google’s Play Store if CDD-compliant) Multiple apps composited by XServer/Wayland EGL Window/Framebuffer C/C++ app/service C/C++ app/daemon C/C++ app/daemon Multiple apps composited by SurfaceFlinger/HWC via e.g. Hybris Multiple apps composited by SurfaceFlinger/HWC SurfaceFlinger/HWC SurfaceFlinger/HWC via e.g. Hybris