[PRJ][OS]Linux and Android on SE Xperia X1

Search This thread

hhenault

Senior Member
Oct 9, 2009
78
6
Paris
To all :

I forgot that 'imgdevname' was pointing on the sdcard ... oops!

To scholbert :

- Kernel 20091016 Ok.
- I can "expand" the initrd file by gunzip + "cpio -icvB ...", and access the init script.
Thus, I can edit and modify the init scripts.
BUT when if I rebuild the initrd with 'cpio -ocvB...' + gzip, I can't have exactly the same image, because the main dirs (system, sys, cache ...) are expanded as 'flat files' instead of physical ext2 file systems.
When booting with my modified initrd, what I get a is nice crash + a nice dump...
I can't decide if due to my change ('/sdcard' instead of '/mmc'), or due to bad filesystems.

If you have a tool to rebuild correctly the initrd file, I suggest you try the changes above.

Keep going everybody !!!
 

scholbert

Senior Member
Aug 1, 2007
1,347
821
Hi hhenault!

- I can "expand" the initrd file by gunzip + "cpio -icvB ...", and access the init script.
Thus, I can edit and modify the init scripts.
BUT when if I rebuild the initrd with 'cpio -ocvB...' + gzip, I can't have exactly the same image, because the main dirs (system, sys, cache ...) are expanded as 'flat files' instead of physical ext2 file systems.
When booting with my modified initrd, what I get a is nice crash + a nice dump...
I can't decide if due to my change ('/sdcard' instead of '/mmc'), or due to bad filesystems.
I suggest these steps to extract, modify and rebuild initrd:
1. Gunzip with: gunzip initrd.cpio.gz
2. Extract inside working folder: cpio -i < initrd.cpio
3. Move initrd.cpio from working folder and backup if you like.
4. Do the mods...
5. Within your working folder create the new cpio-archiv: find ./ | cpio -H newc -o > initrd-new.cpio
6. gzip initrd-new.cpio

You may also use the description in the wiki: http://htc-linux.org/wiki/index.php?title=Initrd

For the *.e2img you may use these instructions on your linux host:
1. Create a temporary mountpoint in you work directory e.g.: mkdir tmp_mnt
2. Mount the EXT2 file images: mount -o loop system.e2img ./tmp_mnt
3. Modify whatever you like, but keep track of the user rights inside the mounted filsystem.
4. Just for security call sync afterwards: sync
5. Umount ./tmp_mnt

To create a new file with a EXT2 filesystem inside (just an example):
1. dd if=/dev/zero of=/your_work_directory/your_file.ext2 bs=1024k count=65536
2. mkfs.ext2 /your_work_directory/your_file.ext2
3. You may even tune up the filesystem inside this file: tune2fs -c 0 -i 0 your_file.ext2 (or similar)
4. You may then mount it as loop, and build up the directory structure, do whatever you like :p

You need to be root for all the steps described above.

Hope this helps :D

scholbert
 

scholbert

Senior Member
Aug 1, 2007
1,347
821
While booting, startup lines are upside down, then flip to normal, but Android desktop is upside down again. Scholbert do you have any clue what causes this?
Yes basically the kernel and android use a default orientation for the framebuffer, which is valid for most platforms.
Due to some design issues the engineers at HTC decided to build in the screen for the X1 with a rotation of 180 degrees.
For the console this is fixed already.
Normally this should be no big deal for the GUI as well, we simply need to find a mechanism to turn it around :eek:

Someone who's more familiar with the Android system may help us out.
Have a look here:
http://android.git.kernel.org/?p=pl...c;hb=946fa82bce5557cbd10ccdc06822f037302f7c84

These are some libs inside the Android system that build an API to the kernel drivers.
Some insiders may also have a look into the kernel sources as well.
Search for the flag: MDP_ROT_180.

So maybe it is also possible to set the screen rotation on kovsky by default to 180 degrees inside the kernel.
Unfortunately these parts of code are not easy to read for me and i had no success to implement it to so far.

Anyway, i'm sure someday this will be fixed :rolleyes:

Regards,

scholbert
 

SneakyViper

Member
Aug 10, 2007
12
0
Yes basically the kernel and android use a default orientation for the framebuffer, which is valid for most platforms.
Due to some design issues the engineers at HTC decided to build in the screen for the X1 with a rotation of 180 degrees.
For the console this is fixed already.
Normally this should be no big deal for the GUI as well, we simply need to find a mechanism to turn it around :eek:

Someone who's more familiar with the Android system may help us out.
Have a look here:
http://android.git.kernel.org/?p=pl...c;hb=946fa82bce5557cbd10ccdc06822f037302f7c84

These are some libs inside the Android system that build an API to the kernel drivers.
Some insiders may also have a look into the kernel sources as well.
Search for the flag: MDP_ROT_180.

So maybe it is also possible to set the screen rotation on kovsky by default to 180 degrees inside the kernel.
Unfortunately these parts of code are not easy to read for me and i had no success to implement it to so far.

Anyway, i'm sure someday this will be fixed :rolleyes:

Regards,

scholbert
I quickly grepped over the android source and only found some references to libcopybit from within the surfaceflinger. After some searching using Google, I also found out that libcopybit is not the preferred way of talking to the hardware, but it was mainly used in the G1.

I'm not 100% about all this, I'm going to work some more on this tomorrow.
 

gsgflash

Member
Sep 9, 2009
43
3
If you guys get Android working (and I mean working enough to use it daily as a phone OS) on the Xperia, you will basically be like gods to me :D
 

jerpelea

Senior Recognized Developer
Nov 7, 2006
7,474
40,177
Lund
sites.google.com
hy all

i followed the progress on xperia

i saw that keyboard is mapped but soft keys ,accept,reject and ok are not mapped



we can map xpannel to menu key in android so that we can unlock the screen


i will try to port the new 0.2 blackstone fs to xperia
 
Last edited:

hhenault

Senior Member
Oct 9, 2009
78
6
Paris
To Scholbert

Ok, I changed "mmc" to "sdcard" in the initscript, but nothing really new;
Lacks recognizing hardware feature like SIM card, SDcard (does it expects a second one ?),
wi-fi, radio etc ...

And anyway to find how to install new appl.

Below, the 'dmesg' log, but It seems ending just before 'init.android' launching.
Where is the equivalent of '/var/log/messages' ?
Note that Android tries to find two sdcards (line #327)

The calibration is perfect: there is an application hidden somewhere, which permits to test the "pointer" : it says left top corner=<0,0>, bottom right corner=<479,799>.

To all :

in your default.txt, you can set '"msmvkeyb_toggle=hide" :
You will get a small blue sqare; when you tap it, it becomes green (keyboard ready), then red (to be moved inside the screen), then blue (it 'vanishes' ???), etc...

Inside applications, you can fiddle with the X1 "left" and "right" soft buttons, the small joystick [ acting like up/down arrows], and the the "X" an "OK" black buttons: it is more or less a way to navigate.

Good Hunting ...
 

Attachments

  • dmesg.zip
    7 KB · Views: 24
Last edited:

cyberdesigner.net

Senior Member
Jan 8, 2009
129
9
Dresden
To Scholbert

Ok, I changed "mmc" to "sdcard" in the initscript, but nothing really new;
Lacks recognizing hardware feature like SIM card, SDcard (does it expects a second one ?),

Good Hunting ...

dmesg is talking about mmc (after timeouts at that device?) looks like we have to edit the kernel/udev (dont know whats used in such small distributions to recognize the devices to /dev ;) to asign sdcard to mmc
 
Last edited:

scholbert

Senior Member
Aug 1, 2007
1,347
821
Hi there!

Not time for deep investigations right now, but had a short glimpse at the dmesg.log :rolleyes:
Note that Android tries to find two sdcards (line #327)
In fact the kernel is scanning the hardware and registers two controllers.
One is used for the SD-card, the other one is connected to the WiFi chipset and will use SDIO protocol (if the driver will be implemented someday;)).
The SD-card is definitely registered as memory device and working o.k., otherwise the procedure of booting into Android would fail.

I wonder if someone with console access did ever try a simple mount command to attach the card.
mount -t vfat /dev/mmcblk0p1 /sdcard
What happens?
What happens if you simply type 'mount' at the console?
Should report all mounted filesystems anyway.

Regards,

scholbert
 
Last edited:

bahkyp

Senior Member
Feb 20, 2009
56
1
Q's and HTC Hero android code!!!

Hello, I'm a X1 android newbie.

I have been trying to get the hhenault set of files working. I unzip the files on my Mac and then copy them to the SD card and rename the folder to /tmp/ (as WM copies as TMP, other files/folders seem not effected). The consol zooms past text for about 30 seconds, then hangs at Android GUI screen, I cannot workout which is the power button to unlock the GUI. (or the X1 has crashed silently)

I'm assuming that my 8GB SDHC FAT32 card needs to be reformatted to work. I have seen mentions of both need for a kernel driver and the SD to have a primary partion with a different format.

What do I do need to set in GPARTED (or FDISK) to get this to work?
Where can I get a SDHC compiled in Kernel? (I cannot git on my net as I'm using Mac OSX 10.4 to write this which doesn't support git OR I'm on Debian which doesn't have the bluetooth modem and thus net I need to connect. I currently don't have landline net so the phone is all I have.).
Or where is a bundled recent X1 kernel source?

A comment on the current screen rotation issue. The consol and the GUI are different frame buffers, set in different places. The screen for the GUI will be set somewhere in xfree/x11 (or whatever android uses), not the Kernel parameters.

I have an autoconnect USB setup script from the openmoko project which I'll post once I have it working with Debian <-> X1 andorid.

And lastly, HTC HERO source is released (for those who missed it). Get it at developer.htc.com, this is a very similar machine to the X1
 
Last edited:

SneakyViper

Member
Aug 10, 2007
12
0
Hello, I'm a X1 android newbie.

I have been trying to get the hhenault set of files working. I unzip the files on my Mac and then copy them to the SD card and rename the folder to /tmp/ (as WM copies as TMP, other files/folders seem not effected). The consol zooms past text for about 30 seconds, then hangs at Android GUI screen, I cannot workout which is the power button to unlock the GUI. (or the X1 has crashed silently)

I'm assuming that my 8GB SDHC FAT32 card needs to be reformatted to work. I have seen mentions of both need for a kernel driver and the SD to have a primary partion with a different format.

What do I do need to set in GPARTED (or FDISK) to get this to work?
Where can I get a SDHC compiled in Kernel? (I cannot git on my net as I'm using Mac OSX 10.4 to write this which doesn't support git OR I'm on Debian which doesn't have the bluetooth modem and thus net I need to connect. I currently don't have landline net so the phone is all I have.).
Or where is a bundled recent X1 kernel source?

A comment on the current screen rotation issue. The consol and the GUI are different frame buffers, set in different places. The screen for the GUI will be set somewhere in xfree/x11 (or whatever android uses), not the Kernel parameters.

I have an autoconnect USB setup script from the openmoko project which I'll post once I have it working with Debian <-> X1 andorid.

And lastly, HTC HERO source is released (for those who missed it). Get it at developer.htc.com, this is a very similar machine to the X1
You don't need a special SDHC driver or something like that. You just need to make sure that the first partition on the sd card is a FAT/FAT32 primary partition. Often, sd cards are partitioned to have a single logical partition, that won't work. You can indeed use gparted or fdisk to do this, but I can't tell you by heart how to do that. Just look it up ;)

Second of all, if you're getting as far as in an android screen, you probably won't need to re-partition your card, because if the card doesn't work, the booting will hang before any android screen.

If you want to connect to your Xperia in debian using the usb cable, you should try installing synce. It will create a network interface which you can use just like any other network interface. When booting the Xperia using the android files from hhenault, the xperia will be 192.168.0.206, so if you set your own ip address to be something in the same range, you should be able to telnet to the device. (more info: http://www.synce.org/moin/)

And why can't you install git on Mac OSX? (see http://help.github.com/mac-git-installation/)

(Maybe I should put this (or even more descriptive) in the wiki?? ;) )

I've been busy creating a new vmware image with more diskspace, so I can build and customize the android file more easily. VMWare player sucks for these kinds of actions...
 
Last edited:

cyberdesigner.net

Senior Member
Jan 8, 2009
129
9
Dresden
Hello, I'm a X1 android newbie.

I have been trying to get the hhenault set of files working. I unzip the files on my Mac and then copy them to the SD card and rename the folder to /tmp/ (as WM copies as TMP, other files/folders seem not effected). The consol zooms past text for about 30 seconds, then hangs at Android GUI screen, I cannot workout which is the power button to unlock the GUI. (or the X1 has crashed silently)

your x1 does'nt crash... the screen you are talking about is simply the "locked" screen of android. try F1-key on the software keyboard to unlock...
 

scholbert

Senior Member
Aug 1, 2007
1,347
821
Hi!

Some new faces appeared, that's nice!
Anyway reading the thread will be recommended i guess ;)

Or where is a bundled recent X1 kernel source?
http://git.linuxtogo.org/?p=groups/mobile-linux/kernel.git;a=shortlog;h=refs/heads/htc-msm-2.6.27
If you got no working git, you may grab a snapshot of the latest release.

A comment on the current screen rotation issue. The consol and the GUI are different frame buffers, set in different places. The screen for the GUI will be set somewhere in xfree/x11 (or whatever android uses), not the Kernel parameters.
Yeah, basically that's true.
The scenario you describe would use parts of the hardware glue libs i mentioned earlier. Apart from that there would be a nicer option.
The X1/Kovksy uses a chip from Epson acting as abridge between the MDDI interface of the Qualcomm chip and the digital-RGB of the TFT-display.

This chip supports screen rotation as well as mirroring and other features in hardware. To get this implemented would be the most convenient and best performance way to switch the orientation i guess. Obviously this is true kernel hacking :D

Anyway, rotating display data in some high level software would be a nice start :rolleyes:

Some words concerning the latest sources of the hero device.
I'm not sure if this is really new stuff, i guess the android developer tree is bleeding edge...
Tell me if i'm wrong.

@SneakyViper:
Nice description i would appreciate such information in the wiki

Regards,

scholbert
 
Last edited:

joker.mn

Senior Member
Nov 16, 2008
114
0
i used the files from post #92 #94 and #96 and i was able to boot android on my phone.

but similar to others i am stuck at the unlock screen. i cannot find any software keyboard and typing any of my hardware keys does not change the display at all.
did i miss a setting or a file that included (or gave me the possibility to open) the software keyboard.
-EDIT post #119 "'msmvkeyb_toggle=on" in default.txt helped me.

thanks in advance for your help.

i strongly encourage that project. i would love to have android running on my X1.
 
Last edited:

hhenault

Senior Member
Oct 9, 2009
78
6
Paris
but similar to others i am stuck at the unlock screen. i cannot find any software keyboard and typing any of my hardware keys does not change the display at all.
did i miss a setting or a file that included (or gave me the possibility to open) the software keyboard.
-EDIT post #119 "'msmvkeyb_toggle=on" in default.txt helped me.

if "msmvkeyb_toggle=on", then you will have the keyboard on GUI screen immediatly at boot time.

if "msmvkeyb_toggle=hide", then you will just have a small blue square, meaning "here is the hidden keyboard"; just tap it several times, the square will become green, and the keyboard just appears ...

With the last kernel, the software 'left' button [ just above telephone and 'X' buttons ] will unlock the screen --- due the reverse display, it lays upward right ...
 

emuX

Senior Member
Sep 2, 2009
368
77
or you could try a newer kernel

i used the files from post #92 #94 and #96 and i was able to boot android on my phone.

but similar to others i am stuck at the unlock screen. i cannot find any software keyboard and typing any of my hardware keys does not change the display at all.
did i miss a setting or a file that included (or gave me the possibility to open) the software keyboard.
-EDIT post #119 "'msmvkeyb_toggle=on" in default.txt helped me.

thanks in advance for your help.

i strongly encourage that project. i would love to have android running on my X1.

You could use the zImage_20091016 that was added in post #180 in this thread. It has X1 keys mapped for Menu, Home, Back, etc. The kernel link is: http://xdaforums.com/attachment.php?attachmentid=237781&d=1255711410

Left soft button = Menu
OK button = Back
Panel button = Home
Right soft button = Power (although this doesn't seem to work at the moment)