KERNELS For Dummies

Last Updated:

  1. ocnbrze

    ocnbrze DON'T PANIC!!!!!!!!! Moderator

    Now that HTC has released the source code for the gingerbread and devs are now making gingerbread kernels, i figured that this is a good time to put up a guide to help those who do not understand what a kernel is and what it can do.

    one of the reasons that we all rooted our phones is so that we can enjoy better battery life then the non rooted phones. one way we can do this is to use a custom kernel.


    what is a kernel? a kernel basically communicates with and adjusts the voltage between the hardware(battery) and software(either sense or aosp) of your phone according to frequency. how much voltage a kernel decides to provide to and from your phone and at what frequency will depend on the type of kernels.

    there are two main type of kernels:
    cfs (completely fair scheduler): it tends to be more fair on an even distribution of voltage to all running processes (think apps). it is mainly designed for your typical standard tasks. things like using the web or text messaging can all be handled by cfs kernels. it tends to be better at giving the best battery life.

    bfs (brain f*ck scheduler): a kernel that is more focused on certain running processes like apps. the main purpose is to run apps that need more voltage and to run them more smoothly at the expense of other processes which tend to make the phone laggy. however, it can make game play run better.

    sub category
    havs (hybrid adaptive voltage scaling):there are different degrees of havs kernels. they run from more havs to less havs to no havs kernels. these kernels will have a variable range of voltages as the system fluctuates according to need. they tend to err on lowering the voltage on processes that does not need the set (static) voltage for that process. basically these kernels have a max and min and will adjust the voltages accordingly to the process at hand.

    no havs: since havs is not at work on these kernels, the default then is in the form of static voltage scaling which is an even amount of voltage that does not fluctuate regardless of what process is running. so even smaller tasks will get the same amount of voltage and thus potentially wasting battery life.

    static undervolting:when there isn't any havs implemented on the kernel then the kernel will be using static undervolting. for each cpu speed there is a set voltage number (it is always gonna be a constant number) assigned that are lower then the normal voltage.

    sbc (superior battery charging):this is a type of trickle charging that is slower in its charge and is best done overnight. it is supposed to prevent that initial 10% drop off charge. the idea is that as the voltage is pushed into the battery while charging very slowly, the battery will stay cool. by keeping the battery cool you will avoid plating where lithium ions are deposited on the anode of the battery in metallic form vs the ionic form. once lithium is metallic, it can no longer transfer electricity so obviously you want to avoid plating as much as possible.

    it also supposed to charge the battery past its normal 100%. your battery indicator has a certain value for what it deems to be 100%. however the sbc charge allows the battery to charge past that point. there was concern that the sbc kernel will overcharge the battery and thus kill the life of the battery and or it can cause it to explode. now in the past, if you look around the net, you will see that people were concerned for their phones exploding due to the use of sbc kernels. though there were a few cases (supposedly) of exploding phones early on, there has not been any reported that i know of since. and yes sbc kernels may degrade your battery down faster then non sbc kernels. however, i think that the trade off of getting better battery life is better then having a battery last longer. batteries are cheap these days anyways.

    More on Kernels

    now one thing about kernels and batteries is that the results may very for most people. kernels tend to react differently on different phones. there are just too many variables to consider. the best thing to do is to make a nandroid and try the kernels out and find out what works for you on your phone.

    every custom rom comes with its own kernel which in most cases is just stock. in order to switch kernels, all you would have to do is just flash a custom one of your choice. just make sure that you make a nandroid backup first then wipe dalvik cache and cache and flash away.

    kernels are designed to work the two main types of rom. there are one for sense and then there are ones for AOSP(Android Open Source Project). they also make universal kernels that works on both AOSP and sense. however, the AOSP kernels will not work on a sense rom and vice versa. Also the new gingerbread roms will not work with froyo kernels. the main thing is to make sure that you know what kernel you are flashing and what rom you have.

    Flashing Kernels

    this is how it is done: the kernel of your choice
    2.transfer the file over to the card
    3.go into recovery
    4.make a nandroid backup
    5.wipe dalvik cache and cache
    6.flash the zip file


    what is setcpu? it is an app found on the market that works on most android devices. its main purpose is to set and maintain cpu frequencies. also you will need a custom kernel if you want to over and underclock your phone using setcpu.

    not all phones have the same threshold for overclocking so you have to be careful on how high you set the frequency. make sure that the set on boot found on the main screen is not checked. if you overclock to high then your phone will not work right. it will seize up and could cause a reboot. if you have set on boot at that level then you will get a bootloop that is hard to get out of. once you know at what point your phone is overclocked but stable, then you can go ahead and set it on boot.

    as far as profiles go, i would bot recommend having too many. it is counterproductive and if you have a lot of profiles, then setcpu will then be working that much harder to monitor and maintain those profiles. usually a screen off profile is good enough to help save battery.


    scaling governors control exactly how the cpu scales between your "max" and "min" set frequencies.

    here is a great explanantion of some of the governors out there. thanx NaterTots!!!!!


    you can download setcpu from the market.

    checkout this guide:setcpu guide

    if you want to read more here are some threads you might want to checkout:

    guinzo, Rush, Mikestony and 42 others like this.
  2. frenchy714

    frenchy714 Well-Known Member

    Made Dummies Guide to Kernels a sticky.
  3. tube517

    tube517 Well-Known Member Contributor

    Good stuff!
    ocnbrze likes this.
  4. AndroidSerpent

    AndroidSerpent Well-Known Member

    Thanks for the explanation. I understood their function but never knew how to explain it to others. I feel with this explanation I can demonstrate it to others.
    ocnbrze likes this.
  5. nick1313

    nick1313 Well-Known Member

    Nice write up, subscribed and bookmarked for later use. ;)
    ocnbrze likes this.
  6. Ecktore

    Ecktore Well-Known Member

    I'll ask this for the sake of asking:

    Do you need to wipe anything prior to flashing a kernel? data/cache/dalvik???
  7. ocnbrze

    ocnbrze DON'T PANIC!!!!!!!!! Moderator

    just wipe dalvik cache and cache when flashing kernels. i'll add that in to the op.
  8. daniml

    daniml New Member

    Have been lurking and following along several threads here. This is so helpful to understand how it all fits together! Thanks!
    ocnbrze likes this.
  9. Mr. Ed

    Mr. Ed Well-Known Member

    Hey have any of you guys seen the app sgs kernel flasher? have you tried it on the evo?

    I have been using it on the's pretty slick.

    I was just wondering if it worked on the evo too
  10. ocnbrze

    ocnbrze DON'T PANIC!!!!!!!!! Moderator

    nope it is not on the supported list. there is the kernel manager by teamwin that is compatible with the evo.
  11. paully

    paully Well-Known Member

    Great write-up!

    In your "how to flash" section, you might add a blurb concerning that some kernels work with sense, and some do not. So folks should verify compatibility of the kernel "to be flashed" with their current ROM.
    ocnbrze likes this.
  12. ocnbrze

    ocnbrze DON'T PANIC!!!!!!!!! Moderator

    that is a great idea. i will add that to it. thanx

    edit: done
  13. CriticalCritic

    CriticalCritic Well-Known Member

    Any particular way to determine whether one is a netfilter-enabled kernel?
  14. ocnbrze

    ocnbrze DON'T PANIC!!!!!!!!! Moderator

    check the changelogs for the kernels. i just checked the gingerbread kernels and it does not seem to be supported. you can post on there thread in xda. they can give you feed back if they have plans for it or not.
    CriticalCritic likes this.
  15. Sarge1721

    Sarge1721 Well-Known Member

    I'm running golden monkey 1.1 and loving it. But can you stack kernels? I would like an SBC kernel as well. Also what type is GM? Thanks again...
  16. Xtremedays

    Xtremedays Well-Known Member

    To my knowledge you can not stack kernels. SBC kernels are in the works I believe but they want to get stable kernels out first to add SBC too. GM is a sense kernel based on the recently release source code for the stock kernel in the 2.3.3 OTA.
    ocnbrze and Sarge1721 like this.
  17. dustwun77

    dustwun77 Endeavor to Persevere :) Guide

    When you restore a nandroid, does it reinstall the Kernel you were using when you made it as well, or just the rom?

    Does a nandroid save things like the changes that were made when applying supercharger V6?
  18. ocnbrze

    ocnbrze DON'T PANIC!!!!!!!!! Moderator

    nandroids are a complete snapshot of everything on your phone. so yes kernels will be saved with your nandroids and same goes for the supercharger script.
    Nightmarearcad and dustwun77 like this.
  19. dustwun77

    dustwun77 Endeavor to Persevere :) Guide

    Thanks for the quick reply!

    Like the way you fixed up the Revolutionary thread too, Thanks!
    ocnbrze likes this.
  20. ocnbrze

    ocnbrze DON'T PANIC!!!!!!!!! Moderator

    thanx thought it looked to cluttered so i snazzed it up a bit.
  21. dustwun77

    dustwun77 Endeavor to Persevere :) Guide

    I have made a few nandroids now and they are on my sd card. i understand doing a restore reinstalls the one with the newest date. Is there an easy way to get it to choose a different one to restore?
  22. ocnbrze

    ocnbrze DON'T PANIC!!!!!!!!! Moderator

    you do not have to pick the newest one. you can use the vol up and down buttons to navigate and pick the nandroid you want to restore.
    dustwun77 likes this.
  23. dustwun77

    dustwun77 Endeavor to Persevere :) Guide

    Cool, now all I have to do is remember which is which. :p

    Does the recovery tool go after these based upon the fact they are in the nandroid folder? is it ok to give them descriptive names?
  24. ocnbrze

    ocnbrze DON'T PANIC!!!!!!!!! Moderator

    yes you can rename the nandroid backups. just do not use spaces and weird symbols. for me i just put the name of the rom in front of the date.
    dustwun77 likes this.
  25. dustwun77

    dustwun77 Endeavor to Persevere :) Guide

    That is a great idea! Thanks again for all your help!

Share This Page