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/Building the Kernel

From XDA-Developers
Jump to: navigation, search

How to build the HTC Raphael & Diamond kernel

This mini howto is taken from dwaradzyn's post and sligtly changed to fit the diamond/raphael

For the Kaiser version, see Kaiser Kernal

This kernel is geared towards support for raph and diam, models 100,110,500,800.



Let's start with creating a directory for the kernel

  • mkdir kernel
  • cd kernel

First let's take care of arm toolchain. Download the toolchain (64MB) into the kernel dir
Unpack it

  • tar xjf arm-2008q1-126-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2


Next thing is to get the sources from repository. To make it happen (this could take a while, it downloads 280MB)


output:

Initialized empty Git repository in /home/user/kernel/kernel/.git/
remote: Counting objects: 908251, done.
remote: Compressing objects: 100% (153970/153970), done.
remote: Total 908251 (delta 755115), reused 906063 (delta 753016)
Receiving objects: 100% (908251/908251), 281.86 MiB | 292 KiB/s, done.
Resolving deltas: 100% (755115/755115), done.
Checking out files: 100% (22584/22584), done.


The htc-msm-2.6.25 branch is of our interest (again it could take a few seconds)

  • cd kernel
  • git checkout -b htc-msm-2.6.25 origin/htc-msm-2.6.25


output:

Branch htc-msm-2.6.25 set up to track remote branch refs/remotes/origin/htc-msm-2.6.25.
Switched to a new branch "htc-msm-2.6.25"


Compile the kernel Prepare default .config for Raphael/Diamond

//Raphael users use the following line:

  • make htcraphael_defconfig ARCH=arm

//Diamond users use the following line:

  • make htcdiamond_defconfig ARCH=arm


output:

........
lots of output
........
# configuration written to .config
#

And finally compile the kernel to get zImage (takes a minute or two):

  • export PATH=path/to/kernel/arm-2008q1/bin:$PATH
  • make zImage ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-


output:

........
lots of output
........
  Kernel: arch/arm/boot/zImage is ready


Now copy zImage to your phone and play with it.
I have been playing a little arround and found the following the most efficient way of deploying android to the phone.
Anyone have a better way of doing it please correct, its a bit tricky.

  • cd ../../
  • mkdir android-binaries
  • cd android-binaries
  • cp ../android-kernel/kernel/arch/arm/boot/zImage .

download these files to the android-binaries dir:


create a new txt file in the android-binaries dir call it default.txt and paste the following lines into it:





####### Boot Raphael board (also for Diamond devices)
set MTYPE 1910

####### KERNEL
set KERNEL zImage

####### INITRD
set INITRD android.bin

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

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

####### Command line to pass to kernel
set cmdline "mem=96M"

####### Boot from ram (needed for linload)
#ramboot
bootlinux





I have heard that there should be some problems with some windows roms, that require haret running on the internal memory and not the SD (please correct me if im wrong) plus the kernel is trying to load the USB drivers, this can at the moment only be done if the cable is connected to the pc.
So... we need to copy the files, to the internal memory, this is a little tricky.

On the PC:

  • connect the cable to the phone
  • copy the android-binaries dir to the phone
  • disconnect the cable

On the phone

  • start the filemanager
  • browse to where the files were placed
  • move the android-binaries to somewhere on the internal storage (it is working from the SD on my phone).
  • connect the usb cable to the phone again


Now we are ready to boot android.

  • tap the haret.exe, and accept the warning
  • when haret is running tap "run"


haret will now load the kernel and boot up android..
and you are ready to go..
when you have made the changes you want to the kernel it is just a matter of overwriting the zImage on the phone.


Back to Raphael Main Page

Personal tools