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 Raphael/Linux/State

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

Linux on Raphael and Diamond

This page is meant for people who want to know the progress on getting Linux (and Android) to work on the Raphael and Diamond devices. It was suggested in this forum thread to make a wiki page, which I found to be a good idea. We're on this with some great people now. In case you feel you can help out, you can find us using IRC on #htc-linux on Freenode.

Current state

Please note that Android on the Diamond and Raphael is still in very primitive stages. You can run Android, but device drivers are not working properly or even not at all. Below you'll see what works and what doesn't.

You could also check out the two XDAndroid Eclair and FroYo threads.

Function Status Devices Comment
Boot OK All  
Graphical Interface OK All  
Touch screen OK All Needs calibration on first startup
R/W Access to AT serial channel OK RAPH100  
R/W Access to DATA serial channel Partial All Working, but unstable. Location dependant, it seems.
R/W Access to GPS serial channel OK All  
SD Storage Access OK All Some phones have problems in FroYo
Hardware keyboard OK All  
LEDs OK All  
Navipad OK All  
Hardware buttons OK All  
Stylus detection OK All To be confirmed
USB Host Mode  ? All  ?
USB Partial All ADB works
Wifi OK All  
Bluetooth Partial All  
GPS OK All  
Audio Routing (Phone) OK All  
Power Management Partial All Basic power management implemented.
Camera: front/back NO All RAPH100: work in testing kernel (no video) 
Accelerometer OK All  
FM Radio NO All  
Light Sensor WIP All  

How To

Quick beginners guide

  1. Download one of the prebuilt Android packages for the HTC Raphael.
  2. Unpack it to the root folder of the SD card of your phone.
  3. Make sure the right startup.txt or default.txt for your type of phone is in the root folder. In most prebuilt packages files for different types of phones are located in a startups or startup-config folder. Copy the right file from this folder to the root folder and rename it to STARTUP.TXT or DEFAULT.TXT.
  4. Browse on your phone to the root folder of your SD card en start haret.exe and follow the instructions.

Hardware differences and configurations

Phone Model mtype msmsdcc_id imgdevname imgdevnum msmts_calib
DIAM100 1805 -- /dev/mmcblk0 0 msmts_calib=0x7A.0x5E.0x35A.0x37F
DIAM300 1805 -- -- -- same as -100
DIAM500 1805 -- -- -- same as -800
RAPH100 1910 -- /dev/mmcblk0p1 1 msmts_calib=0x6D.0x5D.0x340.0x375
RAPH101  ? --  ? 1 msmts_calib=?
RAPH120 1910 -- /dev/mmcblk0p1 1 msmts_calib=0x7e.0x63.0x35f.0x386
RAPH500 2182 -- /dev/mmcblk0?  ? msmts_calib=?
RAPH800 2039 -- /dev/mmcblk0p1 1 msmts_calib=0x81.0x393.0x358.0x7D
    • msmsdcc_id is no longer required and should not be specified on the command line. SD controller id is automatically detected based on MTYPE (so be sure you specify it correctly in default.txt for your device)
      • a lot of end users have been having trouble mounting their sd cards. Lavender.t came up w/a solution that I'm posting here now

think one way is to have mdev -s detect your partition automatically and then we make it into init. what you can do is, after boot:

mkdir /proc
mkdir /sys
mount -t proc proc /proc
mount -t sysfs sysfs /sys
mount -t tmpfs tmpfs /dev
mdev -s

after running the above, do a "ls -l /dev/mmc*". this should have the mmcblk0p? with the correct minor code. and you should be able to mount on that device.

I see a lot of users supplying this to their default/startup.txt without having any idea what it does. "Mdev -s" will create mmcblkp?, is a wild card to mount any device named mmcblkp with 1 additional character, in this case a numberthe last line should be "mount /dev/mmcblkp /sdcard" for it to actually do something so the code should look more like

mkdir /proc
mkdir /sys
mount -t proc proc /proc
mount -t sysfs sysfs /sys
mount -t tmpfs tmpfs /dev
mdev -s
mount /dev/mmcblkp* /sdcard

Again, this is assuming you're having trouble mounting your partitions, if you aren't this is basically useless for you. This is pure*nix info, nothing android specific.

Build Your Own

In order to run Linux on your phone, you need

  • A boot loader

We use HaRET. (More on HaRET here..) The source for HaRET can be obtained from CVS. This is a snapshot from November 5, 2008. To build HaRET on an otherwise ready-to-build i386 linux machine, you need CEGCC . (Prebuilt mandriva cegcc mingw32ce-0.51.0-1.i586 worked for me (on an intel ubuntu vbox / Jobo). This one is prebuilt, modified to not complain about large images.)

  • A kernel

This page (Mirror from Google Cache) is a step-by-step recipe for building a Linux kernel the Diamond or Raphael. (There are separate configs for Raphael and Diamond now: htcraphael_defconfig and htcdiamond_defconfig) You will need the tool chain to cross compile to arm. How to get and install this tool chain is also described. It checks out this repository which will typically not contain the latest experimental or investigative/diagnostic code that gets posted around the forum.

  • User space (initrd and/or mountable file system on internal storage)

There are a couple of different flavors around: busybox, angstrom / X11, android. The one that has the most interest right now is android. You can find a step by step recipe to build android here. This produces an init ramdisk and 2 (yaffs) file system images: system and data. It also leaves the unpacked trees (next to the images in ./out/target/product/generic/) you can then copy to your SD card, use to make an initrd, use to make one or more fs images, ...
(I dont have the environment set up to build any other than android, add if you like)

Want network-enabled Angstrom booting from an ext2 partition on an SD card on your Raphael? The files you'll need are zipped up here. Unpack the zip and move the default.txt, zImage-jobo and haret executable to your device, and unpack the tar.gz into the root of the first partition of your microSD card. boot as usual - it comes up as over USB, expecting your linux machine on username root, no password.

You get a 30-second delay before mounting the root fs to calibrate the touchpad, and the screen goes blank (except the vkeyb) for much of the boot, but it works!

Useful links


2009-10-08 11:37 * An experimental build with wifi and bluetooth working has been released by phhusson get it here: Quote by phhusson: "It is based on 090909 from connect utb, and don't try any other image, it won't work. Unless you know what you do, you won't be able to get wifi by using only 3 of the zImage, initramfs, rootfs, system. WiFi can't be stopped (or you can somehow, but it won't restart while still consuming some extra power), and sometime, wifi won't start, just reboot (or unload the wl1251_sdio driver from the console). Bluetooth has only 115200 baudrate, handfree won't work. A2DP might work, but because of the available rate, it don't think it will."

Quote by Jan.Pekar: Link above seems to be broken, but try this page (build 20091115 has many positive votes) or (newer builds)

2009-09-18 11:37 * Backlight brightness control has been implemented.

Note: Currently working on some devices.

2009-09-17 04:37 * Panel power on/off working now, this should save even more battery.
2009-09-13 01:37 * Power Management improved,CPU completely powers down on sleep
2009-09-06 05:37 * Microphone support
  • A simple Power Management is implemented.
  • GPRS data connections reported working.
2009-09-03 01:17 * Audio
  • GPU

now reportedly working. Download pack from and latest zImage from;O=D

2009-06-09 08:32 Quotation of Jobo:

So it looks like we now have:

  • mmc for all devices (now together with good color),
  • correct colors for all devices (now together with mmc),
  • touch screen pressure size for all devices (but not yet confirmed for -800)
  • battery for -100, maybe also for -500, needs some twiddling for -800 (Battery driver does not (yet?, on -100?) detect cable status, or control charging. It only reports capacity.)
2009-03-01 22:30 RAPH800 color issue has been identified, and can be fixed by changing mdp.c, line 235 to this:


Still waiting to confirm what implications this has on RAPH100.

2009-02-19 ?:? I'm no expert, but here is what I can glean from the release notes at Wuala: The move to Linux 2.6.27 is finally done. Other than that, the visible changes arent that significant, but incomming calls now work, although there is still no sound and the microphone doesnt work yet either (which is now the current area of focus, so expect progress soon). Having used the latest revision, I know it supports SMS in and out, and therefore the radio. Touch based navigation is nearly perfect, there's a pretty good capacitive button/touch area driver, rotation, physical, and virtual keyboards all work. As do most of the Developer demos. Attempting to shut down Android still crashes the phone. I had to update this page, because not all hope is lost, and you don't have to sift through a multi-hundred page thread to find that out. WATCH THIS SPACE!  ;)
2009-01-07 14:20 Hardware buttons on the navi pad have been mapped as well as volume up/down buttons. The keyboard slider switch rotates android display orientation between portrait and landscape.

We can't yet tell Home from Send or Back from End as that requires control of the touch sensitive part (which is being worked on..)
Home/Send Send, Up Menu, Center Enter/Select, Down Back, Back/End End, Volume Up/Down Volume Up/Down

2008-12-30 09:36 lavender.t figured out how to run 1.0 on our Diamonds. It's still in a primitive stage but it should boot up fine. If you have any questions, first check the Questions and Answers, then the forum. If you still can;t find the answer you may post it.

How to install:

  1. Download this file diam-20081229.tar.gz 20081229 Mirror
  2. You also need a copy of Haret.exe.
  3. Unpack diam-20081229.tar.gz to your computer (e.g. your dekstop).
  4. Create a folder on your Diamond's Internal Storage named 'tmp' and put the three files from the 'imgs' folder from the zip, along with the three files in the root of the zip (initrd...gz, default.txt and zImage) and the 'haret-0.5.2' executable into that folder. Look at the first screenshot to see what should be in the 'tmp' folder.
  5. Start haret from your Diamond.
  6. When nothing is happening ond screen anymore type '/' (without the quotes) and press enter.
  7. Android should now boot!

Questions and Answers

Q: How to get back to the homescreen when I've opened a program?
A: At this moment there is only a softbutton solution:
If you go to the 'Spare Parts' App and change the "End Button Behaviour' to "Go To Home" that will change the "End" key on the soft keyboard to go back to the home page.

Q: When in Android, why does my screen often go black and become unresponsive?
A: The screen is going to sleep. The default setting for this is 1 minute. Until it is figured out how to wake the screen, you can change the default 1 minute value by going into the Settings application and change the sleep timeout value, under the Display application.

Q: When I try to boot Android 1.0 it says '_mmcblk0: unknown partition table_' and then stops booting.
A: Try launching Haret with Activesync through USB connected, when you get past the place you got stuck before it's ok to remove the USB cable.

Q: It's not working on my Touch Pro.
A: Thanks to LordKiwi it does work but with a modified initrd.droid.cpio Mirror. Just put all the files in 'tmp' on your Storage Card.

Q: The Vogue has a fully working Android 1.0, why don't we have one and when will it come?!
A: Please stop asking these kind of questions since nobody knows. A lot of people are working their butts off just for you so be patient, it will be here when it's done.


2znztb8.jpg dr8d21.jpg 25rz2o6.jpg

n5ig6t.jpg 11izh3d.jpg 24boh9h.jpg pauldgroot

2008-12-05 00:38 I've created two new linload (.exe) version with the latest kernel available in linuxtogo git.

20081204_android1.jpg 20081204_angstrom_usb1.jpg 20081204_angstrom_usb2.jpg

grtz, netripper

2008-12-02 09:30 The wiki hasn't been updated for a while now and people have been starting to wonder if it is up-to-date, abandoned and so on. Well, don't worry, it's still being maintained. There just hasn't been any significant progress lately. If you want to watch the progress more closely, you can read this thread.
2008-11-07 6:52 I put up a screenshot of Android on the Sprint Touch Pro so you could see what I mean by colors are messed up. -bertramt


2008-11-06 12:00 hillsdale was able to get Android 0.8 booting on the Sprint Touch Pro. Colors are still messed up, and it is still very beta code. Hopefully somebody can get his diff imported into the git branch. Hillsdale's patch can be found here: Remember, use at your own risk. -bertramt
2008-11-05 23:50 Kernel was updated to include some touchscreen changes to make it work properly (instead of having to mirror all actions). Also updated the initrd:
  • When booting, it now pauses in console to allow you to calibrate the touchscreen. Follow the on-screen instructions to do so.
  • Re-enabled some services that I had previously disabled. With this GSM magically works in android. You can now receive calls (and probably also make calls). Speaker and mic don't work though, so you can't have a conversation. Also note that you can (untested, but hinted by rl2000) hangup a phone call by pressing the 'end' key on the virtual keyboard.

Regarding the SPRINT versions of Diamond/Touch Pro; so far we have determined it's the msm_fb driver that doesn't seem to detect a framebuffer device and thus not create a tty0 to do the 'console handover'. Not sure why yet. There's been some testing with druidu's framebuffer code on which it seems to boot all the way to shell. So we've pretty much determined msm_fb driver is the cause of the Sprint issues - now we just need to solve it (easier said than done though...). :)

raph_20081105-01_android_v0.8_touchscreen_fix.exe (all my raph_*.exe loaders should also work on Diamond). (mirror)

Also just a thanks to rl2000 for giving me some webspace to put my loaders on. My DSL isn't fast enough by far for all you guys. :)

grtz, netripper

2008-11-04 2:16 I promised to put up some pictures and a link to the android v0.8 experimental linload. So here you go.

20081103_android_v0.8_1.jpg 20081103_android_v0.8_2.jpg 20081103_android_v0.8_3.jpg

2008-11-03 11:24 I'm a little bit late with this update, but better late than never. Since a little while people have managed to run Android v0.8 on their Diamond / Raphael. Nothing huge, but it's nice to see the GUI up and running. You can even play around a little bit, but as the touch screen driver is not finished yet, it's not so handy to use yet. I'll add a few pictures later. I'll also add a link to a linload version (=all in one .exe) to see the Android GUI.

On another note. There has been some experimentation with reading the NAND and even though (spurious) data could be read, windows mobile didn't boot anymore. Something was accidentally written to the NAND. Luckily the device could be saved by reflashing an OS ROM, but it could just as easily have written something in the SPL area of the NAND, which would permanently brick the device. Advice is not to play around with the NAND unless you really know what you're doing. The NAND is only 256 MB large and thus cannot contain the "Internal Storage" for the Diamond. For the people interested, the NAND device is a samsung_k9k2g08 (at least on Diamond, not checked for Raphael).

Next steps should be fixing the touchscreen driver to return calibrated results and getting the SD card to work, which hopefully is also the interface to the internal storage on Diamond.

Hope you're up to speed again. :)

2008-10-29 12:52 Last yesterday evening/night dcordes took the lead in merging my (netripper) code and druidu's code and shape it into a decent package. pH5 has added a branch for us on linuxtogo git to make life easier. Branch is named htc-msm-2.6.25 . It's a direct copy of the android-msm-htc-2.6.25 branch that is available on A machine definition has been added (HTCRAPHAEL) which will both boot the Raphael and Diamond, so when booting with haret, use mtype 1910 from now on. To get started, you can refer to the kaiser kernel building instructions. Make sure to rename 'htc-msm' in that guide to 'htc-msm-2.6.25'. :) Update: Also make sure to create a proper .config with make htcraphael_defconfig ARCH=arm before compiling your kernel.

Here 's a link to the .exe that boots this kernel for both Raphael and Diamond, and find the non-linload version here. When you use the latter one, modify the default.txt to change last line from 'ramboot' to 'bootlinux'.

Note that this version is just a cleanup and a bit of stability improvement - no new spectacular things.

2008-10-28 14:40 Just for some fun I modified the framebuffer logo. ;) It's a simple 80x80 224 color bitmap.

20081028_fblogo_smaller.jpg Diamond/Raphael branded Tux

2008-10-27 11:49 Linux boots all the way on Diamond/Raphael. We booted into a shell using an initrd cooked by NetRipper (with a busybox and some init scripts). I, druidu, wrote a touchscreen driver and an on-screen virtual keyboard using the touchscreen driver, and it all works very well. Check out the pics (courtesy of NetRipper). You can try the linload version on your Diamond or Raphael

20081027_touchscreen_keyboard1.jpg Raphael touchscreen with virtual keyboard 1! 20081027_touchscreen_keyboard2.jpg Raphael touchscreen with virtual keyboard 2! 20081027_touchscreen_keyboard3.jpg Raphael touchscreen with virtual keyboard 3!

2008-10-23 02:17 How about this - we got even further in the boot process. Hardware-wise we're not much further, we just disabled some drivers to get to boot it further. However, we do now use the framebuffer code which is also available in the HTC Dream / G1. Here's a picture with famous Tux. :D

Tux on framebuffer!

2008-10-22 23:23 Pictures of the framebuffer in action! Lovely! You'll see it already has support for colors. Credits to druidu.

20081022_framebuffer1.jpg 20081022_framebuffer2.jpg

2008-10-22 13:00 First let's sum up what's been done already, hoping winot to forget anything. HaRET was updated to include basic MSM7xxxA support. As base for kernel development we're using android-msm-htc-2.6.25 branch on HaRET can boot this kernel using the msm_defconfig when Halibut's MTYPE is configured in haret. As framebuffer didn't work we have been debugging on the Raphael using the flashlight and on the Diamond by turning off the LCD - just to see how far the kernel boots. Currently we have found that it hangs while initializing certain IRQs (DEBUG_TIMER and UARTs), so we skip initializing these now and it continues booting. Even better, druidu has been able to finally get the framebuffer to work. Currently it seems to be hanging spuriously on a message that indicates the modem is unresponsive, though sometimes it continues booting and initializes drivers. Work continues and I'll try to keep this page up to date...

Back to Raphael Main Page or Back to Xanadux