This document discusses porting Android to new hardware. It covers components that need to be ported like the bootloader, Linux kernel, and hardware libraries. It also discusses getting the Android Open Source Project code, developing device drivers, customizing the user-space, and building the Android system. The goal is to provide guidance on porting each part of the Android software stack to new CPU architectures and hardware boards.
There are many books, articles and paper publications about Android and related applications but only a few are related to how Android operating system works internally.In this talk we will see how android boots up , an overview of zygote , how system server and package manager works. This talk will be extremely helpful to foster understanding among android developers about Android Internals as well as everybody else who desires a general understanding of the internal working of Android powered devices.
For new age touch-based embedded devices, Android is becoming a popular OS going beyond mobile phones. With its roots from Embedded Linux, Android framework offers benefits in terms of rich libraries, open-source and multi-device support. Emertxe’s hands-on Embedded Android Training Course is designed to customize, build and deploy custom Embedded OS on ARM target. Rich set of projects will make your learning complete.
There are many books, articles and paper publications about Android and related applications but only a few are related to how Android operating system works internally.In this talk we will see how android boots up , an overview of zygote , how system server and package manager works. This talk will be extremely helpful to foster understanding among android developers about Android Internals as well as everybody else who desires a general understanding of the internal working of Android powered devices.
For new age touch-based embedded devices, Android is becoming a popular OS going beyond mobile phones. With its roots from Embedded Linux, Android framework offers benefits in terms of rich libraries, open-source and multi-device support. Emertxe’s hands-on Embedded Android Training Course is designed to customize, build and deploy custom Embedded OS on ARM target. Rich set of projects will make your learning complete.
Embedded Android System Development - Part II talks about Hardware Abstraction Layer (HAL). HAL is an interfacing layer through which Android service can place a request to device. Uses functions provided by Linux system to service the request from android framework. A C/C++ layer with purely vendor specific implementation. Packaged into modules (.so) file & loaded by Android system at appropriate time
Embedded Android system development workshop is focused on integrating new device with Android framework. Our hands-on approach makes Emertxe as the best institute to learn android system development training. This workshop deep dives into Android porting, Android Hardware Abstraction Layer (HAL), Android Services and Linux device driver ecosystem. This workshop based training program will enable you to efficiently integrate new hardware with Android HAL / Framework.
Android Things is the latest attempt from Google to connect the dots between the cloud and devices by introducing an OS that is exclusively built for IoT devices. Initially announced as project Brillo, Android Things helps developers to build devices faster and enable them integrate with cloud services. This presentation traces the architectural aspects of Android Things by connecting it back with Embedded Linux, Embedded Android and Brillo.
Android graphic system (SurfaceFlinger) : Design Pattern's perspectiveBin Chen
SurfaceFlinger is a vital system service in Android system, responsible for the composting all the application and system layer and displaying them. In this slide,we looked in detail how surfaceFlinger was designed from Design Pattern's perspective.
Slides from Android Builder's Summit 2014 in San Jose, CA
In this talk I describe the internal workings of the Android graphics stack from the Application layer down through the stack to pixels on the screen. It is a fairly complex journey, taking in two different 2D rendering engines, applications calling OpenGL ES directory, passing buffers on to the system compositor, SurfaceFlinger, and then down to the display controller or frame buffer.
There is a surge in number of sensors / devices that are getting connected under the umbrella of Internet-Of-Things (IoT). These devices need to be integrated into the Android system and accessed via applications, which is covered in the course. Our Android system development course curriculum over weekends with practicals ensures you learn all critical components to get started.
I have tried to present maximum detail on android booting sequence in a very abstract way. I hope it would be useful. If you find any correction needed please mention it on comments. Happy Coding :)
Embedded Android System Development - Part II talks about Hardware Abstraction Layer (HAL). HAL is an interfacing layer through which Android service can place a request to device. Uses functions provided by Linux system to service the request from android framework. A C/C++ layer with purely vendor specific implementation. Packaged into modules (.so) file & loaded by Android system at appropriate time
Embedded Android system development workshop is focused on integrating new device with Android framework. Our hands-on approach makes Emertxe as the best institute to learn android system development training. This workshop deep dives into Android porting, Android Hardware Abstraction Layer (HAL), Android Services and Linux device driver ecosystem. This workshop based training program will enable you to efficiently integrate new hardware with Android HAL / Framework.
Android Things is the latest attempt from Google to connect the dots between the cloud and devices by introducing an OS that is exclusively built for IoT devices. Initially announced as project Brillo, Android Things helps developers to build devices faster and enable them integrate with cloud services. This presentation traces the architectural aspects of Android Things by connecting it back with Embedded Linux, Embedded Android and Brillo.
Android graphic system (SurfaceFlinger) : Design Pattern's perspectiveBin Chen
SurfaceFlinger is a vital system service in Android system, responsible for the composting all the application and system layer and displaying them. In this slide,we looked in detail how surfaceFlinger was designed from Design Pattern's perspective.
Slides from Android Builder's Summit 2014 in San Jose, CA
In this talk I describe the internal workings of the Android graphics stack from the Application layer down through the stack to pixels on the screen. It is a fairly complex journey, taking in two different 2D rendering engines, applications calling OpenGL ES directory, passing buffers on to the system compositor, SurfaceFlinger, and then down to the display controller or frame buffer.
There is a surge in number of sensors / devices that are getting connected under the umbrella of Internet-Of-Things (IoT). These devices need to be integrated into the Android system and accessed via applications, which is covered in the course. Our Android system development course curriculum over weekends with practicals ensures you learn all critical components to get started.
I have tried to present maximum detail on android booting sequence in a very abstract way. I hope it would be useful. If you find any correction needed please mention it on comments. Happy Coding :)
Veda Solutions Providing Training for Embedded Linux Platform Developer. Here are the Introductions and course details. http://techveda.org/embedded-linux-platform-developer/
Linux Kernel Platform Development: Challenges and InsightsGlobalLogic Ukraine
This presentation is about the main tasks which Linux kernel platform engineers take care of. The talk includes real-life cases which help understand the role of respective specialists and might be helpful to those who consider such change in their careers.
The talk was delivered by Sam Protsenko (Software Engineer, Consultant, GlobalLogic) at GlobalLogic Embedded Career Day #2 on February 10, 2018.
More about GlobalLogic Embedded Career Day #2: https://www.globallogic.com/ua/events/globallogic-kyiv-embedded-career-day-2-materials
This presentations introduces some common protocols used in electronics, and how to sniff/speak them. Then a bit about USB, and some interesting hacks with these things.
Then a bit about openwrt and router hacking.
The IoT is becoming extremely popular keyword in the industries while there are many different interpretations or various definitions. However, one common requirement is that it requires many Sensor devices connected to Linux devices. The user space drivers for GPIO, I2C/SPI and UART sensors in the past were implemented separately from scratch delicately for each product. This will cause significant challenge of software engineering overhead while GPIO, I2C/SPI and UART sensors are dramatically increasing which have to be supported. The IoTDK is one of the library to provide portability of sensors' driver to solve the situation.
The talk will includes guide of IoTDK and 96Boards and tutorial of programing I2C and GPIO devices. Targeted audiences are who are interested in IoT sensors or who would like to move from Arduino and Raspberry Pi to modern ARM CPU effectively.
This presentation was delivered at LinuxCon Japan 2016 by Akira Tsukamoto.
Introduction to Linux Kernel by Quontra SolutionsQUONTRASOLUTIONS
Course Duration: 30-35 hours Training + Assignments + Actual Project Based Case Studies
Training Materials: All attendees will receive,
Assignment after each module, Video recording of every session
Notes and study material for examples covered.
Access to the Training Blog & Repository of Materials
Pre-requisites:
Basic Computer Skills and knowledge of IT.
Training Highlights
* Focus on Hands on training.
* 30 hours of Assignments, Live Case Studies.
* Video Recordings of sessions provided.
* One Problem Statement discussed across the whole training program.
* Resume prep, Interview Questions provided.
WEBSITE: www.QuontraSolutions.com
Contact Info: Phone +1 404-900-9988(or) Email - info@quontrasolutions.com
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSDLinaro
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
Speakers: Mathieu Poirier
Date: September 27, 2016
★ Session Description ★
The CoreSight framework available in the Linux kernel has recently been integrated with the standard Perf trace system, making HW assisted tracing on ARM systems accessible to developers working on a wide spectrum of products. This presentation will start by giving a brief overview of the CoreSight technology itself before presenting the current solution, from trace collection in kernel space to off system trace decoding. To help with the latter part the Open CoreSight Decoding Library (openCSD) is introduced. OpenCSD is an open source library assisting with the decoding of collected trace data. We will see how it is used with the existing perf tools to provide an end-to-end solution for CoreSight trace decoding. The presentation will conclude with trace acquisition and decoding scenarios, along with tips on how to interpret trace information rendered by the perf tools.
★ Resources ★
Etherpad: pad.linaro.org/p/las16-210
Presentations & Videos: http://connect.linaro.org/resource/las16/las16-210/
★ Event Details ★
Linaro Connect Las Vegas 2016 – #LAS16
September 26-30, 2016
http://www.linaro.org
http://connect.linaro.org
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...Yandex
Lightweight virtualization", also called "OS-level virtualization", is not new. On Linux it evolved from VServer to OpenVZ, and, more recently, to Linux Containers (LXC). It is not Linux-specific; on FreeBSD it's called "Jails", while on Solaris it’s "Zones". Some of those have been available for a decade and are widely used to provide VPS (Virtual Private Servers), cheaper alternatives to virtual machines or physical servers. But containers have other purposes and are increasingly popular as the core components of public and private Platform-as-a-Service (PAAS), among others.
Just like a virtual machine, a Linux Container can run (almost) anywhere. But containers have many advantages over VMs: they are lightweight and easier to manage. After operating a large-scale PAAS for a few years, dotCloud realized that with those advantages, containers could become the perfect format for software delivery, since that is how dotCloud delivers from their build system to their hosts. To make it happen everywhere, dotCloud open-sourced Docker, the next generation of the containers engine powering its PAAS. Docker has been extremely successful so far, being adopted by many projects in various fields: PAAS, of course, but also continuous integration, testing, and more.
Running Applications on the NetBSD Rump Kernel by Justin Cormack eurobsdcon
Abstract
The NetBSD rump kernel has been developed for some years now, allowing NetBSD kernel drivers to be used unmodified in many environments, for example as userspace code. However it is only since last year that it has become possible to easily run unmodified applications on the rump kernel, initially with the rump kernel on Xen port, and then with the rumprun tools to run them in userspace on Linux, FreeBSD and NetBSD. This talk will look at how this is achieved, and look at use cases, including kernel driver development, and lightweight process virtualization.
Speaker bio
Justin Cormack has been a Unix user, developer and sysadmin since the early 1990s. He is based in London and works on open source cloud applications, Lua, and the NetBSD rump kernel project. He has been a NetBSD developer since early 2014.
1. Porting Android to
New Hardware
AnDevCon – March 9th 2011
Karim Yaghmour / @karimyaghmour
2. About ...
● Author of:
● Introduced Linux Trace Toolkit in 1999
● Originated Adeos and relayfs (kernel/relay.c)
3. 1. Components to port
2. Cross-development toolchain
3. Porting the bootloader
4. Porting the Linux kernel
5. Developing device drivers
6. Getting the AOSP
7. Implementing Android hardware libs
8. Customizing the user-space
9. Building the AOSP
10. Components to write to flash
4. 1. Components to port
CPU
CPU Model Target Board
Architecture
GNU toolchain X X
bootloader X X
Kernel X X X
Bionic X
OSS packages X
Dalvik X
Hardware libs X X
6. 3. Porting the bootloader
● Check aosp/bootable/bootloader/legacy
● README
● fastboot_protocol.txt
● CPU support:
● include/[cpu]/*
● arch_[cpu]/*
● Board support:
● Have your pick ...
7. 4. Porting the Linux kernel
● Requirements
● Kernel Architecture
● Androidisms
● Which kernel to start from
● An intro to kernel source layout
● Using a JTAG debugger
8. 4.1. Requirements
● Kernel is loaded in RAM and run by bootloader
● Board schematics
● Physical memory map
● Chip timings
● Receiving proper boot parameters from
bootloader
11. 4.4. Which kernel to start from
● Google:
● http://android.git.kernel.org/
● Vanilla:
● http://www.kernel.org
● Either way ... you're screwed:
● Android kernel is a fork
● No resolution in sight
● Cannot use vanilla kernel as-is ... wakelocks
12. 4.5. An intro to kernel source layout
arch 112MB => architecturedependent functionality
block 600KB => block layer
Documentation 17MB => main kernel documentation
drivers 231MB => all drivers
fs 31MB => virtual filesystem and all fs types
include 20MB => complete kernel headers
init 150KB => kernel startup code
ipc 224KB => System V IPC
kernel 4.7MB => core kernel code
mm 2.2MB => memory management
net 20MB => networking core and protocols
scripts 1.1MB => scripts used to build kernel
tools 2.1MB => misc. kernelrelated tools
15. ● drivers/
accessibility cpufreq hwmon mca parisc sbus uio
acpi cpuidle i2c md parport scsi usb
amba crypto ide media pci serial uwb
ata dca idle memstick pcmcia sfi vhost
atm dio ieee802154 message platform sh video
auxdisplay dma infiniband mfd pnp sn virtio
base edac input misc power spi vlynq
block eisa isdn mmc pps ssb w1
bluetooth firewire Kconfig mtd ps3 staging watchdog
cdrom firmware leds net rapidio tc xen
char gpio lguest nubus regulator telephony zorro
clocksource gpu macintosh of rtc thermal
connector hid Makefile oprofile s390 tty
include/
●
acpi config drm keys math-emu mtd pcmcia rxrpc sound video
asm-generic crypto Kbuild linux media net rdma scsi trace xen
16. ● Looking for something:
●
Try grep
● Have a look at the Linux Cross-Referencing project:
– URL: http://lxr.linux.no/
– Code: http://lxr.sourceforge.net/
● Advanced kernel searching/understanding:
– CScope: http://cscope.sourceforge.net/
– KScope front-end: http://kscope.sourceforge.net/
● ETAGS (emacs)
17. 4.6. Using a JTAG debugger
● Allows debugging of:
● Bootloader
● Early kernel code
● Device drivers
● Need to find one that supports Linux kernel:
● Abatron
● Lauterbach
● GreenHills Software
● ...
18. 5. Developing device drivers
● Everything in Unix is a file, including devices
● Get a copy of Linux Device Drivers, 3rd ed.
● BTW, emulator kernel doesn't allow modules >:(
● Use standard Linux model API
● Try avoiding wakelocks in drivers
● Use modules for development
● Build drivers in when you ship
● Remember: kernel is GPL, drivers are ... ???
● Try using user-space “drivers” for proprietary parts
● Android actually promotes use of user-space hardware libs
19. 5.1. User space vs. kernel space
● Separate address space:
● No explicit references to objects from other space
● Memory protection amongst processes:
● No process can directly access or alter other processes' memory areas.
● Memory protection between processes and kernel:
● No process can access anything inside the kernel
● Processes that attempt die (segfault)
● Crossing between user space and kernel space is through specific events
23. 6. Getting the AOSP
● Code-drop every ~6 months
● Location:
● http://android.git.kernel.org/
● Get “repo”:
$ curl http://android.git.kernel.org/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
● Fetch the AOSP:
● Make sure you fetch a tagged release
● Gingerbread:
$ repo init -u git://android.git.kernel.org/platform/manifest.git -b gingerbread
$ repo sync
24. 6.1. AOSP content
bionic C library replacement
bootable Reference bootloader
build Build system
cts Compatibility Test Suite
dalvik Dalvik VM
development Development tools
device Device-specific files and components
external Copy of external projects used by AOSP
frameworks System services, android.*, Android-related cmds, etc.
hardware Hardware support libs
libcore Apache Harmony
ndk The NDK
packages Stock Android apps, providers, etc.
prebuilt Prebuilt binaries
sdk The SDK
system pieces of the world that are the core of the embedded linux platform at
the heart of Android.
25. 6.2. Useful pointers
● See the build system doc at source.android.com
● Check out device/ in AOSP
● Check out Cyanogenmod
● Check out xda-developers
26. 7. Implementing Android hardware libs
Bluetooth BlueZ through D-BUS IPC (to avoid GPL contamination it seems)
GPS Manufacturer-provided libgps.so
Wifi wpa_supplicant
Display Std framebuffer driver (/dev/fb0)
Keymaps and Keyboards Std input event (/dev/event0)
Lights Manufacturer-provided liblights.so
Backlight
Keyboard
Buttons
Battery
Notifications
Attention
Audio Manufacturer-provided libaudio.so (could use ALSA underneath ... at least as illustrated in their porting guide)
Camera Manufacturer-provided libcamera.so (could use V4L2 kernel driver underneath ... as illustrated in porting guide)
Power Management “Wakelocks” kernel patch
Sensors Manufacturer-provided libsensors.so
Accelerometer
Magnetic Field
Orientation
Gyroscope
Light
Pressure
Temperature
Proximity
Radio Layer Interface Manufacturer-provided libril-<companyname>-<RIL version>.so
27. 8. Customizing the user-space
● Boot screen
● Status bar
● Network
● Preloaded apps
● Browser bookmarks
● Email provider customization
● Themes
● Adding new applications
● Adding new services / new hardware type
● Init
28. 8.1. Boot screen
● Create 320x480 image
● Install imagemagick
$ sudo apt-get install imagemagick
● Convert image to .r format
$ sudo apt-get install imagemagick
● Convert image to 565 format
$ rgb2565 < screen.rgb > screen.565
● Write image to flash
$ fastboot flash splash1 screen.565
29. 8.2. Status bar
● Location:
● frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar
● Look for:
● mService.setIcon(...)
● Disable icons with:
● mService.setIconVisibility(“[ICON_NAME]", false);
34. 8.7. Themes
● See
framework/base/core/res/res/values/styles.xml
35. 8.8. Adding new applications
● Add application in packages/apps
● Can use Eclipse to create initial version
● Copy Eclipse project to packages/apps
● Add an appropriate Android.mk file to project
● Add project to PRODUCT_PACKAGES
36. 8.9. Adding new services / new
hardware type
● Add new service to System Server
● Define hardware API for apps
● May need to create new SDK ...
● Have new service use JNI to access hardware lib
● Implement appropriate driver
37. 8.10. Init
● Android init semantics are different from:
● System V init
● Busybox init
● See “Android Init Language” doc in porting guide
● See init.rc examples:
● Emulator's init.rc
● device/[manufacturer]/[device]/init.rc
● Global “properties” that can be set and read
● Can be used to tweak low-memory conditions
39. ● Fix a few symbolic links:
$ sudo ln -s /usr/lib32/libstdc++.so.6 /usr/lib32/libstdc++.so
$ sudo ln -s /usr/lib32/libz.so.1 /usr/lib32/libz.so
● Set up build environment:
$ . build/envsetup.sh
$ lunch
● Launch build and go watch tonight's hockey game:
$ make -j2
● ... though you should check your screen at breaks ...
● Just launch emulator when it's done:
$ emulator &
40. ● Some nice tricks:
● See build/envsetup.sh for commands
● Use “lunch” from AOSP root to set env vars
– You'll need that if you come back later and want to
relaunch emulator from AOSP root.
41. 10. Components to write to flash
● See out/target/product/[product]/*.img
● Typically:
● Bootloader
● boot (kernel and ramdisk)
● system (/system)
● userdata (/data)