SlideShare a Scribd company logo
 
Peter McDermott 马 岩
The NthCode Team
Porting Google Android to a Nokia N810 也可以在 NthCode.com 看看
Hear-Say 150 Google Engineers 2 years US$100 Million 687,860,000 人民 币
HTC G1
 
Android Is Java applications Dalvik VM ‘ C’ libraries Linux kernel
Dalvik? Java-like virtual machine But not a Java Why? Google says performance But probably because of $$ Dalvik? Java-like virtual machine But not a Java Why? Google says performance But probably because of $$
Dalvik Write Java foo.java Compile to foo.class apkbuilder foo.class... -> foo.apk foo.apk has foo.dex + metadata Transfer to device Run Dalvik foo.apk
 
Why Did Google Create Android? An open platform Where Google can ... ... make money from advertising?
Google released all the code Open source Royalty free / 免 费 看看 source.android.com 21 October 2008
How Hard Could It Be? We Thought ...
 
Nokia N810 Hardware 400 MHz OMAP 2420 ARM9 800x480 4.1” touch screen 128M RAM 2G flash WiFi Keyboard ** Not a phone ** Runs Linux Maemo US$425 / 2900 元
How Do We Make the N810 Run Android?
Merge Linux Kernel 2.6.21 + N810 Patches Linux Kernel 2.6.25 + Android Patches
Nokia N810 Linux Kernel 2.6.21 + MultiMedia Card driver I2C serial bus driver Touch screen driver Keyboard map Audio and video DSP Direct Memory Access (DMA) Board revision patch System software is Maemo GTK-based Lots of hackers ( 牛 !)
Android Patches Linux Kernel 2.6.25 + Goldfish  YAFFS2 Bluetooth Scheduler IPC binder  Low memory killer Ashmem RAM console & logging Android Debug Bridge (ADB)  Power management Other changes
Goldfish Emulator CPU ARM926T Add 44 Files Not needed in real hardware
YAFFS2 Phones store data in flash memory YAFFS2 = Yet Another Flash File System 2 Optimized for NAND flash chips Add 35 Files Created by Charles Manning for Aleph1 GPL, but not in mainline kernel Integrated into Android by Google PCs store data on disks FAT, ext2, NTFS, xfs, afs ... All optimized for a spinning disk
Bluetooth  蓝呀 Change 10 files Fix headset bugs Add debugging Add access control
Scheduler Change 5 files Change impact not clear
IPC Binder InterProcess Communication (IPC) Add 2 files New kernel API Higher level IPC than standard UNIX
Low Memory Killer Add 3 files Scans processes, kills one New kernel API
Ashmem Anonymous SHared MEMory Add 3 files Named memory block Shared between processes Kernel can free Kernel can’t free standard SHMEM
RAM Console & Logging Add/change 3 files Puts kernel log in RAM Changes implementation Adds user space log read/write APIs New APIs
Android Debug Bridge (ADB) Add 3 files Connects Eclipse to an Android device USB Protocol
Power Management Add/change 5 files New APIs + changes
Other 36 files New APIs + changes Debugging Keypad lights TCP management ...
Which Kernel? Linux Kernel 2.6.21 Linux Kernel 2.6.25
Selected 2.6.25 ~75 files Drivers 163 files Some core OS User space quits if < 2.6.25
Port N810 to 2.6.25 MultiMedia Card driver I2C serial bus driver Touch screen driver Keyboard map Audio and video DSP Direct Memory Access (DMA) Board revision patch
Port N810 to 2.6.25 7 days Download Linux-OMAP git reset --hard v2.6.25-omap1 patch ... Compile/flash/debug/fix
Issue: WiFi No source for WiFi module Can’t recompile module  No WiFi
Apply Android Patches to 2.6.25 Based on Linux 2.6.25 Goldfish YAFFS2 Bluetooth Scheduler IPC binder  Low memory killer Ashmem RAM console & logging Android Debug Bridge (ADB)  Power management Other changes
Android 2 days Android and N810 changes independent
Bring-Up 9 days jffs2 mmap() doesn’t work Switched to ext2 -- data corruption Switched to ext3 -- OK System hang at boot.  Random reboots. Disabled watchdog Booted, but screen blank Applied a double-buffered video patch Sometimes booted, often crashed Copied libs to the N810, fixed crashes Touch screen wouldn’t work, changed power config Keypad not right, so changed keypad config
 
Next Steps Fix intermittent crashes WiFi Android Debug Bridge (ADB) Power off Battery charge
Peter McDermott [email_address] nthcode.com/pubs/porting-android-to-a-new-device.html

More Related Content

PDF
Mirko Damiani - An Embedded soft real time distributed system in Go
PDF
How Linux Processes Your Network Packet - Elazar Leibovich
PDF
Andrea Righi - Spying on the Linux kernel for fun and profit
PDF
YOW2018 Cloud Performance Root Cause Analysis at Netflix
PDF
Kernel Recipes 2015: Kernel packet capture technologies
PPTX
y2038 issue
PDF
Kernel Recipes 2016 - New hwmon device registration API - Jean Delvare
PDF
ATO Linux Performance 2018
Mirko Damiani - An Embedded soft real time distributed system in Go
How Linux Processes Your Network Packet - Elazar Leibovich
Andrea Righi - Spying on the Linux kernel for fun and profit
YOW2018 Cloud Performance Root Cause Analysis at Netflix
Kernel Recipes 2015: Kernel packet capture technologies
y2038 issue
Kernel Recipes 2016 - New hwmon device registration API - Jean Delvare
ATO Linux Performance 2018

What's hot (20)

PDF
Kernel Recipes 2019 - Driving the industry toward upstream first
PDF
Kernel Recipes 2019 - BPF at Facebook
PDF
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning
PPTX
Distributed Compiler Icecc
PDF
Linux 4.x Tracing: Performance Analysis with bcc/BPF
ODP
Android porting for dummies @droidconin 2011
PDF
NetConf 2018 BPF Observability
PPTX
Debugging linux issues with eBPF
PDF
Container Performance Analysis
PDF
Troubleshooting Tips from a Docker Support Engineer
PDF
Linux Tracing Superpowers by Eugene Pirogov
PDF
bcc/BPF tools - Strategy, current tools, future challenges
PDF
UM2019 Extended BPF: A New Type of Software
PDF
Kernel Recipes 2015: Speed up your kernel development cycle with QEMU
PPTX
Dpdk applications
PDF
Long-term Maintenance Model of Embedded Industrial Linux Distribution
PDF
Intel® RDT Hands-on Lab
PDF
Systems@Scale 2021 BPF Performance Getting Started
PPT
Libpcap
PDF
Kernel development
Kernel Recipes 2019 - Driving the industry toward upstream first
Kernel Recipes 2019 - BPF at Facebook
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning
Distributed Compiler Icecc
Linux 4.x Tracing: Performance Analysis with bcc/BPF
Android porting for dummies @droidconin 2011
NetConf 2018 BPF Observability
Debugging linux issues with eBPF
Container Performance Analysis
Troubleshooting Tips from a Docker Support Engineer
Linux Tracing Superpowers by Eugene Pirogov
bcc/BPF tools - Strategy, current tools, future challenges
UM2019 Extended BPF: A New Type of Software
Kernel Recipes 2015: Speed up your kernel development cycle with QEMU
Dpdk applications
Long-term Maintenance Model of Embedded Industrial Linux Distribution
Intel® RDT Hands-on Lab
Systems@Scale 2021 BPF Performance Getting Started
Libpcap
Kernel development
Ad

Similar to NthCode - Porting Google Android To A Nokia N810 (20)

PDF
Porting Android
PDF
Porting Android
PDF
Porting Android ABS 2011
PDF
Android 2.3 Introduction
PPTX
Open-source Android 10 on Orange Pi: myth or reality?
PDF
Linaro and Android Kernel
PPTX
Windows 10 IoT Core on Raspberry Pi 2 Usine IO
PDF
Cookies for kernel developers
PDF
Android developer tools
DOCX
DOCX
PPTX
Introduction To The Beagleboard
PPTX
TUGAS MEMBUAT PRESENTASI TENTANG SPEC KOMPUTER DAN SMARTPHONE
PPTX
ChromePad - Chromium OS for ThinkPad
PPTX
Windows Mobile 6.5 메모리관리
PPTX
ChromePad - Chromium OS ThinkPad X220
PPT
7496_Hall 070204 Research Faculty Summit
PDF
The abcs of gpu
PDF
Webinar: NVIDIA JETSON – A Inteligência Artificial na palma de sua mão
PPT
Embedding Linux On The Encore Simputer
Porting Android
Porting Android
Porting Android ABS 2011
Android 2.3 Introduction
Open-source Android 10 on Orange Pi: myth or reality?
Linaro and Android Kernel
Windows 10 IoT Core on Raspberry Pi 2 Usine IO
Cookies for kernel developers
Android developer tools
Introduction To The Beagleboard
TUGAS MEMBUAT PRESENTASI TENTANG SPEC KOMPUTER DAN SMARTPHONE
ChromePad - Chromium OS for ThinkPad
Windows Mobile 6.5 메모리관리
ChromePad - Chromium OS ThinkPad X220
7496_Hall 070204 Research Faculty Summit
The abcs of gpu
Webinar: NVIDIA JETSON – A Inteligência Artificial na palma de sua mão
Embedding Linux On The Encore Simputer
Ad

Recently uploaded (20)

PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
project resource management chapter-09.pdf
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PPTX
observCloud-Native Containerability and monitoring.pptx
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
Tartificialntelligence_presentation.pptx
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PPTX
The various Industrial Revolutions .pptx
PPTX
Chapter 5: Probability Theory and Statistics
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Hybrid model detection and classification of lung cancer
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
Getting started with AI Agents and Multi-Agent Systems
PPT
Module 1.ppt Iot fundamentals and Architecture
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
project resource management chapter-09.pdf
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
O2C Customer Invoices to Receipt V15A.pptx
observCloud-Native Containerability and monitoring.pptx
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Tartificialntelligence_presentation.pptx
WOOl fibre morphology and structure.pdf for textiles
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
The various Industrial Revolutions .pptx
Chapter 5: Probability Theory and Statistics
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Hybrid model detection and classification of lung cancer
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
Getting started with AI Agents and Multi-Agent Systems
Module 1.ppt Iot fundamentals and Architecture

NthCode - Porting Google Android To A Nokia N810

  • 1.  
  • 4. Porting Google Android to a Nokia N810 也可以在 NthCode.com 看看
  • 5. Hear-Say 150 Google Engineers 2 years US$100 Million 687,860,000 人民 币
  • 7.  
  • 8. Android Is Java applications Dalvik VM ‘ C’ libraries Linux kernel
  • 9. Dalvik? Java-like virtual machine But not a Java Why? Google says performance But probably because of $$ Dalvik? Java-like virtual machine But not a Java Why? Google says performance But probably because of $$
  • 10. Dalvik Write Java foo.java Compile to foo.class apkbuilder foo.class... -> foo.apk foo.apk has foo.dex + metadata Transfer to device Run Dalvik foo.apk
  • 11.  
  • 12. Why Did Google Create Android? An open platform Where Google can ... ... make money from advertising?
  • 13. Google released all the code Open source Royalty free / 免 费 看看 source.android.com 21 October 2008
  • 14. How Hard Could It Be? We Thought ...
  • 15.  
  • 16. Nokia N810 Hardware 400 MHz OMAP 2420 ARM9 800x480 4.1” touch screen 128M RAM 2G flash WiFi Keyboard ** Not a phone ** Runs Linux Maemo US$425 / 2900 元
  • 17. How Do We Make the N810 Run Android?
  • 18. Merge Linux Kernel 2.6.21 + N810 Patches Linux Kernel 2.6.25 + Android Patches
  • 19. Nokia N810 Linux Kernel 2.6.21 + MultiMedia Card driver I2C serial bus driver Touch screen driver Keyboard map Audio and video DSP Direct Memory Access (DMA) Board revision patch System software is Maemo GTK-based Lots of hackers ( 牛 !)
  • 20. Android Patches Linux Kernel 2.6.25 + Goldfish YAFFS2 Bluetooth Scheduler IPC binder Low memory killer Ashmem RAM console & logging Android Debug Bridge (ADB) Power management Other changes
  • 21. Goldfish Emulator CPU ARM926T Add 44 Files Not needed in real hardware
  • 22. YAFFS2 Phones store data in flash memory YAFFS2 = Yet Another Flash File System 2 Optimized for NAND flash chips Add 35 Files Created by Charles Manning for Aleph1 GPL, but not in mainline kernel Integrated into Android by Google PCs store data on disks FAT, ext2, NTFS, xfs, afs ... All optimized for a spinning disk
  • 23. Bluetooth 蓝呀 Change 10 files Fix headset bugs Add debugging Add access control
  • 24. Scheduler Change 5 files Change impact not clear
  • 25. IPC Binder InterProcess Communication (IPC) Add 2 files New kernel API Higher level IPC than standard UNIX
  • 26. Low Memory Killer Add 3 files Scans processes, kills one New kernel API
  • 27. Ashmem Anonymous SHared MEMory Add 3 files Named memory block Shared between processes Kernel can free Kernel can’t free standard SHMEM
  • 28. RAM Console & Logging Add/change 3 files Puts kernel log in RAM Changes implementation Adds user space log read/write APIs New APIs
  • 29. Android Debug Bridge (ADB) Add 3 files Connects Eclipse to an Android device USB Protocol
  • 30. Power Management Add/change 5 files New APIs + changes
  • 31. Other 36 files New APIs + changes Debugging Keypad lights TCP management ...
  • 32. Which Kernel? Linux Kernel 2.6.21 Linux Kernel 2.6.25
  • 33. Selected 2.6.25 ~75 files Drivers 163 files Some core OS User space quits if < 2.6.25
  • 34. Port N810 to 2.6.25 MultiMedia Card driver I2C serial bus driver Touch screen driver Keyboard map Audio and video DSP Direct Memory Access (DMA) Board revision patch
  • 35. Port N810 to 2.6.25 7 days Download Linux-OMAP git reset --hard v2.6.25-omap1 patch ... Compile/flash/debug/fix
  • 36. Issue: WiFi No source for WiFi module Can’t recompile module No WiFi
  • 37. Apply Android Patches to 2.6.25 Based on Linux 2.6.25 Goldfish YAFFS2 Bluetooth Scheduler IPC binder Low memory killer Ashmem RAM console & logging Android Debug Bridge (ADB) Power management Other changes
  • 38. Android 2 days Android and N810 changes independent
  • 39. Bring-Up 9 days jffs2 mmap() doesn’t work Switched to ext2 -- data corruption Switched to ext3 -- OK System hang at boot. Random reboots. Disabled watchdog Booted, but screen blank Applied a double-buffered video patch Sometimes booted, often crashed Copied libs to the N810, fixed crashes Touch screen wouldn’t work, changed power config Keypad not right, so changed keypad config
  • 40.  
  • 41. Next Steps Fix intermittent crashes WiFi Android Debug Bridge (ADB) Power off Battery charge
  • 42. Peter McDermott [email_address] nthcode.com/pubs/porting-android-to-a-new-device.html