Samsung Moment Forum
  
Welcome, Guest. Please login or register.

News: Do you like Samsung Moment?
Advanced search
Scratch-Proof your Samsung Moment        Best Price on Sprint Phones      Screen Protection Latest Ringtone for your mobile
Pages: [1] 2 3 4
Print
Topic: I built a Kernel and successfully flashed it! Let the custom kernels begin!  (Read 3434 times)
peepsalot
Jr. Member
**

Cookies: 8
Posts: 90


View Profile
« on: December 13, 2009, 04:37:31 AM »

Here's a pic of my phone running a kernel that I compiled:


So, basically now we have all the tools we need to compile our own kernels.  I didn't really try modifying the source this time around, but the compiled binary was definitely much different than the stock zImage, and my phone accepted the reflash and still runs.  

1) Get all the following requirements:
    Kernel source from Samsung  SPH-M900_OpenSource.zip
    Recovery image SPH-M900_CJ05_REL.tar
    Odin reflashing tool
    Samsung PC studio
    Samsung windows USB drivers
    A toolchain for cross compiling to arm (I used ELDK)
    list_initramfs_gen.c and Image.cpio from this post
    retar-moment.c from this post
2) Set up your cross-compiling toolchain.
3) Extract files from Image.cpio and generate your initramfs.list file. Explanation and tool download here.  The generated list file should be 85 lines long.  If you want to add any additional files you can edit the list at this point.  You could also edit any of the existing files extracted from Image.cpio
4) Extract your kernel source and edit linux-2.6.27/.config, pointing CONFIG_INITRAMFS_SOURCE to your new list file.
5) Create linux-2.6.27/.cross_compile file containing the path prefix to all your arm toolchain binaries. Example:
Code:
$ cat .cross_compile
/home/peeps/android/eldk/usr/bin/armVFP-
6) run make from your kernel source directory and if successful, you will have a new zImage in /arch/arm/boot
7) Verify that retar-moment.c works.  This program has not been extensively tested on a variety of platforms, so it's best to be sure that it works on yours before continuing. Untar the recovery image, compile retar-moment.c, and run it on the unmodified recovery files.  If the md5sum of the output file matches the stock recovery tar file, then you are good to go.
8 ) Create your custom .tar: replace the tar extracted zImage with your freshly compiled one, and run retar-moment again.
9) Load up Odin (make sure you have pc studio and USB debug drivers installed first), select Moment.ops and your new tar file.  Check one "one package" checkbox.
10) Set your phone into recovery mode: hold volume down, camera, and red End/Power key at same time, and quickly connect the USB cable.  It should show up in Odin, and you can click start.  Wait for the download to finish and there you are!

Oh, and replacing the logo.png also works  Grin:

« Last Edit: December 13, 2009, 05:43:58 PM by peepsalot » Logged
orangesunshine
Newbie
*

Cookies: -3
Posts: 26


View Profile
« Reply #1 on: December 13, 2009, 05:12:24 AM »

high five.
Logged
hokansoc
Global Moderator
Moment Monster
*****

Cookies: 21
Posts: 898


hokansoc@googlewave.com


View Profile WWW Email
« Reply #2 on: December 13, 2009, 05:17:33 AM »

truly awesome.... oh how i wish i didn't have finals on monday so i could spend all day tomorrow hacking. Oh well. Monday afternoon it'll have to be.
Logged
glitch77
Jr. Member
**

Cookies: -1
Posts: 55


View Profile
« Reply #3 on: December 13, 2009, 10:46:30 AM »

Outstanding work peeps! I can't thank you enough for your work on this thing.

Any ideas on what you will be doing next? Is this where init.rc is stored?


EDIT: I uploaded all the files you mentioned to http://sites.google.com/site/glitch77/
« Last Edit: December 13, 2009, 10:51:41 AM by glitch77 » Logged
peepsalot
Jr. Member
**

Cookies: 8
Posts: 90


View Profile
« Reply #4 on: December 13, 2009, 02:37:35 PM »

Outstanding work peeps! I can't thank you enough for your work on this thing.

Any ideas on what you will be doing next? Is this where init.rc is stored?


EDIT: I uploaded all the files you mentioned to http://sites.google.com/site/glitch77/

Thanks.  Not sure what I'll be doing next.

Yes, the initramfs contains 85 files, directories and symlinks including init.rc
Code:
-rwxrwxr-x   1 0        0            1289 Sep 30 04:54 /recovery.rc
drwxrwxr-x   2 0        0               0 Sep 30 07:10 /sys
-rw-rw-r--   1 0        0               0 Sep 30 04:54 /sys/stgloc
drwxrwxr-x   2 0        0               0 Sep 30 07:10 /tmp
-rw-rw-rw-   1 0        0             896 Sep 30 07:09 /tmp/s3c-keypad-rev0030.kcm.bin
-rw-rw-rw-   1 0        0             896 Sep 30 07:09 /tmp/s3c-keypad-rev0020.kcm.bin
-rw-rw-r--   1 0        0            2160 Sep 30 04:54 /tmp/s3c-keypad-rev0040.kl
-rw-rw-rw-   1 0        0             896 Sep 30 07:09 /tmp/s3c-keypad-rev0040.kcm.bin
-rw-rw-rw-   1 0        0             896 Sep 30 07:09 /tmp/s3c-keypad-rev001a.kcm.bin
-rw-rw-rw-   1 0        0             896 Sep 30 07:09 /tmp/s3c-keypad-rev0000.kcm.bin
-rwxrwxr-x   1 0        0              32 Sep 30 04:54 /tmp/sec_headset.kl
-rw-rw-rw-   1 0        0              32 Sep 30 07:09 /tmp/melfas_ts_input.kcm.bin
-rw-rw-r--   1 0        0            2130 Sep 30 04:54 /tmp/s3c-keypad-rev001a.kl
-rw-rw-r--   1 0        0            2130 Sep 30 04:54 /tmp/s3c-keypad-rev0020.kl
-rw-rw-r--   1 0        0            2020 Sep 30 04:54 /tmp/s3c-keypad-rev0000.kl
-rw-rw-r--   1 0        0            2020 Sep 30 04:54 /tmp/s3c-keypad-rev0010.kl
-rw-rw-r--   1 0        0            2160 Sep 30 04:54 /tmp/s3c-keypad-rev0030.kl
drwxrwxr-x   2 0        0               0 Sep 30 07:10 /tmp/bootchart
-rw-rw-r--   1 0        0               0 Sep 30 04:54 /tmp/bootchart/stgloc
-rw-rw-rw-   1 0        0             896 Sep 30 07:09 /tmp/s3c-keypad-rev0010.kcm.bin
-rw-rw-r--   1 0        0           14558 Sep 30 04:54 /init.rc
lrwxrwxrwx   1 0        0              11 Sep 30 07:10 /etc -> system/etc
drwxrwxr-x   2 0        0               0 Sep 30 07:10 /lib
drwxrwxr-x   2 0        0               0 Sep 30 07:10 /lib/modules
-rw-rw-r--   1 0        0            8640 Sep 30 07:10 /lib/modules/s3c_g2d_driver.ko
-rw-rw-r--   1 0        0           39036 Sep 30 07:10 /lib/modules/dpram.ko
-rw-rw-r--   1 0        0            1676 Sep 30 07:10 /lib/modules/xsr_debug.ko
-rw-rw-r--   1 0        0          126032 Sep 30 07:10 /lib/modules/xsr.ko
-rw-rw-r--   1 0        0               0 Sep 30 04:54 /lib/modules/stgloc
-rw-rw-r--   1 0        0            4760 Sep 30 07:10 /lib/modules/btgpio.ko
-rw-rw-r--   1 0        0          114412 Sep 30 07:10 /lib/modules/rfs.ko
-rw-rw-r--   1 0        0            4144 Sep 30 07:10 /lib/modules/vibrator.ko
-rw-rw-r--   1 0        0           11840 Sep 30 07:10 /lib/modules/s3c_cmm.ko
-rw-rw-r--   1 0        0           10312 Sep 30 07:10 /lib/modules/param.ko
-rw-rw-r--   1 0        0           71968 Sep 30 07:10 /lib/modules/xsr_stl.ko
-rw-rw-r--   1 0        0           17408 Sep 30 07:10 /lib/modules/s3c_g3d.ko
-rw-rw-r--   1 0        0           17092 Sep 30 07:10 /lib/modules/s3c_pp.ko
-rw-rw-r--   1 0        0           94560 Sep 30 07:10 /lib/modules/s3c_camera.ko
-rw-rw-r--   1 0        0            7404 Sep 30 07:10 /lib/modules/s3c_rotator.ko
-rw-rw-r--   1 0        0           16572 Sep 30 07:10 /lib/modules/s3c_jpeg.ko
-rw-rw-r--   1 0        0           94840 Sep 30 07:10 /lib/modules/yaffs2.ko
-rw-rw-r--   1 0        0          118976 Sep 30 07:10 /lib/modules/s3c_mfc.ko
-rw-rw-r--   1 0        0          183840 Sep 30 07:10 /lib/modules/dhd.ko
drwxrwxr-x   2 0        0               0 Sep 30 07:10 /.info
-rw-rw-r--   1 0        0             220 Sep 30 07:10 /.info/rootfs.info
drwxrwxr-x   2 0        0               0 Sep 30 07:10 /proc
-rw-rw-r--   1 0        0               0 Sep 30 04:54 /proc/stgloc
lrwxrwxrwx   1 0        0              10 Sep 30 07:10 /init -> sbin/init
-rw-rw-r--   1 0        0             185 Sep 30 04:54 /init.SPH-M900.rc
-rw-rw-r--   1 0        0           14121 Sep 30 04:54 /factorytest.rc
drwxrwxr-x   2 0        0               0 Sep 30 07:10 /sbin
-rwxrwxr-x   1 0        0          117472 Sep 30 07:10 /sbin/adbd
-rwxrwxr-x   1 0        0          461312 Sep 30 07:10 /sbin/redbend_ua
-rwxrwxr-x   1 0        0          309568 Sep 30 07:10 /sbin/recovery
-rwxrwxr-x   1 0        0          930900 Sep 30 07:10 /sbin/devmgr
-rwxrwxr-x   1 0        0          135396 Sep 30 07:10 /sbin/init
-rwxrwxr-x   1 0        0           74972 Sep 30 07:10 /sbin/memps
drwxrwxr-x   2 0        0               0 Sep 30 07:10 /sbin/images
-rwxrwxr-x   1 0        0            7072 Sep 30 04:55 /sbin/images/icon.png
drwxrwxr-x   2 0        0               0 Sep 30 07:10 /system
drwxrwxr-x   2 0        0               0 Sep 30 07:10 /system/etc
-rw-r--r--   1 0        0              64 Sep 30 07:10 /system/etc/ld.so.cache
-rw-rw-r--   1 0        0           14134 Sep 30 04:54 /fota.rc
-rw-rw-r--   1 0        0             118 Sep 30 04:54 /default.prop
drwxrwxr-x   2 0        0               0 Sep 30 07:10 /dev
-rw-rw-r--   1 0        0               0 Sep 30 04:54 /dev/stgloc
drwxrwxr-x   2 0        0               0 Sep 30 07:10 /res
drwxrwxr-x   2 0        0               0 Sep 30 07:10 /res/images
-rw-rw-r--   1 0        0           20214 Sep 30 04:55 /res/images/indeterminate3.bmp
-rw-rw-r--   1 0        0           91076 Sep 30 04:55 /res/images/icon_firmware_error.bmp
-rw-rw-r--   1 0        0           91076 Sep 30 04:55 /res/images/icon_error.bmp
-rw-rw-r--   1 0        0             136 Sep 30 04:55 /res/images/progress_bar_fill.bmp
-rw-rw-r--   1 0        0           20214 Sep 30 04:55 /res/images/indeterminate4.bmp
-rw-rw-r--   1 0        0             294 Sep 30 04:55 /res/images/progress_bar_right_round.bmp
-rw-rw-r--   1 0        0           20214 Sep 30 04:55 /res/images/indeterminate5.bmp
-rw-rw-r--   1 0        0             294 Sep 30 04:55 /res/images/progress_bar_empty_left_round.bmp
-rw-rw-r--   1 0        0             136 Sep 30 04:55 /res/images/progress_bar_empty.bmp
-rw-rw-r--   1 0        0           91076 Sep 30 04:55 /res/images/icon_unpacking.bmp
-rw-rw-r--   1 0        0           91076 Sep 30 04:55 /res/images/icon_firmware_install.bmp
-rw-rw-r--   1 0        0           91076 Sep 30 04:55 /res/images/icon_installing.bmp
-rw-rw-r--   1 0        0           20214 Sep 30 04:55 /res/images/indeterminate1.bmp
-rw-rw-r--   1 0        0             294 Sep 30 04:55 /res/images/progress_bar_empty_right_round.bmp
-rw-rw-r--   1 0        0           20214 Sep 30 04:55 /res/images/indeterminate6.bmp
-rw-rw-r--   1 0        0             294 Sep 30 04:55 /res/images/progress_bar_left_round.bmp
-rw-rw-r--   1 0        0           20214 Sep 30 04:55 /res/images/indeterminate2.bmp
Logged
Burst
Full Member
***

Cookies: 4
Posts: 119


Get some!


View Profile WWW
« Reply #5 on: December 13, 2009, 04:25:53 PM »

not really sure what all that means but excellent work!

even more to learn now >.<
Logged
thenuge26
Newbie
*

Cookies: 1
Posts: 36


View Profile Email
« Reply #6 on: December 13, 2009, 04:37:59 PM »

success on the new retar-moment.c

I will upload the win32 binary, maybe glitch can put that up on the repository he has.

This will replace retar-moment.c for all of you who use windows, this is a little bit less linux that you need to use.

* retar-moment.exe (19.34 KB - downloaded 20 times.)
Logged
TheDub
Full Member
***

Cookies: 0
Posts: 116


View Profile Email
« Reply #7 on: December 13, 2009, 05:03:40 PM »

Wow fantastic work!!! So let me try to grasp this exactly... retar-moment.exe will make a .tar file with the exact same checksum as the official samsung rom?

If so couldn't we in theory flash any rom we wanted to now simply by using our new handy program? Or will the bootloader remain unchanged and therefore not recognize anything but RFS?
Logged
hokansoc
Global Moderator
Moment Monster
*****

Cookies: 21
Posts: 898


hokansoc@googlewave.com


View Profile WWW Email
« Reply #8 on: December 13, 2009, 05:08:25 PM »

That'll be helpful... I think i'll just set my laptop up to dual-boot intu ubuntu though. I've been meaning to do it for a while, so this will make a good catalyst. ^^   (for those looking for linux, if you have a jumpdrive, you can install linux on your jumpdrive and boot from that instead of a cd if you want).

On a side note, does anyone know if there is a limit to the complexity of the logo image? for example, could u use a full (256) color picture the size of the screen?

EDIT: is this how you got the right kind of image or is it just a .png? http://forum.xda-developers.com/showthread.php?t=456071
« Last Edit: December 13, 2009, 05:13:24 PM by hokansoc » Logged
glitch77
Jr. Member
**

Cookies: -1
Posts: 55


View Profile
« Reply #9 on: December 13, 2009, 05:14:47 PM »

It's done!

Peeps himself will now maintain his section on http://sites.google.com/site/glitch77/ so files wont be out of date!


Hokansoc: I attached peep's png for you.


* logo2.png (6.03 KB, 320x480 - viewed 56 times.)
« Last Edit: December 13, 2009, 05:56:56 PM by glitch77 » Logged
gargarxp
Newbie
*

Cookies: 0
Posts: 1


View Profile Email
« Reply #10 on: December 13, 2009, 05:48:43 PM »

Well this is fantastic indeed.  I'm gonna give this a shot myself, tonight.  I want to see if I can add in Netfilter support so as to get Wifi tethering working...

