What's new
DroidForums.net | Android Forum & News

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

The TRUTH about kernels

banderbe

Member
This post is the product of seeing over the last six to nine months endlessly repeated claims by people that this kernel or that kernel is more stable, runs cooler, has better battery life, runs faster, etc.

This post isn't meant to knock those who like to build kernels. I like to build kernels. The guys who build kernels like Chevy and Jdlfg are nice guys. It seems like the end users who don't work on these kernels have no idea what actually goes into building a kernel. Well, to be honest, not that much goes into building a kernel. It's pretty easy to do and the kernels by Bekit, Chevy, AdamZ, P3Droid, Jdlfg, are all more or less the same.

While many of you may already know some of what will follow, many don't. My hope is that with this post I can at least to some degree put an end to all the hype surrounding kernels and kernel development.

The Life of A Kernel

A stock kernel for the Droid is born when a person downloads the kernel source code from the Android Open Source Project.

That person then builds the kernel against a generic kernel configuration (sholes_defconfig) that comes as part of the download and is compatible with the Droid.

Customizing The Generic Kernel

The customization that may be done to the kernel is fairly limited. The developer may change the available frequencies, the voltages used for those frequencies, and they may modify some of the configuration options to enable or disable certain features.

Voltage -
Each frequency has a corresponding voltage so the developer can try to use a lower voltage or a higher voltage depending on what kind of kernel he's making. Some Droids can run low voltage and some can't due to tolerances allowed by the semiconductor manufacturer during production of the ARM Cortex CPU. The voltage is represented in code as a hexadecimal value, and some kernel developers do not know what this value represents in mV (millivolts). Lower voltage means a cooler phone and longer battery life.

Short of actually seeing the voltages used by the kernel, there's no way to know if your "low voltage" kernel is lower than another "low voltage" kernel. I've seen "low voltage" kernels that used stock voltages and in fact had top frequency voltages beyond the Vmax of 1.8 volts specified in the ARM Cortex technical reference manual.

Frequency -
The generic kernel has seven slots and maxes out at 800 mhz. The developer can change the frequencies in these seven slots but as of kernel 2.6.32, they cannot change the number of slots. This is why all Froyo kernels have seven slots. The higher the frequency, the more voltage is needed to boot the phone and remain stable under load.

Modules -
The developer can modify the generic configuration to include things like:

TUN
EXT2/3/4
LZO compression (Swap/Compcache support)

These can be built as part of the kernel or as loadable modules.

Beyond these standard modules most of the more popular kernels on the market today are almost identical to the generic configuration.

The exception that I'm aware of are the configuration files of Bekit's Eclair kernels which had a large number of changes but these changes were simply based off of changes in the CyanogenMod kernel. Bekit himself would freely tell you that he didn't know what most of them did.

Kernel Code Changes

99% of the kernels available for the Droid have no source code changes beyond the changes to the frequency list mentioned above.

There is one small patch some developers have applied to support swap/compcache but this amounts to three or four lines of code modified by a script.

The one exception that I'm aware of are Jake Day's Droid kernels which contain (according to Jake) some 30,000 lines of modified code.

Conclusion

Outside of choosing a kernel because you need TUN, or because you want to use the new changes to read the OMAP sensor to track real time CPU temperatures, the only real difference that exists is how stable a kernel is on your hardware - getting back to the fact that some phones run better on higher voltage.

Remember the next time you see someone claiming that this kernel or that kernel seems faster, or smoother. It isn't.
 
Great post, very informative. I was just thinking "why dont I start to build my own kernels? I build my own linux kernels already" That way I'd know exactly what works best for my phone.
 
Thanks. That's exactly what I have ended up doing is building my own kernels. That way I can crank the voltage down as low as my phone will allow. Plus I can build in the modules I want, and experiment with other settings when time allows. It's a great way to learn about the linux kernel.
 
What's the "bump" for?!?! All kidding aside, thanks for the write up. I think battery life, voltage, and temperature are all very important reasons for the various kernels out there. I think these variations account for an overall feel of performance between these kernels. I understand your point about the limited number of configurable parameters, but they are important ones nonetheless. Great info. Thanks.
 
Wow, glad it did get bumped. This will be a useful link to post to those who say certain things. :)

Sent from my Droid
 
sorry to necrobump, but..

You forgot about kernel configuration!


kernels most certainly can be faster or smoother than another one built from the same code! just because there arent many code changes does not mean the kernel itself cannot be smaller, the less built into it, the better it performs. Plain and simple.

all kernels are not the same. yes the code is similar between most of them (mine included)...

the magic is in the config, pulling unwanted functionality out is the best way to reduce overhead and improve general performance

except for the 2.6.29 I used for RZRecovery which is mishmash of droidmod, slayher, and bekit code...
 
so does anyone have a favorite site for information about compiling your own kernel they would like to share?
 
Back
Top