Subject: module problems

From: Daven Baptist <[email-masked]>
Date: Mon, 05 Jun 2000 14:22:15 +0200

can someone help me, i wrote/copied a extreem
simpel module 

	#define MODULE
	#include <linux/module.h>

	int init_module()
	{
	printk("hello,world -this is the kernel speaking\n");
	return 0;
	}

	void cleanup_module()
	{
	printk("Short is the life of a kernel module\n");
	}

i compiled it and put it on a ramdisk
but as soon as i load it it tells me i'm not using 
the richt kernel ??

[root@Linux /]$insmod hello.o
	hello.o: kernel-module version mismatch
        hello.o was compiled for kernel version 2.2.13-rmk2-np14
        while this kernel is version 2.3.99-pre8-rmk1-np5.

[root@Linux /]$insmod hello.o -f
	Warning:hello,world -this is the kernel speaking
	kernel-module version mismatch
        hello.o was compiled for kernel version 2.2.13-rmk2-np14
        while this kernel is version
2.3.99-pre8-rmk1-np5                       

[root@Linux /]$rmmod hello
	Short is the life of a kernel module  

but as far as i know i'm using 2.3.99~~~~
how can i solve this 'problem' ??

Daven

unsubscribe: body of `unsubscribe linux-arm-kernel' to [email-masked]

---

From: [email-masked] (Erik Mouw)
Date: Mon, 5 Jun 2000 21:28:16 +0200 (CEST)

> can someone help me, i wrote/copied a extreem

[snip]

>         hello.o was compiled for kernel version 2.2.13-rmk2-np14

[...]

> how can i solve this 'problem' ??

My guess is that you're using my cross compiler toolchain, which is actually
compiled with linux-2.2.13-rmk2-np14. What's happening is that your kernel
is indeed linux-2.3.99-something, but that you're compiling against the
linux-2.2.13 headers. You can solve the problem in two ways:

- Remove the original kernel headers and make a softlink to the current
  kernel headers:
    cd /data/lart/cross/arm-linux/include
    mv asm asm-orig
    mv linux linux-orig
    ln -s /path/to/recent/kernel/linux/include/linux linux
    ln -s /path/to/recent/kernel/linux/include/asm asm
- Compile with different compiler flags:
    arm-linux-gcc -Wall -O2 -D__KERNEL__ -DMODULE -nostdinc \
      -I/path/to/recent/kernel/linux -c hello.c -o hello.o

Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031,  2600 GA Delft, The Netherlands
Phone: +31-15-2783635  Fax: +31-15-2781843  Email: [email-masked]
WWW: http://www-ict.its.tudelft.nl/~erik/