One question, though; Could you elaborate a bit more on your cross-compile toolchain?  I've never (successfully) cross-compiled, and ELDK looks good, I'm just curious what you did to set it up.

I'm seeing the latest ARM version on their FTP as 4.1, is that correct?  If so, should I grab the arm-linux-x86 version or the uClibc version?


Logged
peepsalot
Jr. Member
**

Cookies: 8
Posts: 90


View Profile
« Reply #11 on: December 13, 2009, 05:50:45 PM »

On a side note, does anyone know if there is a limit to the complexity of the logo image? for example, could u use a full (256) color picture the size of the screen?

EDIT: is this how you got the right kind of image or is it just a .png? http://forum.xda-developers.com/showthread.php?t=456071

I just took the logo from samsung and edited it with GIMP.  It looks like the image format is already in full (24bit Grin) color, it's just not using any of those colors.  The original image is 5257 bytes, and my version is 6171 bytes.  It looks like that partition (bml3) can support a filesize up to about 380KB.
« Last Edit: December 13, 2009, 05:52:44 PM by peepsalot » Logged
hokansoc
Global Moderator
Moment Monster
*****

Cookies: 21
Posts: 898


hokansoc@googlewave.com


View Profile WWW Email
« Reply #12 on: December 13, 2009, 05:53:36 PM »

Good to know.  :-)  I was afraid i was going to have to do that crap to convert it to a .raw and then a .565.   Full color random bootscreen, here we come.


P.S.  Glitch.. if you're going to break my username into words, I prefer "hawk-in-sock"  Wink
Logged
glitch77
Jr. Member
**

Cookies: -1
Posts: 55


View Profile
« Reply #13 on: December 13, 2009, 05:57:24 PM »

Sorry, it's been a long couple of nights.
Logged
peepsalot
Jr. Member
**

Cookies: 8
Posts: 90


View Profile
« Reply #14 on: December 13, 2009, 05:58:33 PM »

Well this is fantastic indeed.  I'm gonna give this a shot myself, tonight.  I want to see if I can add in Netfilter support so as to get Wifi tethering working...

One question, though; Could you elaborate a bit more on your cross-compile toolchain?  I've never (successfully) cross-compiled, and ELDK looks good, I'm just curious what you did to set it up.

I'm seeing the latest ARM version on their FTP as 4.1, is that correct?  If so, should I grab the arm-linux-x86 version or the uClibc version?




This is the exact one i used:
http://ftp.denx.de/pub/eldk/4.2/arm-linux-x86/iso/arm-2008-11-24.iso
It's v4.2 and it's apparently non-uclibc.

I didn't even notice there was a uclibc version, it's worth a shot trying that one, it might even produce a more efficient kernel than what I built.  I'm sure there are many variations of toolchains that can build a runnable kernel, this is just the first one that I personally was able to get working.

As far as setting up the toolchain, I don't even remember what was involved, I think it was pretty straightforward.  It should come with a README or something.

If you get one with uclibc i'd be intersted in seeing benchmark results
« Last Edit: December 13, 2009, 06:03:04 PM by peepsalot » Logged
Pages: [1] 2 3 4
Print
Jump to:  

Samsung Moment SPH-M900 (Full Body)






Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC