안드로이드 Platform : Porting / Devices / Source / CTS / TV / GMS 
자하랑 - 안드로이드 PXA270 포팅노트
작성자
작성일 2008-03-03 (월) 07:44
ㆍ추천: 0  ㆍ조회: 8356      
IP: 221.xxx.120
 
2008.3.13. 행사의 발표자이기도 한, 자하랑님의 안드로이드 포팅노트입니다.
 
출처 : http://nemustech.blogspot.com/2007_12_01_archive.html
 
2007년 12월 10일 월요일

Android Porting Notes
 
 
 
Here goes the porting guide of Android to real ARM device.

1) Frame Buffer
Android using "fb0" in following order.

1. /dev/graphics/fb0
2. /dev/fb0
You need to tune following factors
* frame buffer size
* use double buffer to "memory mapped files"
* you have to span virtual resolution 2x times in driver inside.
* xres_virtual = xres
* yres_virtual = yres * 2
* double buffering
* using IOCTL command, exchange coordination of yres to y 0

2) Touch Screen
* Android opens input device directly, and returns the absolute coordination of the screen.
* Porting TS-lib to driver and do normarlization of the coordination.
* Do auto calibration using "sysfs" in booting procedure

3) Network
* Android using OS (eg, Linux) network directly, but handle DNS directly.
* DNS lookup order follows
1. /system/etc/hosts lookup
2. system_property [net.eth0.dns1]
* system_property is provided android init process using unix domain socket @property_service
* You should run "init" process for network management.
* You should set up DNS 'net.eth0.dns1' using "/system/bin/setprop", "/etc/default.prop", "/data/local.prob"

4) Init process
Android init do make "device file" and...
1. /data and it's subdir.
2. execute /etc/init.rc
3. make /tmp/eventlog
4. provide system property using unix domain socket @property_service
load following order,
/etc/default.prop
/system/build.prop
/system/default.prop
/data/local.prop
* You shoud start "init" process for proper network/application setting.
* Init opens "/system_properties" and do memory mapping of it.
* JFFS2 filesystem does not support "write" operation of memory mapped I/O
* For device bootstrap, use it's own init program
 
 
2007년 12월 7일 금요일

Android Target Demo Video
 
We've made a video clip of our demonstration.
 
 
We will post another porting guide later.

Thanx!
 
 
2007년 12월 7일 금요일

Android Porting to Real Target HW

 
 
 
After digging Android a few days, we successfully ported Android to our evaluation board
(PXA270, Intel Xscale ARM) including network and touch screen. We know some people already
have done similar work with this, but we didn't find the actual working network/touch device yet.

So we want to share our experience with you guys.

Ok, here goes our working process,

We've chosen the target to Intel bulverde evaluation board. Why this one? Actually there is no
technical reason. Just selected because we have this one for our Linux project, and thought Xscale
would be fit for our project.

Here are the technical spec of our bd,
 
 
 
-------------------------------
Intel Bulverde evaluation board :
- PXA270 520MHz
- SDRAM 128MB
- NAND 32 MB
- 7inch TFT LCD : 800x480
- 2GB USB Storage
-------------------------------

Here are our porting procedure step by step.

* get Linux 2.6.23.8 from kernel.org
* Port 2.6.23.8 to target board
* CONFIG_AEABI=y
* CONFIG_BINDER=y
* CONFIG_LOW_MEMORY_KILLER=y
* CONFIG_INITRAMFS_SOURCE=""
* CONFIG_CC_OPTIMIZE_FOR_SIZE=y
--- EABI toolchain?

* Prepare Filesystems

* rootfs : jffs2 : using acumen270 rootfs as is
* extract android filesystem contents
* / : extract gzipped cpio
* /system & /data : download from benno(http://benno.id.au/blog/ )'s
* build ext2 fs images for /system & /data
* mount /system & /data
* put android files to /etc
init.rc default.prop system.conf system.d init.gprs-pppd init.ril hcid.conf
* put android init-modified in /
* if you have jffs2 for / patch /init
* modify with hexedit : "/system_property" -> "/tmp/sy_property"
* NOTE: jffs2 does not support memory mapped file

* patch /etc/init.rc
---- begin : init.rc
....
## qemu-init {
## exec /etc/qemu-init.sh
## }
network-property {
exec /etc/set_network.sh
}
....
----- end : init.rc


* put this script to /etc/

------ begin : set_networkprop.sh
export PATH=/sbin:/bin:/usr/bin:/system/bin

LOCALIP=`ifconfig|grep "inet addr" |head -1|sed -e
"s/.*addr:([0-9.]*) .*/1/g"`
DNSIP=`nslookup localhost|grep Address|head -1|sed -e "s/.* //g"`

/system/bin/setprop net.eth0.dns1 $DNSIP
/system/bin/setprop net.gprs.local-ip $LOCALIP
/system/bin/setprop ro.radio.use-ppp no
/system/bin/setprop ro.config.nocheckin yes
----- end : set_networkprop.sh

* Execute a-run.sh as root

----- begin : a-run.sh
export PATH=/system/sbin:/system/bin:/sbin:/bin:/usr/bin
export LD_LIBRARY_PATH=/system/lib

export ANDROID_BOOTLOGO=1
export ANDROID_ROOT=/system
export ANDROID_ASSETS=/system/app
export ANDROID_DATA=/data
export EXTERNAL_STORAGE=/sdcard
export DRM_CONTENT=/data/drm/content

### copy Android files to /etc if not exists there.

copy_if_not_in_etc () {
if /usr/bin/test ! -e /etc/$1; then
cp -vR /home/android/etc/$1 /etc
fi
}
copy_if_not_in_etc init.rc
copy_if_not_in_etc default.prop
copy_if_not_in_etc system.conf
copy_if_not_in_etc system.d
copy_if_not_in_etc init.gprs-pppd
copy_if_not_in_etc init.ril
copy_if_not_in_etc hcid.conf
copy_if_not_in_etc set_networkprop.sh

umask 000
/bin/chmod -R a+rw /data /tmp
/bin/chmod a+rw .
/bin/chmod -R a+rw data*

/init-modified &
------ end : a-run.sh

* have fun :)
you may see android with network enabled
-----------------------------------------------
 
 
* NOTICE
(1) you need world wide write permission on
* /data /tmp $PWD
* /dev/binder /dev/fb0
(2) never run dbus-daemon, app_process, runtime by yourself.
(android) init will do it for you
------------------------------------------------------------

Lesson Learned ;
* you don't need /data filesystem image from begining. /init will create
* you need /data /tmp write permissions for other(not root) users (app)
* w/o, app may killed with Segmentation Fault
* you need /init(of android) process for system property service
* / should be ramfs for memory mapped file /system_property created by /init
* you can edit /init with hexedit ; /system_property -> /tmp/sy_property
* you need system property service for network (net.eth0.dns1 for DNS
lookup)
* to see log (in strace detail) you need /dev/log/{main,events,radio}
* just do
# rm /dev/log (if you have)
# mkdir /dev/log;touch /dev/log/{main,events,radio}
* you can see usefull infos from strace log and /dev/log/main
* you may run /init on some directory with write permission.
* init create data/ databases on running directory which cannot found in
emulator.
------------------------------------------------

 
 
ok, done for now, we will keep posting our next improvement later.
If you have any question, leave a message to this blog.

Good Luck!
이름아이콘 그렌라간
2010-07-27 21:06
pxa255 로 학교에서 실습하던 기억이 ... ㅋㅋ
   
 
덧글 쓰기 0
3500
※ 회원등급 레벨 0 이상 읽기가 가능한 게시판입니다.
    N     분류     제목    글쓴이 작성일 조회
481 안드로이드 Native Library 개요 2008-03-03 16360
480 자하랑 - 안드로이드 PXA270 포팅노트 2008-03-03 8356
479 Android System Library 개요 2008-03-03 6869
478 Description of Core Libraries 2008-03-03 3535
477 LibWebCore : Webkit 2008-03-03 3477
476 Webkit (SDK M5 관련 변경) 2008-03-03 2872
475 Android WebKit Build Script 2008-03-03 5405
474 WebKit Build Note 2008-03-03 3435
473 Ten New Things in WebKit 3 2008-03-03 4544
472 SGL : Scalable Graphics Library for 2D 2008-03-03 4738
471 Skia 관련 Header File/Func. 목록 2008-03-03 3966
470 Handheld Embedded Linux System 2008-03-03 2372
469 Graphic 관련 Kernel Config 2008-03-03 3339
468 The Skia Source Code Dilemma 2008-03-03 3999
467 Graphics pipeline (OpenGL State) 2008-03-03 3508
466 Media Libraries 2008-03-03 3413
12345678910,,,31