• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[Development]Kernel

Search This thread

manveru0

Senior Member
Oct 11, 2011
292
247
Bern
Hei there.

The idea of this thread is to develop a better kernel for the I9001 in the community. I have compiled my own one for using it in the cwm recovery mod. I've only changed the following so far:
Patched pm2.c file in the samsung kernel sources, see here for the patch:
https://github.com/PabloPL/android_...mmit/46e96915a7e0459dc6b3aec04aa47329371fff44

through menuconfig I've changed the default cpu governor from performance to ondemand.

What we should implement first is init.d support.

I've uploaded my boot.img file for further use here:
http://www.mediafire.com/?6p91s5knka0e0py

It also contains the CWM Recovery
 
J

joostvhoek

Guest
I would love to see a overclock able kernel! Great idea!

Joost

Sent from my GT-I9001 using XDA App
 

eidelen

Member
Oct 26, 2005
44
18
Thun
overclocking module

Hi guys,

coolbho3000 posted source of an overclocking module for HTC Vision. As far I know, it can be used with the SetCPU App together.
http://forum.xda-developers.com/showthread.php?t=813681

Since S+ has a similar Qualcomm chip, it should work as well.

I compiled the overclocking module with the S+ Kernel and packed it into the zImage. The device doesn't boot. Maybe it would be better to follow what coolbho3000 says and adapt the settings :)

ädu

PS: it needs definitively some adaptions.
 
Last edited:

abbradar

Senior Member
Apr 7, 2008
167
449
Shouldn't we create our own github/bitbucket repositories for kernel and CWM? I'm trying to get my feet wet in generic Android kernel development now, it would be cool to have repository to sync with.
 
  • Like
Reactions: yogi_best

manveru0

Senior Member
Oct 11, 2011
292
247
Bern
Shouldn't we create our own github/bitbucket repositories for kernel and CWM? I'm trying to get my feet wet in generic Android kernel development now, it would be cool to have repository to sync with.

yep of course. I've already opened an account on github. But right now I ain't got time to read the instructions on how to upload repos because I'm busy with applying some changes to FeaMod Recovery and testing them.

I would be happy if a lot of kernel developers would join us!

Edit: The sources for FeaMod recovery 1.1 are on github:
https://github.com/manveru0/FeaMod-Recovery--based-on-CWM-Recovery-

Samsung kernel sources with patched pm2.c:
https://github.com/manveru0/kernel_I9001_samsung
 
Last edited:

abbradar

Senior Member
Apr 7, 2008
167
449
Later I'll try to add "run-parts /system/etc/init.d/" to init.rc, but I'm highly confused from examining ramdisk, because I couldn't find any bash-scripts interpreter (possibly embedded into init executable?) and don't have enough time to continue examining init.rc now. I think, we can add busybox to system image and call it from there. Also, please, modify these lines in default.prop in your future builds:
Code:
ro.secure=0
ro.debuggable=1
As far as I understood, these allow us to use "adb root".

Also, thanks for your awesome work!
 

manveru0

Senior Member
Oct 11, 2011
292
247
Bern
Later I'll try to add "run-parts /system/etc/init.d/" to init.rc, but I'm highly confused from examining ramdisk, because I couldn't find any bash-scripts interpreter (possibly embedded into init executable?) and don't have enough time to continue examining init.rc now. I think, we can add busybox to system image and call it from there. Also, please, modify these lines in default.prop in your future builds:
Code:
ro.secure=0
ro.debuggable=1
As far as I understood, these allow us to use "adb root".

Also, thanks for your awesome work!

sounds good. I haven't seen a script interpreter either and I'm not quite sure if there is one included in the init. I think it's better we include busybox. Take a look at this thread by the way:

http://forum.xda-developers.com/showthread.php?t=1152740

I'll try to do that testwise.

Here's the adress for my uploaded boot.img-ramdisk without the samsung pictures (we can easily add them again when building a new boot.img):
https://github.com/manveru0/bootimage_ramdisk_I9001

I've already included the changes in default.prop

EDIT: some useful links
http://www.kandroid.org/online-pdk/guide/bring_up.html
http://www.androidenea.com/2009/08/init-process-and-initrc.html
 
Last edited:

abbradar

Senior Member
Apr 7, 2008
167
449
After some init.rd learning I've inserted a service here which should get the job's done, but I have no idea how to test it. Anyway, here is the diff from the normal one:
Code:
[[email protected] boot]$ diff -u3 init.rc ../boot_mod/init.rc
--- init.rc	2011-11-05 22:35:33.194680288 +0400
+++ ../boot_mod/init.rc	2011-11-05 22:24:40.000000000 +0400
@@ -566,7 +566,7 @@
     
     # ihryu 2010.07.19
     setprop ro.rfkilldisabled 0
-    class_start default
+    #class_start default
 # +++++++++++++++++++++++++++++++++++++++++++
 
     # for silent reset
@@ -714,6 +714,10 @@
     onrestart restart netd
     onrestart restart sensor-daemon
 
+service initd /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
+    oneshot
+
 service media /system/bin/mediaserver
     user media
     group system audio camera graphics inet net_bt net_bt_admin net_raw radio  qcom_oncrpc
[[email protected] boot]$
Have also commented "class_start default" which runs twice for some reason. To have this working in theory, you should have busybox installed in /system/xbin with run-parts support. For me, it boots at least ^_^
P.S. It also works if I call command line from adb. Also, adb root works after changing default.prop, good.
P.P.S. You can also remove "charging.rle" from repo, as it is image, too, but why not just keep all the files in repo? git is loyal to binary files as long as you don't try to create a patch. ~_^ Also, you can use .gitignore to exclude some files from git's view at all.
 
Last edited by a moderator:

abbradar

Senior Member
Apr 7, 2008
167
449
Found excellent reference on init.rd:
http://www.kandroid.org/online-pdk/guide/bring_up.html
Fixed previous post (removed "disabled"), so it should really work now. Going to test it, but not really sure if my test are correct (I'll try to write something to sdcard, but is it mounted r/w at the moment of script running?)
Test failed, thinking of some other, more accurate tests now.
Tried to create file in /cache, and it worked! Here is boot.img with working init.rd and adb root. Flash it via dd (dd if=boot.img of=/dev/block/mmcblk0p8). You should have busybox installed into /system/xbin for this to work.
 

Attachments

  • mod_boot.zip
    4.6 MB · Views: 51
Last edited by a moderator:

manveru0

Senior Member
Oct 11, 2011
292
247
Bern
Found excellent reference on init.rd:
http://www.kandroid.org/online-pdk/guide/bring_up.html
Fixed previous post (removed "disabled"), so it should really work now. Going to test it, but not really sure if my test are correct (I'll try to write something to sdcard, but is it mounted r/w at the moment of script running?)
Test failed, thinking of some other, more accurate tests now.

thx for your commit, I'm testing it as well with the adrenaline shot. If init.d support works you should see the changed values.
I do have a working busybox in /system/xbin with run-parts support, so that shouldn't be the issue as my tests didn't work so far.

Okay, gonna delete disable as well.

concerning the images i wasn't so sure about law problems since they include original samsung stuff.

update:

success :D You did it! Init support works. Though I have to retest it since I've also added user root to the init.rc. Honestly I'm not quite sure if that entry is needed
 
Last edited:

abbradar

Senior Member
Apr 7, 2008
167
449
Oh, you can use either "abbradar" or "YardE", I don't mind. ^_^ Thank you for credits and again for your work. Gonna experiment a bit with CWM now since init.d is working.
 
  • Like
Reactions: naturist

manveru0

Senior Member
Oct 11, 2011
292
247
Bern
Oh, you can use either "abbradar" or "YardE", I don't mind. ^_^ Thank you for credits and again for your work. Gonna experiment a bit with CWM now since init.d is working.

I have to thank you for your work as well, mate :) It's cool working as a team since we are better, faster and should see more bugs than working alone ;)

Edit:

Hmm, we should include busybox in the boot ramdisk, since not every user has busybox installed.

P.S: funny thing is, I've installed adrenaline shotv13 but only part of it works. For example the sdcard tweak works, the sysctl tweaks don't.

P.P.S: i've installed bash on my device, it's much more easier with it to navigate in the adb shell
 
Last edited:
  • Like
Reactions: ux50jp and naturist

abbradar

Senior Member
Apr 7, 2008
167
449
Hmm, we should include busybox in the boot ramdisk, since not every user has busybox installed.
What is the max size limit in our device for ramdisk? Also, should we really do so? It will be hard to update in comparison and maybe will be stripped due to size limit, and users basically'll have two versions of busybox - our embedded into boot.img and their own - in /system. (I'm looking on CM and other init.d implementations as an example) But on the other hand, it is really nearly critical level app (although sh is not in boot.img, for example)
P.S: funny thing is, I've installed adrenaline shotv13 but only part of it works. For example the sdcard tweak works, the sysctl tweaks don
They also trying to write some values into non-existent /sys nodes, looks like they are meant for other kernel scheduler, like BFQ (should we also try it?)

---------- Post added at 01:25 AM ---------- Previous post was at 01:25 AM ----------

P.P.S: i've installed bash on my device, it's much more easier with it to navigate in the adb shell
Good advice, thank you ^_^.
 

manveru0

Senior Member
Oct 11, 2011
292
247
Bern
What is the max size limit in our device for ramdisk? Also, should we really do so? It will be hard to update in comparison and maybe will be stripped due to size limit, and users basically'll have two versions of busybox - our embedded into boot.img and their own - in /system. (I'm looking on CM and other init.d implementations as an example) But on the other hand, it is really nearly critical level app (although sh is not in boot.img, for example)

They also trying to write some values into non-existent /sys nodes, looks like they are meant for other kernel scheduler, like BFQ (should we also try it?)

---------- Post added at 01:25 AM ---------- Previous post was at 01:25 AM ----------


Good advice, thank you ^_^.

the maximum size of both recovery and boot.img is 7864320 Bytes. Riversource once found that out. It's also in the BoardConfig.mk So we would have enough space for including busybox. But you're right, it would only lead to 2 busyboxes on the device which is not the best idea.

CM uses the BFQ scheduler as far as I know so yeah, we should give it a try
 

abbradar

Senior Member
Apr 7, 2008
167
449
AFAIK, BFS patch nearly fully removes original kernel schedulers, so some work of comparing with original Linux kernel will be needed to do. Although, it may not be true for Android kernel sources or my experience may be wrong, so we should just try it as is before continuing.

Sent from my GT-I9001 using XDA App
 

manveru0

Senior Member
Oct 11, 2011
292
247
Bern
AFAIK, BFS patch nearly fully removes original kernel schedulers, so some work of comparing with original Linux kernel will be needed to do. Although, it may not be true for Android kernel sources or my experience may be wrong, so we should just try it as is before continuing.

Sent from my GT-I9001 using XDA App

yep, I've looked at the changes the patches make and they remove alot of the CFQ related functions. Fortunately the makefile is patched as well so no work here.

I've have downloaded the patches for kernel 2.6.35 here:
http://algo.ing.unimo.it/people/paolo/disk_sched/sources.php

I applied them to my sources, compiled em and flashed my FeaMod pack with the new kernel and your changes to the boot ramdisk.

So far everything is working on my device :) I'm gonna upload the patches to github.

Edit: Had to change the .config as well since bfq is not the default I/O scheduler. It is now, I've also activated the hierarchical scheduler support.
 
Last edited:

abbradar

Senior Member
Apr 7, 2008
167
449
Concerning ramdisk git repo: maybe we should move all the code into some folder, for example, "ramdisk", and move README out from there to avoid it being placed into final image? Also, we should point which files are missing from ramdisk in README.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 6
    Hei there.

    The idea of this thread is to develop a better kernel for the I9001 in the community. I have compiled my own one for using it in the cwm recovery mod. I've only changed the following so far:
    Patched pm2.c file in the samsung kernel sources, see here for the patch:
    https://github.com/PabloPL/android_...mmit/46e96915a7e0459dc6b3aec04aa47329371fff44

    through menuconfig I've changed the default cpu governor from performance to ondemand.

    What we should implement first is init.d support.

    I've uploaded my boot.img file for further use here:
    http://www.mediafire.com/?6p91s5knka0e0py

    It also contains the CWM Recovery
    2
    No error there; just few warnings; leave it till finish.

    Oukay, I've managed to apply a new frequency table with overclocking up to 1700 MHz. I will test the new kernel for quite a time now since overclocking ain't easiest thing and anything may brick :D

    The new frequencys are:

    1017.6 MHz
    1209.6 MHz
    1401.6 MHz
    1516.8 MHz
    1612.8 MHz
    1708.8 MHz

    So far everything works well, but you definitely feel the phone getting warmer if the highest rate is applied, thus I'm using CPU Master free to set the highest frequency rate down 1400 MHz.
    2
    Found excellent reference on init.rd:
    http://www.kandroid.org/online-pdk/guide/bring_up.html
    Fixed previous post (removed "disabled"), so it should really work now. Going to test it, but not really sure if my test are correct (I'll try to write something to sdcard, but is it mounted r/w at the moment of script running?)
    Test failed, thinking of some other, more accurate tests now.
    Tried to create file in /cache, and it worked! Here is boot.img with working init.rd and adb root. Flash it via dd (dd if=boot.img of=/dev/block/mmcblk0p8). You should have busybox installed into /system/xbin for this to work.
    2
    Oh, you can use either "abbradar" or "YardE", I don't mind. ^_^ Thank you for credits and again for your work. Gonna experiment a bit with CWM now since init.d is working.

    I have to thank you for your work as well, mate :) It's cool working as a team since we are better, faster and should see more bugs than working alone ;)

    Edit:

    Hmm, we should include busybox in the boot ramdisk, since not every user has busybox installed.

    P.S: funny thing is, I've installed adrenaline shotv13 but only part of it works. For example the sdcard tweak works, the sysctl tweaks don't.

    P.P.S: i've installed bash on my device, it's much more easier with it to navigate in the adb shell
    2
    plz help me to un-cpio the zImage!
    i tried the script at xda wiki but is doesnt work!
    sorry for being a jerk,btw *embarassed*
    No problem, you are doing great work for our phone. ^_^ Suppose you have "boot.img", then you should split it into command line, kernel and ramdisk. You can use excellent Perl script "split_bootimg.pl", you can get it there:
    http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
    Next, you should un-gzip and un-cpio ramdisk part, it can be done with creating directory, cd-ing into it and running something like (supposing you have ramdisk file in parent directory):
    cat ../*.ramdisk.gz | gunzip | cpio -i
    Repacking is done with the help of mkbootfs and mkbootimg utils from Android build tools (I can post them there). You can do it with something like (in parent directory, supposing ramdisk dir is "ramdisk" and kernel is "kernel"):
    ./mkbootfs ramdisk | gzip > ramdisk.gz
    ./mkbootimg --kernel kernel --ramdisk ramdisk.gz --cmdline "console=null androidboot.hardware=qcom androidboot.emmc=true hw=6" -o $3 --base 0x00400000 --pagesize 4096
    Good luck!