From: Sam Ravnborg <sam@ravnborg.org>
To: murtuja bharmal <murtuja_bharmal@yahoo.com>
Cc: linux-kernel@vger.kernel.org,
linux-kbuild <linux-kbuild@vger.kernel.org>
Subject: Re: Linux 2.6 kernel module compilation without using KBUILD
Date: Wed, 28 Nov 2007 11:59:00 +0100 [thread overview]
Message-ID: <20071128105900.GA16537@uranus.ravnborg.org> (raw)
In-Reply-To: <180651.51647.qm@web36715.mail.mud.yahoo.com>
>
> My intention is to just understand whole
> process of making kernel module.
The short story....
kbuild knows that .o files listed with obj-m are modules.
So if you have:
obj-m := foo.o
the kbuild will know that it has to build a module named foo.o.
If foo.o consist of composite objects then kbuild
is told so using:
foo-y := bar.o baz.o
So in this case kbuild will build bar.o and baz.o and
use these for the resulting module named foo.
When building baz.o kbuild uses make to search for the source file.
First it look for baz.c - if it fails it look for baz.s
Does both fail kbuild give up (there are some corner cases but ignore that).
When foo.o is ready is uses some linker magic to link in version information
and the end result is foo.ko.
foo.ko has a number of unresolved symbols that are:
1) during build time checked if kernel or other modules define them
2) during load time they are resolved
The above is general stuff - if you need more details please be specific.
Sam
prev parent reply other threads:[~2007-11-28 10:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-28 8:09 murtuja bharmal
2007-11-28 9:00 ` Sam Ravnborg
2007-11-28 9:53 ` murtuja bharmal
2007-11-28 9:56 ` Robert P. J. Day
2007-11-28 10:40 ` murtuja bharmal
2007-11-28 10:59 ` Sam Ravnborg [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071128105900.GA16537@uranus.ravnborg.org \
--to=sam@ravnborg.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=murtuja_bharmal@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®