[Top] [All Lists]

Re: lkm question

Subject: Re: lkm question
From: Mike Belopuhov
Date: Mon, 19 Nov 2007 04:09:45 UTC
Newsgroups: fa.openbsd.tech

[email protected] wrote:
On Sun, Nov 18, 2007 at 06:33:50PM +0300, Mike Belopuhov wrote:
[email protected] wrote:
What is the purpose of changing ${LKM} to ${LKM}_lkmentry in the 'load'
rule in /usr/share/mk/bsd.lkm.mk ?
(as done in rev. 1.21)
There's no mention of it in the cvs log.

Yeah, correct.  modload(8) uses ${LKM}_lkmentry when tries to load
module named ${LKM}.  otherwise, it needs "-e ${LKM}" specification.

Then it would make more sense to remove it, since, as it stands, is
completely redundant ;-)

What about changing it to ${LKMENTRY}, and defining that by default to
${LKM}_lkmentry, so it could be easily overridden in the Makefile ?


Nope. When you're using bsd.lkm.mk, after ``make'' you get combined.o
which is an intermediate object file which lacks bindings to any
addresses. When you do ``make load'', modload(8) executes ld(1) to
create an actual kernel module which has all addresses binded to the
appropriate values. And that module will be named ${LKM}.

So if we remove that from the makefile, modload will be trying to
set up ``combined_lkmentry'' as an LKM code entry point. And this is
what we don't intend it to do. But once you've your module installed
to an appropriate location, you may load it without specifying an
entry point (if you have named it ${LKM}_lkmentry.)


you're never too old to rock'n'roll if you're too young to die.

<Prev in Thread] Current Thread [Next in Thread>