errors on loading the module

hi i compiled the device driver program bfin_adv7393fb.c and the .ko and .o files are generated.after that while loading the module using insmod "bfin_adv7393fb.ko" it gives the following errors::::::: insmod: error inserting "bfin_adv7393fb.ko"-1 invalid module format help me to solve this........

Reply to
ashu
Loading thread data ...

What revision is your compile kernel (the one you are using to compile the module), what revision is your runtime kernel (the one that runs on your target)? Are they different? If "yes", that can't work (most of the time).

"invalid module format" sounds like you try to load a 2.6 kernel module into a running 2.4 kernel...

Try to boot your new kernel you built to create the adv module. Then try to load the module again.

Juergen

Reply to
Juergen Beisert

thanks for ur reply sir......... our compile kernel and the runtime kernel are both the same........ i could not find why the error has occured...........guide me in this regard............

Reply to
ashu

a) Please post the output here:

1) $ cat /proc/version (run it on your target) 2) Run your cross compiler with "--version" as the only argument

b) Google for "invalid module format"

Juergen

Reply to
Juergen Beisert

hi all . i have compiled the program . .ko ,.o ,.mod.o,.mod.c files are created .my doubt is how can i know my program is loaded in kernel. can u guide me

Reply to
ashu

$ man modprobe $ man insmod $ man lsmod $ man rmmod

JB

Reply to
Juergen Beisert

To load the module from the module compile directory run: insmod .ko

To see wether it has loaded up use : lsmod | grep

That'll show you any drivers matching .

BTW dont call it a program, because that sounds like a user mode application (instead of a kernel mode driver). Call it a module, kernel module or a driver. Cheers Janaka

Reply to
Janaka

In addition to the above comments: To start off with use the "insmod" command instead of "modprobe", because the latter command may try to load any dependant modules.

Reply to
Janaka

hi ,

  1. i have tried using modprobe comment ,i am getting below error [root@localhost chumma]# modprobe bfin_adv7393fb.ko FATAL: Module bfin_adv7393fb.ko not found.

  1. i tried using insmod also i am getting below error [root@localhost chumma]# insmod bfin_adv7393fb.ko insmod: error inserting 'bfin_adv7393fb.ko': -1 Invalid module format

Reply to
ashu

a. Are you running the kernel you compile when you issue those commands ? b. Are you building these kernel drivers as "build in" or as "modules" ? c. What exactly do you mean by "my doubt is how can i know my program is loaded in kernel." ? Are you asking whether the module is linked to the kernel or are you asking whether the module has been loaded on the kernel at runtime ? d. Are you in the directory containing the .ko file ? e. Try absolute path of the .ko file

Reply to
Janaka

tanks for ur reply , i am asking is the module is linked to the kernel.if it is yes how can i know that particular madule added in the kernel.i am in correct path ,but i got some warnings in compilation.

Reply to
ashu

same........

i got the solution ,i need to connect the tarket through the serial connector.then i can see my module is added in to the kernel thank u all

Reply to
ashu

^^^^^^^^^^^^^^^^^^^^^^^

Arrgh. You tried it all the time at your host.

Juergen

Reply to
Juergen Beisert

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.