Help building Kernel Module - Android General

Hello All,
I am new in the android world, but am fairly experienced on the Linux side of things. I would like to build a loadable kernel module for a specific version of JB (4.2.2_r1) and have some general questions.
As I understand it, the process should be as follows:
Get kernel source for JB, compile kernel, then compile kernel module. Please correct me if I am wrong
I can't seem to find the kernel source for this, can anyone point me to exactly where it is?
Thanks

Related

Building Kernel for Dream

Hello
As the prebuilt Kernel which comes with the dream-open project is not as cutting edge es I'd like it to be, I wanted to build the Kernel myself and checked out the sources for 2.6.29.
Now I've got some questions and problems:
Are there any known problems of using this kernel with the master branch? Are there any special/manual changes needed?
What are the best settings for the .config file to get a performance oriented and good kernel? Is msm_defconfig any good? (Maybe someone has a .config he could share with me?)
Are there any build time optimizations which would increase perfomance? (I read something about -O2)
Does only the WiFi Module have to be rebuilt?
When I played around, I got an error that a file (elf.h) is missing. How would I correct that/Which file is meant/Where would I get it?
It would be great if someone could answer these questions
Thank you very much

Compiling Android + Kernel from Source.

Hi there,
Now, I understand that there's a thread or two and a few web pages directed at compiling Android and its kernel from source.
However, the thread in question is months old, and didn't fully explain the process.
As for the web pages, they are mostly outdated and don't include enough information, not to mention desire specific instructions.
I think that, properly explained, building Android shouldn't be daunting, and everyone should be able to attempt it, if they wanted to.
So, I hope to compose a comprehensive guide on how to do just that.
The problem is that I myself have not been able to put enough instructions together to be able to complete a build. And there is no point digging up old threads.
So, If anyone who knows the ropes (that is, compiling android and a kernel from source) would be willing to lead the way, I'd happily turn it into an easy to understand guide.
Josh.
fllash said:
Hi there,
Now, I understand that there's a thread or two and a few web pages directed at compiling Android and its kernel from source.
However, the thread in question is months old, and didn't fully explain the process.
As for the web pages, they are mostly outdated and don't include enough information, not to mention desire specific instructions.
I think that, properly explained, building Android shouldn't be daunting, and everyone should be able to attempt it, if they wanted to.
So, I hope to compose a comprehensive guide on how to do just that.
The problem is that I myself have not been able to put enough instructions together to be able to complete a build. And there is no point digging up old threads.
So, If anyone who knows the ropes (that is, compiling android and a kernel from source) would be willing to lead the way, I'd happily turn it into an easy to understand guide.
Josh.
Click to expand...
Click to collapse
I followed this guide here and successfully compiled a modified HTC Kernel and I had very little Linux and Android experience.
Obviously instead of cloning the Cyanogen git, you just use the gits you wish to compile
Mekrel said:
I followed this guide here and successfully compiled a modified HTC Kernel and I had very little Linux and Android experience.
Obviously instead of cloning the Cyanogen git, you just use the gits you wish to compile
Click to expand...
Click to collapse
Thanks for the link
Though i don't fully understand the whole 'git' thing. Where do i find them? And how to i know which ones are the ones i want to use?
Josh
EDIT: Also, how do you 'edit' the kernel (i imagine it is somewhat like make menuconfig?). Also:
- Are these sense kernels?
- How do you add modules like OC and UV?
fllash said:
Thanks for the link
Though i don't fully understand the whole 'git' thing. Where do i find them? And how to i know which ones are the ones i want to use?
Josh
EDIT: Also, how do you 'edit' the kernel (i imagine it is somewhat like make menuconfig?). Also:
- Are these sense kernels?
- How do you add modules like OC and UV?
Click to expand...
Click to collapse
A git is a repository for source code, developers upload their source code there and can commit changes. The commit can allow descriptions of what was changed and also details the files changed.
The git system allows other people to add to the source if they have permission, or allows others to read the changes and download the source code.
Git links are usually posted by people who release software, as Android is GPL licensed so people have to release their source code if they're distributing their work.
Editing the kernel, take a look into the git and the commits and it will show you which files were changed and how exactly they were changed. That will give you the best understanding.
UV/OC is done by changing the acpu table in the architectures files and changing the minimum/maximum voltage figures in the board_bravo.c file.
The Cyanogen kernels are not Sense kernels no, it's a modified Google Kernel.
Thanks for the explanation. I followed the guide and built the rom, and it works (always a plus )
Now, the next thing is the kernel. How do I build a kernel with the CM tweaks integrated? I understand that all i would be doing is rebuilding the same one that is already installed, but im doing it to learn.
So, if i synced the GIT, does that include the CyanogenMOD kernel source? If it does, where is it and how do i rebuild it. If not, where do i find it?
Thanks,
Josh.

[Q] Android kernel programming

Hi All
I am a newbi to kernel programming , especially to android kernel.
Can you tell me some good places on the net , that can be great sources for getting in touch with that thing.
I want to become familiar with the android kernel , dalvic etc. ( I speak english and german )
thanks in advance.
Sz_gergo
I am too interested in this subject. I am learning slowly as and when I get time.
kernelnewbies.org
Generally good resource for starting out learning linux kernel
(Which is what the android is built off of)
android.git.kernel.org
Android Kernel Source
lwn.net/Kernel/LDD3/
Online guide to driver development among many other related topics.
pdk.android.com
This guide provides an under-the-hood introduction to the Android platform, and is designed for platform developers and manufacturers building Android-powered devices.
Sorry for not providing the links...xda won't allow me to post links since I have less posts.
Android kernel
Dear All
as i understand, the android kernel source, what you can download from Google , should be enough for building a new kernel to some phone.
If i am right, does that mean that the Linux kernel sources are already included?
Or am i totally wrong?
Thanks for your answers
I am also interested in learning the Kernel Development and ROM development. Can Any one Help.
sz_gergo;11673408 begin_of_the_skype_highlighting 11673408 end_of_the_skype_highlighting said:
Dear All
as i understand, the android kernel source, what you can download from Google , should be enough for building a new kernel to some phone.
If i am right, does that mean that the Linux kernel sources are already included?
Or am i totally wrong?
Thanks for your answers
Click to expand...
Click to collapse
I have the answere for the question above.
After i have inspected the Android kernel sources, it came out, that i have been right.The only source you need for creating a new kernel for a phone, is the complete android kernel.
The linux kernel is allready included.
I think if you want to build a kernel, specific for your phone. you have to overwrite the default dirs with the specific sources of your phone. If it is not allready done by others.
Android Kernel
Hi,
We need to distinguish between Linux and Android. Android was forked from Linux, and now those are managed as separate products. Android usually takes the updates from linux, but there are features in Android which Linux refused to get (such as wakelocks).
So the android kernel source includes all needed to build a working kernel.

[Q] Kernel Compile

Hey guys, I want to install a custom kernel, razrqcom-dev-team kernel, on my XT925 - Carbon ROM(0614) but I dont find any information about how to procede.
I downloaded the repository android_kernel_motorola_msm8960-common(razrqcom-dev-team). Someone has a good instruction or know a good tutorial to share?
My apologies about my poor english
Cheers,
Just to clarify: Are you looking for the pre-compiled kernel or do you want to learn how to build android from source?
If you only want a precompiled kernel, then you shouldn't worry, as the right one is already built in line with the rom you chose.

[NOOB QUESTION] Can an old android phone get the newest linux kernel without baseband functionality?

i'm noob here, so... sorry if the question sound silly...
is it possible to have an old qualcomm device (msm8610) a latest linux kernel such as 5.10 or 5.11 if i don't need the baseband functionality? is all the other driver is also closed source? i'm asking this because i have an old unused phone that i want to use to learn about kernel compiling and learn about hardware and stuff, and i just don't want to waste my time if such thing is impossible (compiling latest kernel for old phone)...
pink101 said:
i'm noob here, so... sorry if the question sound silly...
is it possible to have an old qualcomm device (msm8610) a latest linux kernel such as 5.10 or 5.11 if i don't need the baseband functionality? is all the other driver is also closed source? i'm asking this because i have an old unused phone that i want to use to learn about kernel compiling and learn about hardware and stuff, and i just don't want to waste my time if such thing is impossible (compiling latest kernel for old phone)...
Click to expand...
Click to collapse
If the stock kernel source code for your device is available to the public, you can use that to compile a new custom kernel for your device. But, an old device may not be able to use the latest kernel. If the stock kernel source code for your device is not available, you can't build a new custom kernel for your device.

Categories

Resources