What the cylon's red eye is looking for?

225 views
Skip to first unread message

Robert Le Van Mao

unread,
Jan 14, 2008, 12:13:26 PM1/14/08
to Android Internals
Hi all,
I tried to build and run Android on my iMX31 (ARM11) platform. I use
the procedures from:
http://nemustech.blogspot.com/2007/12/android-porting-to-real-target-hw.html
With the images files from:
http://benno.id.au/blog/
Plus info from:
http://euedge.com/blog/2007/12/06/google-android-runs-on-sharp-zaurus-sl-c760/
http://honeypod.blogspot.com/2007_12_01_archive.html

I made sure that all the dir /data /tmp etc. are +rw-tables according
to the recipes. The kernel booted, and I got LCD and console. However,
when I ran the script that started init_modified, I couldn't go beyond
the red eye.

I ran strace on it and all I could see are transient processes keep
forking continously. ps shown that I got zygote process but not dbus-
daemon.

So, how do I know what the ceylon's eye is looking for exactly? And
how could I get more log messages? Your help is greatly appreciated.

joecool

unread,
Jan 15, 2008, 7:13:56 PM1/15/08
to Android Internals
These are my experiences when putting Android to a real hardware:
We're using Freescale's IMX31ADS development board and their BSP which
contains a 2.6.22.6 kernel.
I adopted Benno's android.diff to accommodate this kernel's needs.
As a first step I just built binderdev.ko as a module which works, but
still got us not further than the cyclon's red eye :-(
Furthermore there always was that strange

fatal error opening "/sys/android_power/acquire_partial_wake_lock"

So, after studying http://androidzaurus.seesaa.net/article/74237419.html
I decided to add

CONFIG_ANDROID_POWER=y
CONFIG_ANDROID_POWER_STAT=y
CONFIG_ANDROID_LOGGER=y

to my kernel configuration. The error message above disappear and
Android starts up fine now!
Nevertheless I'm still fighting with the network, the touchscreen and
heavy flickering when starting e.g. the browser.

I hope these hints help on your problem!
Regards,
J.C.

On Jan 14, 6:13 pm, Robert Le Van Mao <rlv...@yahoo.com> wrote:
> Hi all,
> I tried to build and run Android on my iMX31 (ARM11) platform. I use
> the procedures from:http://nemustech.blogspot.com/2007/12/android-porting-to-real-target-...
> With the images files from:http://benno.id.au/blog/
> Plus info from:http://euedge.com/blog/2007/12/06/google-android-runs-on-sharp-zaurus...http://honeypod.blogspot.com/2007_12_01_archive.html

Robert Le Van Mao

unread,
Jan 16, 2008, 9:40:52 AM1/16/08
to Android Internals
OK, I got it too and it took me several hours to port Android to my
i.MX31ADS with linux 2.6.22.6 kernel.
I looked for clues at http://tree.celinuxforum.org/CelfPubWiki/Jamboree18AndroidDemo
and http://www.macrobug.com/blog/ as well.
I used ltib so I ported android stuffs to the 2.6.22 kernel at
$LIB_DIR/rpm/build. What I did included:
1. Added directories to the kernel build
drivers/android
drivers/binder
drivers/lowmemorykiller
include/linux/android*
include/linux/binder*
2. Fixed code to 2.6.22 apis. like adding last argument 0 to
kmem_cache_create, modify mm (struct shrinker stuffs), etc. I added
android Kconfig files to the parent's so I can set Android by doing
>make ARCH=arm CROSS_COMPILE=$(TOOLCHAIN)/arm-no-ea- menuconfig. I
left everything else as before and set these to true:
Andoid power
Low memory killer
Binder
Init ramfs source
3. I cross-compiled the kernel and install the zImage. As for the
rootfs, I kept the old one except I added /data and /system from
benno.
4. Redboot started zImage correctly and I got /dev/android_power and /
dev/binder. I started the init_modified and I got that persistent
"Descriptor2Node failed" error and no Android home screen. So I
chmoded /dev/binder and it seemed to fix the problem (don't ask me
why). I disabled autostart in /etc/init.rc for dbus-daemon,
app_process and runtime.

Then I did this:
export PATH=/sbin:/system/sbin:/system/bin:$PATH
export LD_LIBRARY_PATH=/system/lib
export ANDROID_ROOT=/system
export ANDROID_ASSETS=/system/app
export ANDROID_DATA=/data
export EXTERNAL_STORAGE=/sdcard
export DRM_CONTENT=/data/drm/content

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

/bin/rm -r /dev/log
cd /dev
/bin/ln -s /var/tmp/log log
/bin/rm -f log/*
/bin/touch log/main
/bin/touch log/events
/bin/touch log/radio
cd /

/bin/chmod -R a+rw /dev/binder

/init_modified &
sleep 1
/system/bin/app_process -Xzygote /system/bin --zygote &
/system/bin/dbus-daemon --system --nofork &
strace -f -ff -tt -s 200 -o /tmp/runtimetrace /system/bin/runtime
&

Et voila, android's home page. And same as what you got, I have to fix
the touchscreen and else. After my coffee break.

Anil Sasidharan

unread,
Jan 16, 2008, 10:57:31 PM1/16/08
to android-...@googlegroups.com
Hi,

      I've been having issues with Android porting onto my custom hardware with the following specification:

CPU - ARM11EJS (ARM V6)
RAM - 64MB
Flash - No flash support as of now. Mounting root file-system using NFS

I've followed the instructions given in Benno's blog and I've gone to the state where the red-dote starts moving. But after couple of more strace prints I do see Descriptor2Node failure and sometimes a mmap2 error with the message "Cannot allocate memory" and the strange thing about this error is that the mmap2 was requested for a real big number which looks a strange to me. Another inconsistent error behavior that I observed is that the "runtime" process is creashing due to SIGSEGV and SIGKILL. But I'm clueless about the reason for the same.

I've tried my experiments with 2.6.23 kernel built using Codesourcery toolchain. If you could suggest me some ways to overcome this problem and get onto the Android homescreen, I'll be really grateful.

Looking forward to your reply.....

Warm Regards,
Anil

joecool

unread,
Jan 17, 2008, 3:25:07 AM1/17/08
to Android Internals
So you manged to compile lowmemorykiller?
I had to disable it, since I didn't want to spend to much time in
resolving the compiling issues. I thought 128MB RAM should be enough,
so I won't need the lowmemorykiller ;-)

I also use ltib, but I forgot to mention I switched to Codesourcery's
toolchain and added the option to use the i.MX31's VFP as recommended
in their FAQ (https://support.codesourcery.com/GNUToolchain/kbentry27)

According to your hint I now read the clues at
http://tree.celinuxforum.org/CelfPubWiki/Jamboree18AndroidDemo, which
make me think about the flickering problem I have. Is this related to
the double buffering topic somehow?

I hope I can solve the the network problem I have by adapting the
network related info from http://nemustech.blogspot.com/2007/12/android-porting-to-real-target-hw.html
(if I'm not too busy with other topic today)

I use a similar script to what you posted, but I do not start
app_process, dbus-daemon and runtime, since these are already started
by /init (I do not use /init-modified, I'm on a writeable NFS root
filesystem)

I do not have the slightest clue about the touchscreen not working at
all, but I didn't investigate this at all.
Of course, I'll post all progress with any of the open topics.

Rgards,
J.C.

BTW: do you think it makes sense to give it a try on an i.MX27 (no
VFP)?

nagamatu

unread,
Jan 17, 2008, 6:54:43 AM1/17/08
to Android Internals
i.MX31 video driver has the problem for double buffering.
fb_pan_display does nothing even with the positive yoffset value.
need to comment out next code:

if ((info->var.xoffset == var->xoffset) &&
(info->var.yoffset == var->yoffset)) {
return 0; // No change, do nothing
}

Regards,
nagamatu

Robert Le Van Mao

unread,
Jan 17, 2008, 10:07:03 AM1/17/08
to Android Internals
Yeah, I added drivers/misc/lowmemorykiller because runtime complained
that it couldn't find it.
Essentially I moved the declaration of struct shrinker from vmscan.c
to somewhere visible to
lowmemorykiller.c and use set_shrinker()/remove_shrinker() instead of
register/unregister calls. Could tailor this file to your liking as
well.

I started today to look at the touchscreen and would like to know
where to set/add/modify the input/drivers/else for it.
I got tslib worked fine before Android and my /dev/fb, /dev/ts all
worked fine and well calibrated. Except that Andoid seems not reading
that the correcting input. How to fix that, anyone?

Sorry, have no i.MX27 but will try to do the same on the PXAxx
instead :-)

On Jan 17, 3:25 am, joecool <t...@gmx.net> wrote:
> So you manged to compile lowmemorykiller?
> I had to disable it, since I didn't want to spend to much time in
> resolving the compiling issues. I thought 128MB RAM should be enough,
> so I won't need the lowmemorykiller ;-)
>
> I also use ltib, but I forgot to mention I switched to Codesourcery's
> toolchain and added the option to use the i.MX31's VFP as recommended
> in their FAQ (https://support.codesourcery.com/GNUToolchain/kbentry27)
>
> According to your hint I now read the clues athttp://tree.celinuxforum.org/CelfPubWiki/Jamboree18AndroidDemo, which
> make me think about the flickering problem I have. Is this related to
> the double buffering topic somehow?
>
> I hope I can solve the the network problem I have by adapting the
> network related info fromhttp://nemustech.blogspot.com/2007/12/android-porting-to-real-target-...
> (if I'm not too busy with other topic today)
>
> I use a similar script to what you posted, but I do not start
> app_process,  dbus-daemon and runtime, since these are already started
> by /init (I do not use /init-modified, I'm on a writeable NFS root
> filesystem)
>
> I do not have the slightest clue about the touchscreen not working at
> all, but I didn't investigate this at all.
> Of course, I'll post all progress with any of the open topics.
>
> Rgards,
> J.C.
>
> BTW: do you think it makes sense to give it a try on an i.MX27 (no
> VFP)?
>
> Robert Le Van Mao wrote:
>
>
>
> > OK, I got it too and it took me several hours to port Android to my
> > i.MX31ADS with linux 2.6.22.6 kernel.
> > I looked for clues athttp://tree.celinuxforum.org/CelfPubWiki/Jamboree18AndroidDemo
> > andhttp://www.macrobug.com/blog/as well.
> > the touchscreen and else. After my coffee break.- Hide quoted text -
>
> - Show quoted text -

Robert Le Van Mao

unread,
Jan 17, 2008, 9:11:13 PM1/17/08
to Android Internals
Well, I don't know which mmap2 is failing on your board but mine have
128M RAM (I use mount rootfs too). When the thing came up and before I
start to launch my apps, +59M was used already. So my guess is your
may simply run out of memory.
> > andhttp://www.macrobug.com/blog/as well.

eagle.crying

unread,
Jan 30, 2008, 3:23:56 PM1/30/08
to Android Internals
Hello Joe

I am fighting out here to make the same thing run in my iMX31
Development board . But my kernel gets stuck one it starts loading. I
am not sure how I will be able to debug it as I don't have ARM
debugger here. Can you please provide some information about what all
diff did you do and what all mergs did yo do.

If possible can you please send me your kernel ,which will help me up
atleast boot the kernel so that I can go forward.

Thanking you in advance

Regards

Deepz

On Jan 16, 5:13 am, joecool <t...@gmx.net> wrote:
> These are my experiences when putting Android to a real hardware:
> We're using Freescale's IMX31ADS development board and their BSP which
> contains a 2.6.22.6 kernel.
> I adopted Benno's android.diff to accommodate this kernel's needs.
> As a first step I just built binderdev.ko as a module which works, but
> still got us not further than the cyclon's red eye :-(
> Furthermore there always was that strange
>
> fatal error opening "/sys/android_power/acquire_partial_wake_lock"
>
> So, after studyinghttp://androidzaurus.seesaa.net/article/74237419.html
> I decided to add
>
> CONFIG_ANDROID_POWER=y
> CONFIG_ANDROID_POWER_STAT=y
> CONFIG_ANDROID_LOGGER=y
>
> to my kernel configuration. The error message above disappear and
> Android starts up fine now!
> Nevertheless I'm still fighting with the network, the touchscreen and
> heavy flickering when starting e.g. the browser.
>
> I hope these hints help on your problem!
> Regards,
> J.C.
>
> On Jan 14, 6:13 pm, Robert Le Van Mao <rlv...@yahoo.com> wrote:
>
> > Hi all,
> > I tried to build and run Android on myiMX31(ARM11) platform. I use

ruckuus

unread,
Feb 13, 2008, 3:08:51 AM2/13/08
to Android Internals
Hello,

i have been trying to do the same thing with you. i use iMX31 board
with installed kernel 2.6.19.
i try to get the config file from /proc/config.gz in the running
system. then i extract it to be config
file in my new kernel. i use 2.6.23.8, with some modification
(following procedure from : http://nemustech.blogspot.com/2007/12/android-porting-to-real-target-...)

then i got stuck, i got Bad Magic Number on U-boot.

would you please give me solution to this ?

thank you,

best regards,

ruckuus


On Jan 15, 12:13 am, Robert Le Van Mao <rlv...@yahoo.com> wrote:
> Hi all,
> I tried to build and run Android on my iMX31 (ARM11) platform. I use
> the procedures from:http://nemustech.blogspot.com/2007/12/android-porting-to-real-target-...
> With the images files from:http://benno.id.au/blog/
> Plus info from:http://euedge.com/blog/2007/12/06/google-android-runs-on-sharp-zaurus...http://honeypod.blogspot.com/2007_12_01_archive.html

Akio

unread,
Mar 16, 2008, 4:28:51 AM3/16/08
to Android Internals
Dear All:

right now, I have i.mx27 ADS board with 7" LCM and 7"
touch panel.
So I spend some time to work on the net to found out
what should I do
to make android running on i.MX27. after some works,
I can make android
m3 image running on i.mx27.
the following is what I used:
1. Freescale i.MX27 ADS board with reboot 200749, bsp
20071219.
2. kernel version : 2.6.22-6
3. arm-linux-gcc : 4.1.2
4. android kernel source 2.6.23-m3
5. android on zaursu image.
6. put android image on NFS, and make i.mx27 can
using them via NFS.

after comparing android's kernel source and found out
what had to
add into i.mx27 2.6.22-6 kernel source. I have a very
early workable
kernel source.

after some testing, I found a way to loading android
image and make the
android live on i.mx27.
here is my running script.

#########################################
below is the one which run under i.mx27 linux prompt.
#########################################

#!/bin/sh

echo ""
echo "=================="
echo " Clean temp file "
echo "=================="
echo ""

cat /dev/null > ./home/root/android-root/dev/log/main
cat /dev/null > ./home/root/android-root/dev/log/radio
cat /dev/null > ./home/root/android-root/dev/log/event
rm -f ./home/root/android-root/tmp/*

echo ""
echo "=================="
echo " Loading Binder "
echo "=================="
echo ""

modprobe binderdev
chmod 666 /dev/binder

echo ""
echo "=================="
echo " Starting Android "
echo "=================="
echo ""

umask 000
chroot ./home/root/android-root /start

#########################################
below is the one which run under android linux prompt.
#########################################
#!/system/bin/sh

echo ""
echo "=================="
echo " Initing Android "
echo "=================="
echo ""
export PATH=/sbin:/system/sbin:/system/bin:$PATH
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
mount -t proc proc /proc
mount -t sysfs sysfs /sys
umask 000

echo ""
echo "=================="
echo " Booting Android 0"
echo "=================="
echo ""
/init&
sleep 1

echo ""
echo "=================="
echo " Booting Android 1"
echo "=================="
echo ""
/system/bin/app_process -Xzygote /system/bin --zygote&
sleep 10

echo ""
echo "=================="
echo " Booting Android 3"
echo "=================="
echo ""
runtime

After about 3 mins, the android shows on
i.mx27.

But I have some problems. Could you help me or
give me some hits?
1. How to make touch panel work under android?
2. How to make android network setting to go
outside world?

Thank you very much.

Best Regards,
Akio

Akio

unread,
Mar 16, 2008, 4:29:04 AM3/16/08
to Android Internals


On 2月13日, 下午4時08分, ruckuus <ruck...@gmail.com> wrote:
> Hello,
>
> i have been trying to do the same thing with you. i use iMX31 board
> with installed kernel 2.6.19.
> i try to get the config file from /proc/config.gz in the running
> system. then i extract it to be config
> file in my new kernel. i use 2.6.23.8, with some modification
> (following procedure from :http://nemustech.blogspot.com/2007/12/android-porting-to-real-target-...)
>
> then i got stuck, i got Bad Magic Number on U-boot.
>
> would you please give me solution to this ?
>
> thank you,
>
> best regards,
>
> ruckuus
>
> On Jan 15, 12:13 am, Robert Le Van Mao <rlv...@yahoo.com> wrote:
>
> > Hi all,
> > I tried to build and run Android on my iMX31 (ARM11) platform. I use
> > the procedures from:http://nemustech.blogspot.com/2007/12/android-porting-to-real-target-...
> > With the images files from:http://benno.id.au/blog/
> > Plus info from:http://euedge.com/blog/2007/12/06/google-android-runs-on-sharp-zaurus...
>

Anil Sasidharan

unread,
Mar 17, 2008, 4:21:46 AM3/17/08
to android-...@googlegroups.com
Hi,

Android reads raw X,Y and Pressure info from touch driver.
And the device node being opened for touch is /dev/input/event1.
Regarding the network, you will have to set the DNS and LOCAL-IP using
the setprop utility.

Warm Regards,
Anil

Akio

unread,
Mar 18, 2008, 10:56:56 AM3/18/08
to Android Internals
Dear Anil:

Thank you very much.
Could you show me more? Right now I am digging with
driver/input/*.c and real ts driver on mx27 ADS board.
But I have no idea what is the relationship between ts
driver and driver/input/*.c. I had use strace to trace what
device that android open. After that, I found android
open /dev/input/event0 as key pad for key input. But no
/dev/input/event1. BTW, do I have to do ts calibration
for android? I use /dev/input/event1 as ts input device
under Qtopia Phone Edition 4.3.1 with ts-lib. Thank you
very much.

Best Regards,
Akio


On 3月17日, 下午4時21分, "Anil Sasidharan" <anil...@gmail.com> wrote:
> Hi,
>
> Android reads raw X,Y and Pressure info from touch driver.
> And the device node being opened for touch is /dev/input/event1.
> Regarding the network, you will have to set the DNS and LOCAL-IP using
> the setprop utility.
>
> Warm Regards,

ruckuus

unread,
Mar 18, 2008, 10:44:46 PM3/18/08
to Android Internals
Hi,
Is there any 2.6.19 android kernel version ? i am using 2.6.19.2
kernel version (only this version running well with my board not yet
any update from its vendor). I tried to patch this kernel manually
regarding to android.diff from benno.

which is the best ?
1. upgrade it's kernel version to 2.6.22/23
2. patch the kernel to meet android requirements (binder,
lowmemorykiller, etc.)

Please let me know. Any appreciation will greatly appreciated.
-ruckuus-

hackbod

unread,
Mar 19, 2008, 3:35:50 AM3/19/08
to Android Internals
On Mar 17, 1:21 am, "Anil Sasidharan" <anil...@gmail.com> wrote:
> Android reads raw X,Y and Pressure info from touch driver.
> And the device node being opened for touch is /dev/input/event1.
> Regarding the network, you will have to set the DNS and LOCAL-IP using
> the setprop utility.

It shouldn't matter what name you publish your input device under /dev/
input -- we just scan through all of the devices there and examine the
events they report to classify them. So for something to be
considered a touch driver, you just need to make sure you say you
report X, Y, and the key code for the primary mouse button.

Akio

unread,
Mar 19, 2008, 9:56:59 AM3/19/08
to Android Internals
Hi, ruckuus:

Could you tell me which cpu you use?
if mx27, as I know you should update to bsp 20071219.
This is my experience.

Best Regards,
Akio

Anil Sasidharan

unread,
Mar 21, 2008, 2:08:39 AM3/21/08
to android-...@googlegroups.com
Hi,

I would like to get some more clarity on this. From your reply
I understand that the Android framework expects the touch input layer
to report mouse events. Does it mean that the value for the parameter
"pressure" has no significance? Also it would be really great if you
could please give me a little more detailed explanation on the touch
interface being supported in Android. We are trying to integrate
Android on our custom platform that has a clearpad touch on it (it
supports an extra X,Y co-ordinate apart from the conventional X&Y).

Please share your thoughts....

Warm Regards,
Anil

Anil Sasidharan

unread,
Mar 23, 2008, 11:50:53 AM3/23/08
to android-...@googlegroups.com
Hi,

What sort of events are supported for the touchscreen interface by Android?

Warm Regards,
Anil

On Wed, Mar 19, 2008 at 1:05 PM, hackbod <hac...@gmail.com> wrote:
>

ruckuus

unread,
Mar 23, 2008, 11:21:28 PM3/23/08
to Android Internals
Hi,
i use PHYTEC iMX31 (freescale CPU) board. it only supports 2.6.19
version.
they don't release latest BSP to the kernel version yet. So that,
porting android to it's kernel
seems simpler than upgrade it's kernel.
any suggestion will greatly appreciated.
Regards,
Ruckuus

kojiran

unread,
Mar 24, 2008, 12:17:42 AM3/24/08
to Android Internals
Hi.

A patch file distributing it to by this article may be just usable.

http://202.165.105.226/babelfish/translate_url_content?.intl=cn&lp=ja_en&trurl=http%3A%2F%2Fd.hatena.ne.jp%2Fbs-android%2F20080310&fr=bf-maxthon

This is a patch to do porting of Android in iMX31 of linux-2.6.18.
Also the problem that a screen flickers seems to be fixed.

*Armadillo-500 is a iMX31 (freescale CPU) board.

Best Regards.

Anil Sasidharan

unread,
Mar 24, 2008, 8:33:00 AM3/24/08
to android-...@googlegroups.com
Hi,

It would be great if you could throw some light on "how can
synaptics touchscreen (RMI) driver can be integrated with Android". We
do report "X, Y, X2, Y2, Pressure, ABS_FINGERS and TOOL_WIDTH to the
input subsystem. However Android does not seem to be responding to the
touch events. Any suggestions?

Warm Regards,
Anil

On Wed, Mar 19, 2008 at 1:05 PM, hackbod <hac...@gmail.com> wrote:
>

vladimir.sch...@gmail.com

unread,
Mar 24, 2008, 8:48:04 AM3/24/08
to Android Internals
If touch works in emulator, read source code of emulator and kernel
and see how it works, then do same thing in your kernel.

On Mar 24, 5:33 am, "Anil Sasidharan" <anil...@gmail.com> wrote:
> Hi,
>
>       It would be great if you could throw some light on "how can
> synaptics touchscreen (RMI) driver can be integrated with Android". We
> do report "X, Y, X2, Y2, Pressure, ABS_FINGERS and TOOL_WIDTH to the
> input subsystem. However Android does not seem to be responding to the
> touch events. Any suggestions?
>
> Warm Regards,
> Anil
>

Akio

unread,
Mar 24, 2008, 10:01:09 AM3/24/08
to Android Internals
Hi, Rukuus:

when I use bsp 20071219 from freescale for i.mx27, i found
this bsp can be configured as i.mx31
so I think you can use this bsp for some test. BTW, you said
you got a wrong magic with kernel 2.6.23 and u-boot.
According what you said, I think you have to review u-boot
and bsp 20071219 redboot dealing with kernel image
and boot process. because I never use the board what you
use, so what i can do is provide some way to found out
what make u-boot don't happy with new version kernel. for
i.mx31, I also used freescale i.mx31 ads board,
but the board seems not very stable. right now, i.mx27 is
the major platform for the current project.

in my experience on i.mx27 with bsp 20071219 (kernel
2.6.22-6) , you have to add the following driver from
android kernel source (kernel 2.6.23 m3)
drivers/binder
drivers/misc/lowmemorykiller
drivers/android

BTW, you have to do some modification on fb driver for
double buffering.

I'm still trying to find out how to make touch panel can
work under android m3 binary.

hope this can help you.

Best Regards,
Akio

Akio

unread,
Mar 24, 2008, 12:22:33 PM3/24/08
to Android Internals
Hi vladimir.schlott:

After follow what you said, using Google as the key words, I
found
android-emulator-20080211\qemu\hw\events_device.c
in this file, I found
void events_dev_init(uint32_t base, void *pic, int irq)
{
events_state *s;
int iomemtype;

s = (events_state *) qemu_mallocz(sizeof(events_state));

iomemtype = cpu_register_io_memory(0, events_readfn,
events_writefn, s);

cpu_register_physical_memory(base, 0xfff, iomemtype);

qemu_add_kbd_event_handler(events_put_keycode, s);
qemu_add_mouse_event_handler(events_put_mouse, s, 1);
qemu_add_generic_event_handler(events_put_generic, s);

s->base = base;
s->pic = pic;
s->irq = irq;

s->first = 0;
s->last = 0;
}

and in linux-2.6.23-m3\drivers\input\keyboard
\goldfish_events.c seems only provide keyboard events.
where is the mouse or touch screen's event handling?
Could you do us a favor to show which one should be hacked?

Thank you very much.

Best Regards,
Akio


On Mar 24, 8:48 pm, "vladimir.schlott.andr...@gmail.com"

vladimir.sch...@gmail.com

unread,
Mar 24, 2008, 1:57:25 PM3/24/08
to Android Internals
Sorry, do not know details. I assumed you would find some information
in source code. Maybe other people on list know or can help find it.

ruckuus

unread,
Mar 26, 2008, 7:51:17 AM3/26/08
to Android Internals
Hi,

i follow the link you gave. there is differences between binder.c from
android source and from the patch.

is that because of data structure used in different kernel version ?
means between android source and 2.6.18-at kernel ? but i just
compiled after applying patch and i got errors, in the patch file
there is:

line 244:
fbi->fix.smem_start + (fbi->fix.line_length * fbi->var.yres),[MISSING
PARAMETER],0, 0);
there's supposed to be [MISSING PARAMETER], what is that ?

the screen does not show anything but only blue and pink.
and also i wonder, whether binder driver is built or not, as i
modprobe binder there is no binder module in running kernel. the
kernel is running well but i did not install android image, i used
OSELAS as well.
would you please give me solution to this ?
regards,
Ruckuus

On Mar 24, 11:17 am, kojiran <koji...@gmail.com> wrote:
> Hi.
>
> A patch file distributing it to by this article may be just usable.
>
> http://202.165.105.226/babelfish/translate_url_content?.intl=cn&lp=ja...

kojiran

unread,
Mar 26, 2008, 9:13:47 PM3/26/08
to Android Internals

ruckuus

unread,
Mar 27, 2008, 2:44:30 AM3/27/08
to Android Internals
Hi,
i follow that links, finaly i successfully got android shell

# init: HOW ARE YOU GENTLEMEN
init: reading config file
init: device init
init: mtd partition -1,
init: mtd partition 0, "U-Boot"
init: mtd partition 1, "Env"
init: mtd partition 2, "Kernel"
init: mtd partition 3, "Rootfs"
init: mtd partition 4, "Kernel
sh: can't access tty; job control turned off
#
# binder_open(c6561a40 c06e8bc0) (pid 1905) got c5855000
binder_open(c6561a40 c5f4c540) (pid 2717) got c2662000
binder_open(c6561a40 c05558e0) (pid 2754) got c14cb000
binder_open(c6561a40 c05554e0) (pid 2752) got c1535000
binder_open(c6561a40 c6630160) (pid 2764) got c110c000
binder_open(c6561a40 c6615a40) (pid 2310) got c11e1000

i try to ssh to OSELAS (which is running OS i use)
$ ps -ef
root 1 0 0 02:26 ? 00:00:01 init
root 2 1 0 02:26 ? 00:00:00 [ksoftirqd/0]
root 3 1 0 02:26 ? 00:00:00 [events/0]
root 4 1 0 02:26 ? 00:00:00 [khelper]
root 5 1 0 02:26 ? 00:00:00 [kthread]
root 54 5 0 02:26 ? 00:00:00 [kblockd/0]
root 55 5 0 02:26 ? 00:00:00 [cqueue/0]
root 57 5 0 02:26 ? 00:00:00 [mxc_spi.1]
root 60 5 0 02:26 ? 00:00:00 [ksuspend_usbd]
root 63 5 0 02:26 ? 00:00:00 [khubd]
root 98 5 0 02:26 ? 00:00:00 [pdflush]
root 99 5 0 02:26 ? 00:00:00 [pdflush]
root 100 5 0 02:26 ? 00:00:00 [kswapd0]
root 101 5 0 02:26 ? 00:00:00 [aio/0]
root 727 1 0 02:26 ? 00:00:00 [mtdblockd]
root 752 5 0 02:26 ? 00:00:00 [w1_control]
root 779 5 0 02:26 ? 00:00:00 [kmmcd]
root 784 1 0 02:26 ? 00:00:00 [mmcqd]
root 802 1 0 02:26 ? 00:00:00 [mxc_ts]
root 803 1 0 02:26 ? 00:00:00 [jffs2_gcd_mtd3]
root 831 1 0 02:26 ? 00:00:03 /sbin/udevd --daemon
root 1710 5 0 02:26 ? 00:00:00 [pccardd]
root 1715 1 0 02:26 ? 00:00:00 /sbin/syslogd
root 1719 1 0 02:26 ? 00:00:00 /sbin/klogd
root 1764 1 0 02:26 ? 00:00:00 /usr/sbin/telnetd
root 1772 1 0 02:26 ? 00:00:00 pure-ftpd
(SERVER)
www 1784 1 0 02:26 ? 00:00:00 /usr/sbin/thttpd -d /
var/www -u www -nor -nos -p 80 -c **.cgi -i /var/run/tht
root 1807 1 0 02:26 ? 00:00:00 /usr/sbin/sshd
root 1814 1 0 02:26 ttymxc0 00:00:00 -sh
root 1826 1814 0 02:27 ttymxc0 00:00:00 /bin/sh ./android-.sh
root 1828 5 0 02:27 ? 00:00:00 [loop0]
root 1832 1826 0 02:27 ttymxc0 00:00:00 /system/bin/sh /a.sh
root 1836 1832 0 02:27 ? 00:00:00 /init
root 1837 1832 0 02:27 ttymxc0 00:00:00 /system/bin/sh
root 1874 1836 0 02:27 ? 00:00:00 /system/bin/sh
root 1881 1836 0 02:27 ? 00:00:00 /system/bin/adbd
root 1882 1836 0 02:27 ? 00:00:00 /system/bin/usbd -r
root 1883 1836 0 02:27 ? 00:00:00 /system/bin/debuggerd
root 1884 1836 0 02:27 ? 00:00:00 /system/bin/rild -l /
system/lib/libreference-ril.so -- -d /dev/smd0
root 1904 1836 0 02:27 ? 00:00:00
zygote -Xzygote /system/bin --zygote
root 1905 1836 0 02:27 ? 00:00:00 /system/bin/runtime
2000 1907 1836 0 02:27 ? 00:00:00 /system/bin/dbus-
daemon --system --nofork
root 2717 1904 0 02:27 ? 00:00:01
system_server
10004 2752 1904 0 02:27 ? 00:00:00
com.google.android.home
1001 2754 1904 0 02:27 ? 00:00:00
com.google.android.phone
10000 2764 1904 0 02:27 ? 00:00:00
com.google.process.content
root 2908 1807 1 02:37 ? 00:00:00 sshd: root@pts/0
root 2913 2908 0 02:37 pts/0 00:00:00 -sh
root 2927 2913 0 02:37 pts/0 00:00:00 ps -ef

the android specific process seems running.

i follow steps from http://androidzaurus.seesaa.net/article/80102284.html
and use android image from : http://androidzaurus.up.seesaa.net/image/android-sdboot-image.tar.gz

as my flash capacity is lower than android image's size, i just boot
it from SDCARD.

Best Regards,
Ruckuus

On Mar 27, 8:13 am, kojiran <koji...@gmail.com> wrote:
> Hi.
>
> Please try this.
>
> http://202.165.105.226/babelfish/translate_url_content?lp=ja_en&trurl...

ruckuus

unread,
Mar 29, 2008, 3:20:04 AM3/29/08
to Android Internals
Hi,
finally i got android runs. i port lowmemorykiller and binder.
btw, touchscreen and network not been tested yet.
thanks to you all,
regards,
ruckuus

On Mar 27, 1:44 pm, ruckuus <ruck...@gmail.com> wrote:
> Hi,
> i follow steps fromhttp://androidzaurus.seesaa.net/article/80102284.html

Akio

unread,
Apr 5, 2008, 3:58:06 AM4/5/08
to Android Internals
Dear All:

The following is the modified mxc_ts.c for mx27 touchscreen driver for
android m3. not very well done one. and may be have some potential
bug. If some one found, please tell me, I'll and the fixed code into
mxc_ts.c. Right now, It is the very early version. It just work under
webkit browser and google map. The two major test items I already
test. the behavior is like double click not one touch. Would some one
else can show me how to make one touch work? BTW, the position which
reported from touchscreen seems have much noise, how to reduce the
noise? the second thing I didn't understand is that I can't use
touchscreen to select menu item when android gui shown on LCD screen.
Does any one know how to fix this problem for android m3 or just
android m3's item menu doesn't support touchscreen (I think this is
impossible. :) )

I think i.mx31's touchscreen driver can be applied with a little
modification. Or some one is kind of to show the full function
touchscreen driver of mx31? Any question is welcome.

Best Regards,
Akio

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/input.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/freezer.h>
#include <linux/platform_device.h>
#include <asm/arch/pmic_external.h>
#include <asm/arch/pmic_adc.h>

#ifdef CONFIG_ANDROID_POWER
#define X_AXIS_MAX 1000
#define X_AXIS_MIN 80
#define Y_AXIS_MAX 1000
#define Y_AXIS_MIN 80
#define PRESSURE_MIN 0
#define PRESSURE_MAX 1
#endif

static struct input_dev *mxc_inputdev = NULL;
static u32 input_ts_installed;

static char MXC_TS_NAME[] = "mxc_ts\0";
static char MXC_TS_PHYS[] = "mxc_ts/input1\0";

static int ts_thread(void *arg)
{
t_touch_screen ts_sample;
s32 wait = 0;

daemonize("mxc_ts");
while (input_ts_installed) {
try_to_freeze();
memset(&ts_sample, 0, sizeof(t_touch_screen));
pmic_adc_get_touch_sample(&ts_sample, !wait);

if((ts_sample.x_position >= X_AXIS_MIN) &&
(ts_sample.x_position <= X_AXIS_MAX) &&
(ts_sample.y_position >= Y_AXIS_MIN) &&
(ts_sample.y_position <= Y_AXIS_MAX)){
input_report_abs(mxc_inputdev, ABS_X, ts_sample.x_position);
input_report_abs(mxc_inputdev, ABS_Y, ts_sample.y_position);
input_report_abs(mxc_inputdev, ABS_PRESSURE,
ts_sample.contact_resistance);
input_report_key(mxc_inputdev, BTN_TOUCH, 1);
input_sync(mxc_inputdev);
} else {
input_report_key(mxc_inputdev, BTN_TOUCH, 0);
input_sync(mxc_inputdev);
}
wait = ts_sample.contact_resistance;
msleep(20);
}

return 0;
}

static int mxc_ts_open(struct input_dev *input)
{
printk("mxc_ts input touchscreen interface open\n");

return 0;
}

static void mxc_ts_close(struct input_dev *input)
{
printk("mxc_ts input touchscreen interface close\n");

return;
}

static int mxcts_probe(struct platform_device *pdev)
{
printk("mxc_ts input touchscreen interface probe\n");

return 0;
}

static int mxcts_remove(struct platform_device *pdev)
{
printk("mxc_ts input touchscreen interface remove\n");

return 0;
}

static int mxcts_suspend(struct platform_device *dev)
{
printk("mxc_ts input touchscreen interface suspend\n");

return 0;
}

static int mxcts_resume(struct platform_device *dev)
{
printk("mxc_ts input touchscreen interface resume\n");

return 0;
}

static struct platform_driver mxcts_driver =
{
.driver = {
.name = MXC_TS_NAME,
.bus = &platform_bus_type,
},
.probe = mxcts_probe,
.remove = mxcts_remove,
.suspend = mxcts_suspend,
.resume = mxcts_resume,
};

static int __init mxc_ts_init(void)
{
mxc_inputdev = input_allocate_device();
if (!mxc_inputdev) {
printk(KERN_ERR "mxc_ts_init: not enough memory for input device\n");
return -ENOMEM;
}

mxc_inputdev->name = MXC_TS_NAME;
mxc_inputdev->phys = MXC_TS_PHYS;
mxc_inputdev->id.bustype = BUS_HOST;
mxc_inputdev->open = mxc_ts_open;
mxc_inputdev->close = mxc_ts_close;
mxc_inputdev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
mxc_inputdev->keybit[LONG(BTN_TOUCH)] |= BIT(BTN_TOUCH);
input_set_abs_params(mxc_inputdev, ABS_X, X_AXIS_MIN, X_AXIS_MAX, 0,
0);
input_set_abs_params(mxc_inputdev, ABS_Y, Y_AXIS_MIN, Y_AXIS_MAX, 0,
0);
input_set_abs_params(mxc_inputdev, ABS_PRESSURE, PRESSURE_MIN,
PRESSURE_MAX, 0, 0);
input_register_device(mxc_inputdev);

input_ts_installed = 1;
kernel_thread(ts_thread, NULL, CLONE_VM | CLONE_FS);
platform_driver_register(&mxcts_driver);
printk("mxc input touchscreen loaded\n");

return 0;
}

static void __exit mxc_ts_exit(void)
{
input_ts_installed = 0;
msleep(20);

input_unregister_device(mxc_inputdev);

if (mxc_inputdev) {
input_free_device(mxc_inputdev);
mxc_inputdev = NULL;
}

platform_driver_unregister(&mxcts_driver);
}

late_initcall(mxc_ts_init);
module_exit(mxc_ts_exit);

MODULE_DESCRIPTION("MXC input touchscreen driver");
MODULE_AUTHOR("Freescale Semiconductor, Inc.");
MODULE_LICENSE("GPL");

Akio

unread,
Apr 5, 2008, 4:34:31 AM4/5/08
to Android Internals
Dear All:

I have to thank the android zaurus's author. he help me very much
on the touchscreen driver. thank you very much, android zaurus san.

Best Regards,
Akio

ruckuus

unread,
Apr 7, 2008, 4:20:22 AM4/7/08
to Android Internals
Thank You for :
input_set_abs_params(mxc_inputdev, ABS_X, X_AXIS_MIN, X_AXIS_MAX, 0,
0);
input_set_abs_params(mxc_inputdev, ABS_Y, Y_AXIS_MIN, Y_AXIS_MAX, 0,
0);
input_set_abs_params(mxc_inputdev, ABS_PRESSURE, PRESSURE_MIN,
PRESSURE_MAX, 0, 0);
i ain't get it :P

Akio

unread,
Apr 7, 2008, 10:55:13 AM4/7/08
to Android Internals
you can goto here to see the detail of what I done.
http://androidzaurus.seesaa.net/article/90045743.html

right now, I'm thinking how to provide calibration information
integrate into mxc_ts.c. If any good approach, please let me know.
if some one find how to improve the code, please let me know or drop
me a mail :)

BTW, the other points are platform_driver and input_report_key. If I
wrong, please show me. after add those code, I can make the
touchscreen work, but not very well.

If some one can provide me a function to do calibration, I'll very
happy to do integration :)

ruckuus, how about the bsp20071219 for i.mx31?

ruckuus

unread,
Apr 11, 2008, 4:12:09 AM4/11/08
to Android Internals
Hi,
I successfuly port android on my board (phyCORE i-MX31) with 2.6.22
kernel. Now i am fighting with the flickering. Is there any clue ?
Ruckuus
On Apr 7, 9:55 pm, Akio <akioo...@gmail.com> wrote:
> you can goto here to see the detail of what I done.http://androidzaurus.seesaa.net/article/90045743.html

kojiran

unread,
Apr 11, 2008, 4:43:11 AM4/11/08
to Android Internals
Try this patch.

drivers/video/mxc/mxcfb.c

+static int mxcfb_set_par(struct fb_info *fbi)
+{
+ return 0;
+}
+
/*
* Set framebuffer parameters and change the operating mode.
*
* @param info framebuffer information pointer
*/
static int
-mxcfb_set_par(struct fb_info *fbi)
+mxcfb_set_par_init(struct fb_info *fbi)
{
int ret;
bool use_iram = false;
@@ -281,12 +286,15 @@
fbi->var.xres, fbi->var.yres,
fbi->var.xres_virtual,
IPU_ROTATE_NONE,
- fbi->fix.smem_start, fbi->fix.smem_start, 0, 0);
+ fbi->fix.smem_start,
+ fbi->fix.smem_start +
+ (fbi->fix.line_length * fbi->var.yres),
+ 0, 0);

- ipu_select_buffer(mxc_fbi->ipu_ch, IPU_INPUT_BUFFER, 0);
-
- if (fbi->fbops->fb_blank)
- fbi->fbops->fb_blank(mxc_fbi->blank, fbi);
+ if (mxc_fbi->blank == FB_BLANK_UNBLANK) {
+ ipu_select_buffer(mxc_fbi->ipu_ch, IPU_INPUT_BUFFER, 0);
+ ipu_enable_channel(mxc_fbi->ipu_ch);
+ }

return 0;
}
@@ -721,7 +729,7 @@

if ((info->var.xoffset == var->xoffset) &&
(info->var.yoffset == var->yoffset)) {
- return 0; // No change, do nothing
+// return 0; // No change, do nothing
}

y_bottom = var->yoffset;
@@ -1227,7 +1235,7 @@
/* Overlay is blanked by default */
mxcfbi->blank = FB_BLANK_NORMAL;

- ret = mxcfb_set_par(fbi_ovl);
+ ret = mxcfb_set_par_init(fbi_ovl);
if (ret < 0) {
goto err_ovl_3;
}
@@ -1325,7 +1333,7 @@
mxcfb_drv_data.suspended = false;
init_waitqueue_head(&mxcfb_drv_data.suspend_wq);

- ret = mxcfb_set_par(fbi);
+ ret = mxcfb_set_par_init(fbi);
if (ret < 0) {
goto err_3;

ruckuus

unread,
Apr 11, 2008, 7:30:15 AM4/11/08
to Android Internals
Hi,
Actually my mxcfb.c seems to be already patched (2.6.22.6 kernel
version). So i can't apply that patch. I can't see lines that's
supposed to be replaced.
Ruckuus

ruckuus

unread,
Apr 11, 2008, 10:44:51 PM4/11/08
to Android Internals
I just forgot to mention. flicker appears when i touch the screen and
move it right/left, open browser, OpenGL an another apps which is
graphical intentionally. But in home screen, there's no flicker at
all. Is this Flickering issue just like on Armadillo ? let me know
please!
Ruckuus

ruckuus

unread,
Apr 12, 2008, 2:25:00 AM4/12/08
to Android Internals
Hi,
My problem solved with dirty hack in fbmem.c :

case FBIOPUT_VSCREENINFO:
/* Comment Lines Below
if (copy_from_user(&var, argp, sizeof(var)))
return -EFAULT;
acquire_console_sem();
info->flags |= FBINFO_MISC_USEREVENT;
i = fb_set_var(info, &var);
info->flags &= ~FBINFO_MISC_USEREVENT;
release_console_sem();
if (i) return i;
if (copy_to_user(argp, &var, sizeof(var)))
return -EFAULT; */
return 0;

there must be another problem with it. Maybe someone have same
experience ?
Ruckuus
On Apr 11, 7:30 pm, ruckuus <ruck...@gmail.com> wrote:

ruckuus

unread,
Apr 12, 2008, 2:27:04 AM4/12/08
to Android Internals
Hi,
I did the following in fbmem.c :
case FBIOPUT_VSCREENINFO:
/* printk("FBIOPUT_VSCREENINFO \n"); editP
if (copy_from_user(&var, argp, sizeof(var)))
return -EFAULT;
acquire_console_sem();
info->flags |= FBINFO_MISC_USEREVENT;
i = fb_set_var(info, &var);
info->flags &= ~FBINFO_MISC_USEREVENT;
release_console_sem();
if (i) return i;
if (copy_to_user(argp, &var, sizeof(var)))
return -EFAULT; */
return 0;

Flicker disappear, android runs very smooth even in high resolution.
Anyone has the same experience ? please let me know the side effect.
Ruckuus

ruckuus

unread,
Apr 12, 2008, 3:22:52 AM4/12/08
to Android Internals
Hi,
Did you try to rotate view then use touchscreen ?
i try to rotate view from portrait to landscape, when using
touchscreen in landscape, android seems read coordination remain in
portrait view, not in landscape. is this also problem in touchscreen
driver ?
Ruckuus

Akio

unread,
Apr 13, 2008, 7:19:47 AM4/13/08
to Android Internals
Dear Ruckuus:

Sorry :( Right now, I don't have any real hardware to test
my new mxc_ts.c. and also do
some tests for rotating the LCD. But you can goto
http://androidzaurus.seesaa.net to
found out where to modify. He also provide some utility to
do this job. I think you have
to swap the x and y value.

from
input_set_abs_params(mxc_inputdev, ABS_X, X_AXIS_MIN,
X_AXIS_MAX, 0, 0);
input_set_abs_params(mxc_inputdev, ABS_Y, Y_AXIS_MIN,
Y_AXIS_MAX, 0, 0);

to
input_set_abs_params(mxc_inputdev, ABS_X, Y_AXIS_MIN,
Y_AXIS_MAX, 0, 0);
input_set_abs_params(mxc_inputdev, ABS_Y, X_AXIS_MIN,
X_AXIS_MAX, 0, 0);

and

from
input_report_abs(mxc_inputdev, ABS_X, ts_sample.x_position);
input_report_abs(mxc_inputdev, ABS_Y, ts_sample.y_position);

to
input_report_abs(mxc_inputdev, ABS_X, ts_sample.y_position);
input_report_abs(mxc_inputdev, ABS_Y, ts_sample.x_position);


BTW, would you like to share how to solve the flicking
problem?
I'm very wondering to know.

Best Regards,
Akio

PS: I have a idea to collect all patches about i.mx31 and i.mx27.
may be I can talk about this to Freescale, Taiwan. And hope
the next released bsp contained those patches.

kojiran

unread,
Apr 13, 2008, 9:06:48 PM4/13/08
to Android Internals
Hi.
I think that there is no meaning because it was already solved your
problem by oneself.
But I reply.
Because Armadillo does not have a touch screen, I'm not sure whether I
am the same.
Even if I used the arrow key in GoogleMaps application and moved it,
flickering did not occur.
If I applied the patch which I showed the other day, a flicker has not
been caused in Armadillo.

ruckuus

unread,
Apr 13, 2008, 10:30:51 PM4/13/08
to Android Internals
Hi,
Well, i also found that fbmem.c's FBIOPUT_VSCREENINFO: will always
call mxc_set_par all the time. I just put printk("Debug Number #"); in
very single function in both fbmem.c and mxcfb.c and see it seems
double function calling both in fbmem and mxcfb, with the same
function which is to write data onto framebuffer. i dunno whether this
is a big thing or what, or something board / HW specific function.
Also in fbmem.c there's module loading, mine subjected to mxcfb, as
framebuffer device.
#ifdef CONFIG_KMOD
static void try_to_load(int fb)
{
request_module("fb%d", fb);
}
#endif /* CONFIG_KMOD */

compared with vanilla kernel:
http://lxr.linux.no/linux+v2.6.22.6/drivers/video/fbmem.c#L1130

so, as i don't know what actually happen, i just let comment some
function based on vanilla. and it works. firstly, just want to know,
is there any picture in the screen ? and i get more. Advice ?
Ruckuus

On Apr 13, 7:19 pm, Akio <akioo...@gmail.com> wrote:
> Dear Ruckuus:
>
> Sorry :( Right now, I don't have any real hardware to test
> my new mxc_ts.c. and also do
> some tests for rotating the LCD. But you can gotohttp://androidzaurus.seesaa.net to

ruckuus

unread,
Apr 18, 2008, 11:42:27 PM4/18/08
to Android Internals
Hi All,
I just successfully port m5 to phyCORE iMX31L, with 2.6.22.6 kernel. I
got hard flickering problem just like m3 porting. The steps are very
similar with m3 porting. But i need to patch some files, drivers/
android/binder.c complains about them, I can't use the old binder
driver, my first assumption is, the new binder driver does vmap
intentionally and it's different from binder driver in m3. Dunno what
actually happen, but the runtime runs well. These are files need to be
patched : fcntl.c, fs.h futex.c vmalloc.c
Regards,
Ruckuus
Reply all
Reply to author
Forward
0 new messages