Re: compiling modules after 2.4.* --> 2.6.0 upgrade

From: Randy.Dunlap
Date: Tue Dec 23 2003 - 11:45:51 EST


On Tue, 23 Dec 2003 02:20:06 -0600 (CST) Ben Srour <srour@xxxxxxxxxxx> wrote:

| Hello,
|
| I'm attempting to port a module I wrote for the 2.4 series to 2.6 but I
| get the following error when I try and insmod:
|
| root@dimension# /usr/sbin/insmod gpstest.o
| insmod: error inserting 'gpstest.o': -1 Invalid module format
| root@dimension#

In 2.6.x, modules are named *.ko, and you 'insmod|modprobe *.ko'.

To have *.ko built correctly, read and use
./Documentation/kbuild/{modules.txt,makefiles.txt}.

Here is a working trivial makefile for out-of-tree simple modules:

# makefile for oops_test/dump*.c
# Randy Dunlap, 2003-03-12
# usage:
# cd /path/to/kernel/source && make SUBDIRS=/path/to/source/oops_test/ modules

obj-m := dump_test.o

# end;


| (/sbin/insmod returns:
| insmod: QM_MODULES: Function not implemented
| but isnt that a remnant of the 2.4 series module-init-tools?)

Yes.

| /usr/sbin/insmod -v
| module-init-tools version 3.0-pre1
|
| /sbin/insmod -V
| insmod version 2.4.18
| ....
|
|
| I'm guessing this is happening because the module it seems to be compiling
| for is 2.4:
| root@dimension# strings gpstest.o
| kernel_version=2.4.9-31
| ....
| root@dimension#
|
| I'm using module-init-tools-3.0-pre1, gcc3.0.4, kernel2.6.0

Make sure that the module-init-tools binaries are in $PATH
for user=root (and before the older ones if both are there).

--
~Randy
MOTD: Always include version info.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/