Re: error in loading the module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> hi,
> I have just started to learn Kernel Module Programming from Linux kernel
> Module Programming Guide.But I am facing a problem in loading the module
> in the kernel.
>
> The source file is hello.c
> The kernel version against which it is compiled is : 2.6.4
> The kernel against which it is loaded is : 2.6.4
> The command and command line options used for compiling are as follows:
>
> gcc -o2 -c hello.c -Wall -DMODULE -D__KERNEL__
> -isystem/lib/modules/`uname -r`/build/include
>
> But when i try to load the module in the kernel it gives the following
> error :
>
> No module found in object
> insmod : error inserting 'hello.o ' : -1 invalid module format
>
> Am I missing something ?

Perhap, I make a mistake, but in 2.6.x kernel version, module and object
are .ko.
Or it seems you try to insmod with :
$ insmod hello.o
no?

If you would like to begin in this beautiful land, you should begin by
2.4.x  , because there is more HOWTO,... to read :-)
 * http://www.xml.com/ldd/chapter/book/

Regards
-- 
Amicalement

Christophe

* GNU/Linux & UNIX developer and network administrator
* Membre RotomaLUG (http://www.rotomalug.org)
* Registered User #271267
* Email: c.lucas@ifrance.com
* Web Site: http://odie.mcom.fr/~clucas/

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux