Hemant Mohapatra wrote:
I am writing a simple character device driver on a 2.6.4.52 suse 9.1
kernel. It does not do much; basically just initialises the module,
runs a few checks and then exits the module. When I try to insert the
module, I get the following error:
# insmod ./chardriver.ko
#insmod: error inserting './chardriver.ko': -1 Invalid module format
Now, here is the deal:
My kernel build is for the same version that 'modinfo chardriver.ko'
gives me. Also, I copied over /boot/config-2.6.4-52-default to
/usr/src/linux-2.6.4-52-default/.config.
/lib/modules/2.6.4-52-default/build/include/linux/version.h defines
my version as
#define UTS_RELEASE "2.6.4-52-default"
which is what I get with modinfo chardriver.ko
What am I doing wrong?
Thanks,
Hemant Mohapatra
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/
I've faced the same problem .. if your module source has nothing wrong
then your buidling steps are not correct
Have you made a makefile that uses the kbuild system of the kernel?
I've read the
/src/Documentation/kbuild/modules.txt
/src/Documentation/kbuild/makefiles.txt
and everything went right after that
Hope that helps
MHD
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/