LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-03-2009, 02:55 AM   #1
greplinux
Member
 
Registered: Jun 2007
Posts: 118

Rep: Reputation: 17
Linux loadable kernel modules help


Hi All,

While building a loadable kernel module say for example sample.c, we get various files as a result of successful compilation:
1. sample.ko -- module
2. sample.mod.c
3. sample.o
4. built-in.o
5. sample.mod.o

Will you guys please explain their purpose (except sample.ko)?

Thanks,
 
Old 04-03-2009, 03:14 AM   #2
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
Those files are required to put together the module, but because the Linux kernel is constantly evolving, they first need to be configured (created) with source headers matching the kernel version you want it to load onto. Normally the current running kernel.

Last edited by Junior Hacker; 04-03-2009 at 03:17 AM. Reason: reword
 
Old 04-03-2009, 05:09 PM   #3
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,568

Rep: Reputation: 164Reputation: 164
.mod.c stores the module structure in one place.
 
Old 04-03-2009, 05:39 PM   #4
synss
Member
 
Registered: Jul 2007
Location: Germany
Distribution: Debian, Gentoo, Mac OS X
Posts: 137

Rep: Reputation: 22
The kernel is written in C. The .o files are so-called object files. The object files can be linked to create an executable.
 
Old 04-06-2009, 02:52 AM   #5
greplinux
Member
 
Registered: Jun 2007
Posts: 118

Original Poster
Rep: Reputation: 17
Thank you all for your relies.
 
  


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
unload loadable kernel modules oren.m Linux - Kernel 3 03-26-2009 03:54 AM
LXer: Anatomy of Linux Loadable Kernel Modules LXer Syndicated Linux News 0 07-22-2008 07:20 AM
Need help creating a Loadable Kernel Modules jacatone Linux - Newbie 12 05-08-2008 06:23 PM
Loadable Kernel Modules and registering with SCSI shayes_enigmads Programming 0 05-25-2006 10:27 AM
Loadable Kernel Modules jbrashear Debian 7 04-03-2005 06:11 PM


All times are GMT -5. The time now is 06:53 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration