http://ppt.a1ex.wang/md/android-x86.md?print=1 1/12 - - PowerPoint PPT Presentation

http ppt a1ex wang md android x86 md print 1 1 12 9 24
SMART_READER_LITE
LIVE PREVIEW

http://ppt.a1ex.wang/md/android-x86.md?print=1 1/12 - - PowerPoint PPT Presentation

9/24/2016 chroot android linux - By http://ppt.a1ex.wang/md/android-x86.md?print=1 1/12 9/24/2016 chroot android linux


slide-1
SLIDE 1

9/24/2016 用chroot的在android上跑linux图形应用程序 - By 王奥丞 http://ppt.a1ex.wang/md/android-x86.md?print=1 1/12

王奥丞 计算机系

slide-2
SLIDE 2

9/24/2016 用chroot的在android上跑linux图形应用程序 - By 王奥丞 http://ppt.a1ex.wang/md/android-x86.md?print=1 2/12

Linux GUI App on Android

slide-3
SLIDE 3

9/24/2016 用chroot的在android上跑linux图形应用程序 - By 王奥丞 http://ppt.a1ex.wang/md/android-x86.md?print=1 3/12

目标

将android变成一个生产力工具, 不只是一个手机操作系统 android­studio, opengl应用程序 Demo

slide-4
SLIDE 4

9/24/2016 用chroot的在android上跑linux图形应用程序 - By 王奥丞 http://ppt.a1ex.wang/md/android-x86.md?print=1 4/12

Linux GUI App在桌面Linux上如何运行1

slide-5
SLIDE 5

9/24/2016 用chroot的在android上跑linux图形应用程序 - By 王奥丞 http://ppt.a1ex.wang/md/android-x86.md?print=1 5/12

Linux GUI App在桌面Linux上如何运行2

  • 1. 动态库问题
  • 2. X.org的X Server实现复杂难以复用, 自己实现X11 Protocol?
  • 3. 直接操作framebuffer, 或者直接访问driver, 移植性差
slide-6
SLIDE 6

9/24/2016 用chroot的在android上跑linux图形应用程序 - By 王奥丞 http://ppt.a1ex.wang/md/android-x86.md?print=1 6/12

Wayland Architecture

放弃XWindow的架构, 用Wayland的架构 用Android提供API来实现显示和input事件处理

slide-7
SLIDE 7

9/24/2016 用chroot的在android上跑linux图形应用程序 - By 王奥丞 http://ppt.a1ex.wang/md/android-x86.md?print=1 7/12

chroot + archlinux

修改当前进程和子进程的根目录 在该环境下安装archlinux arch和android共享kernel和/proc, /dev, /sys少数几个目录 解决动态库问题 新的根目录结构

/ -> Original /data/arch/chroot |-- dev -> Original /dev |-- proc -> Original /proc |-- sys -> Original /sys |-- mnt -> Original / |-- data -> Original /data |-- bin |-- etc |-- usr |-- lib ...

slide-8
SLIDE 8

9/24/2016 用chroot的在android上跑linux图形应用程序 - By 王奥丞 http://ppt.a1ex.wang/md/android-x86.md?print=1 8/12

Weston + image­backend

Weston是wayland协议的一个实现, 支持多种后端fb, drm...

slide-9
SLIDE 9

9/24/2016 用chroot的在android上跑linux图形应用程序 - By 王奥丞 http://ppt.a1ex.wang/md/android-x86.md?print=1 9/12

App

定时读取/tmp/image.bin内容, 显示到SurfaceView 重写MainActivity的dispatchKeyEvent, dispatchTouchEvent方法, 把消息用protobuf编码发送到unix socket

slide-10
SLIDE 10

9/24/2016 用chroot的在android上跑linux图形应用程序 - By 王奥丞 http://ppt.a1ex.wang/md/android-x86.md?print=1 10/12

GPU support

多次拷贝frame buffer, 可以优化

slide-11
SLIDE 11

9/24/2016 用chroot的在android上跑linux图形应用程序 - By 王奥丞 http://ppt.a1ex.wang/md/android-x86.md?print=1 11/12

In the future

将一个Linux GUI应用程序对应成为一个Android App 修改Android的SurfaceView, 让weston直接写到SurfaceView的 buffer中, 减少一次内存拷贝

slide-12
SLIDE 12

9/24/2016 用chroot的在android上跑linux图形应用程序 - By 王奥丞 http://ppt.a1ex.wang/md/android-x86.md?print=1 12/12

Q&A

Thanks My github: https://github.com/a1exwang