How to build lodable kernel module in android?

342 views
Skip to first unread message

fox liu

unread,
Jul 13, 2011, 11:51:17 AM7/13/11
to Android Linux Kernel Development
Hi, my Question is how to build lodable kernel module in android?

I have a little LKM exp. in PC, now I would like to try LKM in
android .
And I have followed the instruction of source.android.com, the repo
sync, and make -j4 are all done succesfully.

What about next step?
Can I start writing LKM now?
if "no": what should I do.
if "yes": where can I find the compiler, which compiler should I
use? I find many 'gcc' in the source dir.
Is there any complete guide for this?

I am new to Android , may be those are stupid question. thanks for
your time and considerations.

J Freyensee

unread,
Jul 13, 2011, 5:25:45 PM7/13/11
to android...@googlegroups.com
On Wed, Jul 13, 2011 at 8:51 AM, fox liu <yaonim...@gmail.com> wrote:
Hi, my Question is how to build lodable kernel module in android?

I have a little LKM exp. in PC, now I would like to try LKM in
android .
And I have followed the instruction of source.android.com, the repo
sync, and make -j4 are all done succesfully.

What about next step?
Can I start writing LKM now?
 if "no":  what should I do.
 if  "yes":  where can I find the compiler, which compiler should I
use? I find many 'gcc' in the source dir.
Is there any complete guide for this?

Build environment step-by-step is here:
http://source.android.com/source/initializing.html
 

I am new to Android , may be those are stupid question. thanks for
your time and considerations.

fox liu

unread,
Jul 13, 2011, 7:36:38 PM7/13/11
to android...@googlegroups.com
Hi, I mean I have already followed the step on http://source.android.com/source/initializing.html
     Now I want to write a LKM, then  compile it , and push it to device, and insmod it.
     but I do not know how to compile it, do I make my self clear?

2011/7/13 J Freyensee <why...@gmail.com>

alexyu

unread,
Jul 13, 2011, 10:54:34 PM7/13/11
to Android Linux Kernel Development
Hi,

It is a standard kernel module development & I think it has nothing
related to android.

Command 'make modules" could simply work. If not try the following
steps.

1. Only configure your module from “=y” to “=m”.
2. Build the driver in your kernel directory: make drivers/xxx.ko
3. The xxx.ko will be generated and you can download to development
board as usual.

For download steps, you could use adb push command.

best regards,

AlexYu

On Jul 14, 7:36 am, fox liu <yaoniming2...@gmail.com> wrote:
> Hi, I mean I have already followed the step onhttp://source.android.com/source/initializing.html
>      Now I want to write a LKM, then  compile it , and push it to device,
> and insmod it.
>      but I do not know how to compile it, do I make my self clear?
>
> 2011/7/13 J Freyensee <why2...@gmail.com>
Reply all
Reply to author
Forward
0 new messages