hello world kernel module problem

hello,
I was trying to add a simple module to the kernel
however when i Run make I get the following error.

////
make -C /lib/modules/2.6.25.5ballu-1.1/build M=/home/ballu modules
make[1]: Entering directory /usr/src/linux-2.6.25.5-1.1' make[1]: *** No rule to make target modules’. Stop.
make[1]: Leaving directory `/usr/src/linux-2.6.25.5-1.1’
make: *** [all] Error 2

////

I ahve been following this tutorial…
Compiling Kernel Modules

I any one could please tell me what is wrong??

Hi
I normally use the following on a default kernel;


make clean
make oldconfig
make prepare
make scripts
cp /usr/src/linux-obj/i386/default/Module.symvers /usr/src/linux/
cd <module_to_compile_directory>i
make -C /usr/src/linux SUBDIRS=$PWD modules


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.1 x86 Kernel 2.6.27.7-4-default
up 21:39, 3 users, load average: 0.25, 0.09, 0.09
GPU GeForce 6600 TE/6200 TE - Driver Version: 177.82

thanks a lot for the help
i am able to build the modules however I am not able to insert the module in the kernel using the insmod command
I get the following error

insmod: error inserting ‘hello-1.ko’: -1 Invalid module format

when I ran the modinfo on my modules object file I got this

filename: hello-1.ko
depends:
vermagic: 2.6.25.18-0.2 SMP mod_unload PENTIUMIII

and the kernel version that I was working was

2.6.25.5-1.1-pae

Couls u please point out what is the problem

also if u could please tell me which files are required under which directories for successful compilation and building of the modules…

Thanx again for the help

prani wrote:
> thanks a lot for the help
> i am able to build the modules however I am not able to insert the
> module in the kernel using the insmod command
> I get the following error
>
> insmod: error inserting ‘hello-1.ko’: -1 Invalid module format
>
> when I ran the modinfo on my modules object file I got this
>
> filename: hello-1.ko
> depends:
> vermagic: 2.6.25.18-0.2 SMP mod_unload PENTIUMIII
>
> and the kernel version that I was working was
>
> 2.6.25.5-1.1-pae
>
>
> Couls u please point out what is the problem
>
> also if u could please tell me which files are required under which
> directories for successful compilation and building of the modules…

You need kernel headers that match your running kernel. Is 2.6.25.18 installed
on your system? If so, why are you running 2.6.25.5?

Larry

Thank u all for the help
I got it write
The problem was in the difference in version used to compile the modules…