LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-26-2006, 06:46 AM   #1
Jayaraghavendran
LQ Newbie
 
Registered: Feb 2006
Posts: 16

Rep: Reputation: 0
Regarding building Kernel object in Linux 2.6


Hi,

I need to build a kernel object.

If I try with this command :

make M=/usr/src/linux2.6../../..

It is creating only ".o" files. I need a ".ko" to load it into the kernel.

How can I build a ".ko"?

Please help.

Thanks in advance.

Regards,
Jayaraghavendran.K
 
Old 04-26-2006, 11:32 AM   #2
madluther
Member
 
Registered: Aug 2004
Distribution: LFS
Posts: 350

Rep: Reputation: 31
A basic Makefile for building kernel 2.6 modules looks like this

Assuming the source is in a file named foo.c

Code:
obj-m += foo.o

all:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
HTH

Mad.
 
Old 04-27-2006, 03:22 AM   #3
Jayaraghavendran
LQ Newbie
 
Registered: Feb 2006
Posts: 16

Original Poster
Rep: Reputation: 0
Hi,

Thanks for your reply!!

I want to recompile one of the drivers by changing their code.

Do I need to compile the entire kernel for doing this?
Is there a specific command only for rebuilding that module?

Thanks in advance!!

Regards,
Jayaraghavendran.K
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Building ghostscript as a shared object on Unix platforms montylee General 0 08-11-2005 07:16 AM
building a profiler for linux kernel scheduler svi_ya Programming 0 09-28-2004 05:23 PM
How to write a kernel module(kernel object, .ko) on linux-2.6.0? oskernel Programming 1 10-21-2003 03:20 PM
How to write a kernel module(kernel object, .ko) on linux-2.6.0? oskernel Linux - Software 2 10-18-2003 07:04 AM
Building the linux kernel on redhat. liguorir Linux - Software 8 06-21-2003 05:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration