Android-X86 Project Marshmallow Porting
Total Page:16
File Type:pdf, Size:1020Kb
Android-x86 Project Marshmallow Porting https://docs.google.com/presentation/pub? id=1mUQDFaERipwQQWHiZxmkvwPXNPlqtdv9lXrY5hPoUJ4 黃志偉 [email protected] 2015/11/28 http://cwhuang.info android-x86.org Agenda ●Introduction: what, why, how? ●History and milestones, current status ●How to develop android-x86 ●Inside android-x86 ●App compatibility issues ●What we contributed? ●Difficulties and challenges ●Live Demo? android-x86.org Introduction ●What's Android-x86? ●Why needs Android-x86? ●How can we do it? android-x86.org What's Android-x86 ? ●An open source project aimed to provide a complete solution for Android on x86 devices. ●At first we use ASUS Eee PC and virtual box as the reference platform. ●Some vendors donate tablets to us, like Tegatech Tegav2, 4tiitoo AG WeTab and AMD. ●BSP (Board support Package) for x86 platform android-x86.org Why needs Android for x86? ●Android is an open source operating-system designed for arm platform ●But it's open source, we can port it to other platforms? ● Mips porting (MIPS Technology) ● PowerPC porting ● Mentor Graphics ● Power.org ● x86 porting android-x86.org But what are the benefits? ●Understanding Android porting process ●The x86 platform is widely available ●As a test platform, much faster than SDK emulator ●Android-x86 on vbox / vmware ●Suitable for tablet apps android-x86.org Android architecture android-x86.org How to do that? ●Toolchains – already in AOSP, but old... ●Kernel – almost works, except power management, drivers ●Libraries – bugfixes or improvements ● Building time – bionic, llvm, ppp, v8, ... ● Runtime – bluetooth, vold, ... ●HAL (hardware abstraction layer) ●Framework / app ●Android 4.0 (ICS) is the first Android version that can be built for x86 without patches. However, to make it run on a real x86 device, there are still a lot of work to do. android-x86.org History (2009) ●Mar: Not maintained, need patches ●Apr: Patch hosting for android x86 support by Yi Sun <beyounn at gmail.com> ●May: Hard to maintain and sync with upstream ●Jun: Need a common, complete code base ●Jul: android-x86.org, release v0.9 ●Aug: Build 20090820 ●Sep: Build 20090916 ●Oct: Build 20091024 ●Nov: Android-x86 1.6 released ●Dec: Eclair 2.0 porting android-x86.org History (2010) ●Jan: Build 20100115 (Android 2.0) ●Feb: Create eclair-x86 branch (Android 2.1) ●Mar: Android-x86 1.6-r2 released ●Apr: Eclair-x86 updated to 2.1-update1 ●Jul: Working on froyo-x86 ●Aug: A test iso for vm released ●Sep: target eeepc, i915 HAL, 3G support ●Oct: 3D hardware acceleration ●Nov: Improved vold, target viewpad10 ●Dec: Installer read-write support, i965 support android-x86.org History (2011) ●Jan: Android-x86 2.2 released ●Feb: Gingerbread-x86 branch (Android 2.3) ●Mar: Honeycomb-x86 porting (private) ●Jul: Android-x86 2.2-r2 released ●Aug: Android-x86 2.3-RC1 released ●Nov: Android-x86 3.2-RC2 released ●Dec: ICS-x86 branch (Android 4.0) android-x86.org History (2012) ●Jan: Build 20120101 ●Feb: Android-x86 4.0-RC1 released ●Apr: Update ics-x86 to 4.0.4 ●Jul: Android-x86 4.0-RC2 released ●Nov: Jb-x86 porting based on Android 4.2 ●Jul: Build 20121225 (Android 4.2) android-x86.org History (2013) ●Feb: Build 20130228 (Android 4.2) ●Jun: Android-x86 4.0-r1 released ●Jul: Build 20130725 (Android 4.3) ●Nov: Kitkat-x86 porting based on Android 4.4 android-x86.org History (2014) ●Feb: Android-x86 4.4-RC1 released ●Apr: Add ntfs/exfat/ext4 support to vold ●May: Android-x86 4.4-RC2 released ●Aug: Android-x86 4.4-r1 released ●Nov: Lollipop-x86 porting based on Android 5.0 ●Dec: Kernel 3.18 porting android-x86.org History (2015) ●Jan: Android-x86 4.4-r2 released ●Mar: Lollipop-x86 updated to Android 5.1 ●Apr: Kernel 4.0 porting ●Oct: Android-x86 5.1-rc1 released ●Oct: Marshmallow-x86 porting for Android 6.0 ●Oct: Move git server to SourceForge android-x86.org Analytics: www.android-x86. org android-x86.org Visitors map overlay android-x86.org Statistics (2009/08-2012/04) ●Visits: 7,212,717 ●Unique Visitors: 4,447,993 ●Pageviews: 15,503,549 ●Top 5 Country/Territory ● United States ● South Korea ● Germany ● Russia ● China android-x86.org Features of lollipop-x86 ●Android 5.1.1 (Lollipop-MR1) based ●Support both 32-bit and 64-bit systems ●Kernel 4.0.9, KMS enabled, support netbook/tablet native resolution ●Live CD & disk installer, support ext4/ext3/ext2/ntfs/fat32 ●Provide hybrid iso image and EFI image ●Hardware 3D acceleration (intel/radeon/nvidia chipsets) ●Wifi, Bluetooth and Audio support ●Auto-detect drivers ●Touchscreen support, including calibration ●Compressed filesystem (squashfs) ●Support virtual machine like Virtual Box, Qemu and VMware ●Debug mode (busybox, mksh, …) android-x86.org Screenshots android-x86.org Develop android-x86 ●Get the source tree ●Create a target (optional) ●Customize kernel (optional) ●Build an iso ●Test on target device android-x86.org Get source ●The git server ● git.androidx86.org ● android-x86.git.sf.net $ repo init -u git://gitscm.sf.net/gitroot/android- x86/manifest \ -b marshmallow-x86 $ repo sync android-x86.org Generic target ●Device tree under ■ device/generic/x86 ■ device/generic/x86_64 ■ device/generic/common ●BoardConfig.mk android-x86.org BoardConfig.mk ●BOARD_GPU_DRIVERS := i915 i965 r600g swrast i915g nouveau r300g vmwgfx ●WPA_SUPPLICANT_VERSION := VER_0_8_X or VER_0_6_X ●TARGET_ARCH_VARIANT:= x86 or x86-atom ●include $(GENERIC_X86_CONFIG_MK) android-x86.org Build kernel ●Building rules under $(TOP)/build/core/tasks/kernel.mk ●Each target can specify its own kernel config ●Kernel image and modules are built on-fly ●Build kernel solely: make kernel ➔ out/target/product/$TARGET/kernel ➔ out/target/product/$TARGET/system/lib/modules/ android-x86.org Customize kernel ●$ source build/envsetup.sh ●$ lunch android_x86(_64)-userdebug ●$ make -C kernel O=$OUT/obj/kernel \ ARCH=x86 menuconfig ●$ cp $OUT/obj/kernel/.config kernel/arch/x86/configs/ ●DO NOT make in kernel/ directly. If you do so, try $ make -C kernel distclean $ rm -rf $OUT/obj/kernel android-x86.org Build an iso image ●$ source build/envsetup.sh ●$ lunch $target-userdebug ●$ make -jN iso_img ● out/target/product/$target/$target.iso {kernel,initrd.img,installer.img,ramdisk.img,system.sfs} ●Compress filesystem if mksquashfs is available (Disable it by USE_SQUASHFS=0) android-x86.org Test the iso image ●Hybrid iso format ●Create a bootable USB ● dd if=target.iso of=/dev/sdX ● Unetbootin ● Linux Live USB Creator ( LiLi ) ●Boot from the USB disk ● Live mode ● VESA mode ● Debug ● Installer android-x86.org Inside android-x86 ●Bootstrap ●Peripherals support ● Graphic hardware acceleration ● Wifi ● Touchscreen ● Audio ● Bluetooth ● GPS ● G-sensor ● 3G modem ● Storage android-x86.org Bootstrap android-x86 ●Bootloader (grub) loads kernel & initrd.img ●init script (bootable/newinstaller/initrd/init) ● Detect android-x86 filesystem ● Unpack ramdisk.img, mount /android/system ● Load scripts (/scripts, /src/scripts) ● Run installer if INSTALL=1 ● Load modules (auto-detect) ● mount /android/data, /android/sdcard ● Run ts_calibrate if BOARD_USES_TSLIB=true ● Set DPI ● Post detect ● switch_root (chroot) /android android-x86.org Init hook scripts ●Default scripts ● 0-auto-detect ● 1-install ● 2-mount ● 3-tslib ● 4-dpi ●Target script ●Customize scripts android-x86.org Revise booting ●Boot parameters can be put to cmdline ● ROOT ● SRC ● DATA, SDCARD ● EXTMOD ● DEBUG ● UVESA_MODE ● HWACCEL ● BOARD_USES_TSLIB ● DPI ●Put scripts in $SRC/scripts/ android-x86.org Debug mode ●Boot by DEBUG=1 ●Write boot log to /tmp/log ●Enter interactive shell twice ● After mount android filesystem ● Before chroot ●Another two virtual consoles at Alt-F2 / F3 ●Run android-x86 in chroot ● Be able to access files outside android filesystem at Alt-F2 / F3 (e.g., /mnt/grub/menu.lst) ●Auto start logcat (/data/log.txt) android-x86.org Graphic system ●Android uses framebuffer driver, no X ● vesa driver ● uvesa driver ● hardware driver - KMS or non-KMS ●Use soft rendering by default ● Buggy for 1366x768 ● Very slow in 32-bit color depth ●Implements hardware rendering by Mesa library ● Needs KMS driver android-x86.org How to change resolution? ●vesa driver vga=xxx, vga=ask ●uvesa driver UVESA_MODE= ●hardware driver, no Mesa video=1280x800-32 ●KMS + Mesa setprop debug.drm.mode 1024x768 android-x86.org Mesa porting for HW acceletion Android graphic system ●Version 11.0.3 ●~ 60 fps ●Support drm_gralloc (HAL) ● Intel integrated graphic chip ● AMD radeon/radeonsi libGLES_mesa ● Nvidia (nouveau) ● Vmware? (vmwgfx) libdrm ●Not support ● Intel Atom Zxxx, E6xx (PowerVR) Kernel KMS driver GPU hardware android-x86.org Wifi ●Android-x86 adds patches to auto-detect wifi driver ● /sys/class/net/*/wireless ●WPA_SUPPLICANT_VERSION := ● VER_0_8_X ● VER_0_6_X ●BOARD_WPA_SUPPLICANT_DRIVER := ● NL80211 (0_8) ● AWEXT (0_6) ●BOARD_WPA_SUPPLICANT_PRIVATE_LIB := ● private_lib_driver_cmd (0_8) android-x86.org Touchscreen ●ICS needs an idc file for touchscreen ● VID & PID ● Device name ●Android-x86 uses a default GenericTouch.idc if no special idc found for a touchscreen. ●Most touchscreens should just work if drivers are available. android-x86.org Touchscreen driver ●May need to load driver by EXTMOD ●May need to calibrate by setting BOARD_USES_TSLIB=true ●Most new multi-touch touchscreens are supported by hid-multitouch driver. echo 3 03eb 201c 1 > \ /sys/module/hid_multitouch/drivers/hid:hid-multitouch/new_id ●Multi-touch issues can be reported to Benjamin Tissoires, who has great help to android-x86.org. android-x86.org Audio ●Audio HAL has been changed in ICS. WindRiver’s implementation