Question: I am new in kernel programming.

For implementing my project work, I have downloaded the latest stable **kernel (v4.3)** from [kernel.org](https://www.kernel.org/).

Just for checking I have copied a few files from the kernel directories into my project directory. Made changes to it and inserted a few more code to it.

Then I compiled on **SLES11 Linux kernel** using

```
make -C /lib/modules/$(uname -r)/build M=$PWD modules

```

I have used the below makefile

```
obj-m := my_module.o
my_module-objs := module_main.0 other_module1.o other_module2.o other_module3.o

```

It compiled successfully.
But when I tried to insert into the kernel using 

```
insmod my_sample.ko

```

It showed the following

> 
> disagrees about version of symbol symbol\_name
> 
> 
> 

[![enter image description here](https://i.stack.imgur.com/pcP0K.jpg)](https://i.stack.imgur.com/pcP0K.jpg)

Answer: 
The problem here is that your Kernel module is using the exported symbols of other kernel modules which in this case appears to be the linux InfiniBand RDMA stack's exported methods or symbols.

To solve the symbol version problems, copy the **`Module.symvers`** file from the 

```
/usr/src/ofa-kernel

```

directory and paste it to your current working directory. Then you make your modules again. Now the `insmod` should work perfectly fine.

> 
> NOTE: The Module.symvers file contains information of all the kernel
>  module exported symbol. So by copying it to your working directory,
>  you are helping kbuild to know more about the used exported symbols.
> 
> 
> 

And if you don't find Module.symvers or it is empty, then create one using `create_Module.symvers.sh`
make -C /lib/modules/$(uname -r)/build M=$PWD modules,
"$(uname -r)" shows that you are compiling against the kernel version you are running now so you should be able to insmod the module in the current kernel if you haven't changed the headers.

From your text,
"Just for checking I have copied a few files from the kernel directories into my project directory. Made changes to it and inserted a few more code to it."

If you have made modifications to the kernel source then you may need to recompile the new kernel and boot with the new updated kernel. Then you should be able to compile your kernel module with the modified headers.