[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [SLL] Test module: Version conflict on a hello.o



Xeno Campanoli wrote:
> 
> I'm trying to do the example on pages 13-14 of Rubini's Linux Device

> inneal:~/study# insmod hello.o
> hello.o: kernel-module version mismatch
>         hello.o was compiled for kernel version 2.2.20
>         while this kernel is version 2.2.19.
> 
> and it doesn't show up in an lsmod listing.  When I do the command:
> 
> insmod -f hello.o
> 
> it shows up in the lsmod listing, but I don't get the printk output,
> either in the log, or interactively.  Anyone know what's going on here?

Okay, to get full closure on this, now that I've got the answers, I'll
cover the where, as well as the what:

	1)  Where:  There is a web page called kernelnewbies.org (see my main
web page, second column) that tries to be a clearing house for incipient
kwhackers.  That was my best start.  Then, after figuring out a usable
client (circus worked reasonably for me once I looked hard enough) I
just got on the #kernelnewbies channel of irc.openprojects.net and asked
the question.  People are very friendly there, so I recommend that.  If
anybody find a better irc client that isn't broken in debian, please let
me know.

	2)  What:  Then, the answers to my problem, which is, as I assumed, was
a minor value to me of this exercise, but nevertheless an important
step, was as follows:

	i.	You can't do it like Rubini does it on pp 14 anymore, and "that
hasn't worked that way for years" is an accurate paraphrase of what I
was told.  Part of my problem was that somehow, possibly due to a bug,
or maybe for a security hack, version 2.2.19 as installed on my
Debian/Stable had the version.h file listing the version as 2.2.20 in
the /usr/include/linux/version.h file.  I was instructed to do:

	gcc -I/whereevertherightbasedirectoryis/include -c hello.o

The result was then that I got the output in /var/log/kern.log, and all
without specifying -f to insmod.  By then going to the
(<ctrl>-<alt>-<f1>) console and re-running my insmod hello.o after
giving the setting setterm -msg on, I was able to get the "Hello, world"
output to my shell as per the example and now I'm on my way to wherever
else that takes me.

I still haven't been told why debian has the 2.2.20 version, instead of
the 2.2.19, and I still suspect it's a security hack, so please someone
email me if that's the case and I'll shut up about it, or otherwise.  I
really really want to know.

Seeyalaternicetameecha.


-- 
http://www.eskimo.com/~xeno
xeno@eskimo.com
Physically I'm at:  5101 N. 45th St., Tacoma, WA, 98407-3717, U.S.A.



Reply to: