Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 04-03-2009, 01:55 AM   #1
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)?

Old 04-03-2009, 02: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 02:17 AM. Reason: reword
Old 04-03-2009, 04:09 PM   #3
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
.mod.c stores the module structure in one place.
Old 04-03-2009, 04:39 PM   #4
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, 01:52 AM   #5
Registered: Jun 2007
Posts: 118

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


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 02:54 AM
LXer: Anatomy of Linux Loadable Kernel Modules LXer Syndicated Linux News 0 07-22-2008 06:20 AM
Need help creating a Loadable Kernel Modules jacatone Linux - Newbie 12 05-08-2008 05:23 PM
Loadable Kernel Modules and registering with SCSI shayes_enigmads Programming 0 05-25-2006 09:27 AM
Loadable Kernel Modules jbrashear Debian 7 04-03-2005 05:11 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:37 AM.

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