Please remember to add a category to the bottom of each page that you create.
See categories help for further details, but most will probably be [[Category:HTC ModelName]].

HTC Kovsky/Linux

From XDA-Developers
< HTC Kovsky(Redirected from Kovsky Linux)
Jump to: navigation, search

Sony Ericsson Xperia X1/HTC-Kovsky - Linux/Android porting effort

Technically the X1 is a HTC device, and it is based on the QCT MSN7xxxA chipset, which is employed on a lot of HTC devices. Therefore development is closely related to that on other HTC devices.

Notes on this article: This Wiki article is mainly aimed for normal X1 users who are interested in seeing Linux/Android running on the X1, but also for xda-developers who want to jump in the development boat and quickly gather some information on the outline of the project. If you see anything incorrect feel free to correct/supplement/extend it. Wiki's are meant to be collaborative ;). The content of this article may be out of date; newer, less buggy builds may be available. Check this thread for the Android effort: http://forum.xda-developers.com/showthread.php?t=609463

Warning: I'll just state the obvious: Linux/Android is no official platform for the X1, use it/flash it, you might brick you phone, you might not be able to receive warranty. Use it at your own risk. You've been warned.


Current state

Should I ditch Windows Mobile and switch to Android? : I think it's safe to say that for the average X1 user that's used to the high quality custom ROM's, Android is still far from a state that's reliable and functional enough for daily use.

Though this project is quite and end through, it's still far from completion. Many components of the device are not yet functional under Android 1.0.

Device or function Status Technical name Comment
Boot Done HaRET Linux Boot Loader
NAND Boot Done LK Bootloader LittleKernel Bootloader Currently issues with GSM and sound on NAND boot
Power management More or less Driver for DS2746 needs correction. The reason of high battery drain is unknown. Charging via USB/AC works
Console interface Done fbcon Framebuffer Console
Android Graphical User Interface Done Google Android XDANDROID, CM6, Sense...
Touch screen Done Epson D7741B1 F872U53, Source: PhoneWreck.com X1 block diagram, 'best educated guess' they say Calibration in some builds already in the Default.txt boot options file. 'msmts_calib=0xc5.0x399.0x367.0x4d', see Boot options section. Others need calibration during boot.
Hardware keyboard Done Microp-KSC Fully working keyboard that has 30% more additional new keys as Windows Mobile. Keyboard driver extended with haptic and visual feedback. "This new feature makes typing text in linux a joy!" :) [email protected] Keyboard Layouts need to be tested. (see Keyboard Layouts) (Keymap file here.)
Keyboard slide event registration and handling Done Microp-KSC http://forum.xda-developers.com/showpost.php?p=4132824&postcount=474), rotation can now also be set for HaRET bootup in 'Default.txt'
Hardware buttons Done msm-gpio-keys android might need a power button fix.
D-Pad Working Microp-KSC Orentation of the Buttons on Keyboard Slide Event has been implemented.
Optical joystick NO ? .
SD Storage Access Done msm_sdcc .
LCD Backlight Done Microp-KLT implemented by ultrashot.
LED Illumination (the 4 notification LED's on both sides below the screen) NO Microp-KLT needs implementation, algorithm is known.
LED Keyboard Backlight Done Microp-KLT implemented by ultrashot.
LED D-Pad Backlight Done Microp-KLT implemented by ultrashot.
GPRS/EDGE/3G/HSUPA Done [1] HSDPA/EDGE with 2G/3G switching like in winmo
SMS/MMS Done
GSM Phone Calling Done
USB Done USB PHY SMSC USB3316, Source: PhoneWreck.com X1 block diagram full hw reset implemented, works without the need to insert the cable while booting from winmo
Audio controls interface Done
WiFi Done TIWLAN or wl1251-sdio works with tiwlan, while wl1251 is unstable and lacks power saving mode
R/W Access to AT serial channel Working Qualcomm MXU6219 Quad-band GSM/Tri-band UMTS, Source: [PhoneWreck.com X1 block diagram http://www.phonewreck.com/wiki/index.php?title=Sony_Ericsson_XPERIA_X1], 'best educated guess' they say .
R/W Access to DATA serial channel NO Qualcomm MXU6219 Quad-band GSM/Tri-band UMTS, Source: PhoneWreck.com X1 block diagram, 'best educated guess' they say .
USB Host Mode YES ? Working with ehci-msm7201.c by Andrew De Quincey. Needs external power.
Bluetooth Done Texas Instruments BRF6350 BL, Source: PhoneWreck.com X1 block diagram Working in current XDANDROID builds, rfkill implemented in kernel.
GPS Done Integrated into Qualcomm MSM7200A Baseband Processor, Source: PhoneWreck.com X1 block diagram Implemented in current XDANDROID builds.
Camera WIP driver for mt9t012vc is reimplemented. Still capture/preview is working. TODO is camera focus, reworking gpio init to be done as in native android devices, fix userland issues with video recording.

Videos

Downloads

Lazymans guide to Linux/Android

  1. Download a compiled package of a Linux distribution built for the X1.
  2. Place all the files in a folder directly under your device root (aka 'My Device' in Windows Mobile).
  3. Adjust the default.txt boot options file to your preferences or use the options that the builder provided. (see [Default.txt boot options | #Boot options])
  4. Fire up HaRET and hit 'Start'.
  5. Depending on the image that you downloaded and are booted, the Linux distro might not boot with a GUI (Graphical User Interface) but a CLI (Command Line Interface) instead. Ångström is the most common distro around right now and is used through a CLI. Android however usually boots up a GUI, but this might be different depending on the image.
  6. In case of Ångström with a CLI; Log in with 'root' account and no password. (According to: http://forum.xda-developers.com/showpost.php?p=4262910&postcount=26)

Boot options

Depending on the package that you intend on running, the following boot options may be configured in the Default.txt file.

(Probably not yet complete and up to date)

####### Device
####### 1910 = Raphael (Touch Diamond)
####### 2006 = Kovsky (Xperia X1)
set MTYPE 2006

####### KERNEL
####### Name of the image file, usually (starting with) 'zImage'
set KERNEL zImage-xxx

####### INITRD
####### initrd file contains a filesystem that is loaded into ram ( initial ram disk) and is passed to the kernel from the bootloader (in this case Haret, but on other systems grub/lilo/elilo/etc).
####### Check this note on initrd by bloatboy in [PRJ][OS]Linux and Android on HTC Diamond "NOT YET WORKING"
set INITRD initrd-xxx.gz

####### Size of RAM (continuous area)
set RAMSIZE 0x6000000

####### Physical RAM address (to override the one set in HaRET, which seems to fail more often)
set RAMADDR 0x10000000

####### Command line to pass to kernel
####### Root mount point: "root=/dev/ram0"
####### Working touch screen calibration: "msmts_calib=0xc5.0x399.0x367.0x4d"
####### Screen orientation (only recently supported): "fbcon=rotate:3"
set cmdline "root=/dev/ram0 init=/init msmts_calib=0xc5.0x399.0x367.0x4d fbcon=rotate:2"

####### Boot from ram (needed for Linux booting)
# ramboot
# boot_delay=<N>
# msmvkeyb_toggle=<off|hide>
bootlinux

Compiling the Kernel from the Sources

  1. Make sure you have an appropriate environment to get the source (git) and to compile the kernel. Install git, gcc, make and libncurses-dev at least. For debian based distributions.
    apt-get install git-core build-essential libncurses-dev
  2. Create a directory to hold the kernel sources
    mkdir ~/kovsky-dev
  3. Download the kernel source
    cd ~/kovsky-dev
    git clone git://git.linuxtogo.org/home/groups/mobile-linux/kernel.git
    cd kernel
    git checkout -b htc-msm-2.6.27 origin/htc-msm-2.6.27
  4. Download and decompress the arm toolchain (64mb)
    cd ~/kovsky-dev
    wget THISLINK -O arm-2008q1-126-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 (The link-address has to be here instead of the link, but the large link makes the width of this page very big)
    tar xjf arm-2008q1-126-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
  5. Generate the default .config for the kernel(ARCH is case sensitive)
    cd ~/kovsky-dev/kernel
    make htc_msm_android_defconfig ARCH=arm
  6. Compile
    cd ~/kovsky-dev/kernel
    export PATH=~~/kovsky-dev/arm-2008q1/bin:$PATH
    make zImage ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
  7. Play and have fun!!! Now you can copy the compressed kernel image to your blackstone
    cp ~/kovsky-dev/kernel/arch/arm/boot/zImage /wherever your boot files are stored

Getting WiFi working

  1. Download the TI wireless driver http://code.google.com/p/zimages/downloads/detail?name=sta_dk_4_0_4_32.tar.gz&can=2&q=
  2. Extract
    tar -zxvf sta_dk_4_0_4_32.tar.gz
    cd sta_dk_4_0_4_32
  3. Set kernel path, i.e
    export KERNEL_DIR=/home/matt/kovsky-dev/linux-msm-xdadev/
  4. Build it
    make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- KLIB=/home/matt/kovsky-dev/linux-msm-xdadev KLIB_BUILD=/home/matt/kovsky-dev/linux-msm-xdadev/
  5. Tar it up into a modules tar ball, i.e
    tar -zcvf modules-2.6.27.46-01095-g23f3fd5.tar.gz wlan.ko
  6. Copy to device/sdcard
    cp modules-2.6.27.46-01095-g23f3fd5.tar.gz /mnt/xperia

Make sure the kernel version (i.e modules-2.6.27.46-01095-g23f3fd5 ) in the tarball name matches the output of uname -a, otherwise the module will not load

Known Issues and How-To solve them

  • Because the power button doesn't work one might think that removing the battery or using the soft reset button is the only quick and dirty method to reset. However it is advised to use the reboot shell command instead for a clean reboot.
  • If you want to use your XPERIA over the USB connection with your (Ubuntu) Linux, you have to disable WinSyncCE in the connection settings in Windows Mobile, and enable Disk drive mode.
  • Most of ARAN's builds have decreased memory usage because of freezes while booting Linux. It will be for sure go to the max (256 MB) as we implement more stuff in the builds.

IRC chat/discussion

A great amount of information is shared and discussion is done over IRC in the HTC Linux channel, and is another valuable communication channel alongside the xda-developers forum.

Read back in time: http://irclog.netripper.com/?chan=htc-linux

Forum Treads

A little history

I believe _Xmoo_ and _dcordes_ started out quite a while back, mainly building forth on the porting effort that at that time was already running quite a while for other HTC devices such as the HTC Touch Diamond (Raphael) and HTC TouchHD (Blackstone). At the time when I started tracking the effort the thread was already quite a while running, Android 0.8 and 1.0 were running (booted with HaRET from Windows Mobile). The colours were kinda like the X1 was on psychedelic drugs. I think this was also due do the problems with the framebuffer, which also caused the images to appear upside down.

You can see that in this old Android 1.0 boot tutorial by Xmoo: http://www.youtube.com/watch?v=L4z1hgUNH3o&fmt=18 (which has been fixed now).

A lot of testers/users experienced problems with the HaRET booting method, where HaRET would hang when it had almost loaded the image. Unfortunately _Xmoo_ lost his X1 in a peculiar event, and development is now mainly led by _Aiv_, _ARAN_ and _dcordes_ if I'm correct. The thread is now dead and a new one has been set up by _dcordes_ that pretty much starts of where _Xmoo_'s [ thread | http://forum.xda-developers.com/showthread.php?t=456595] ended.


Repositories


Useful links