(kernel 2.6.9) insmod: -1 Invalid module format

From: Stephane Coulombe Bisson (stephcoul_at_aei.ca)
Date: 12/03/04

  • Next message: Randy.Dunlap: "Re: (kernel 2.6.9) insmod: -1 Invalid module format"
    To: linux-kernel@vger.kernel.org
    Date:	Fri, 03 Dec 2004 00:17:43 -0500
    
    

    Hi,

    I'm new to Linux module dev, I copied a very simple module from a book
    (http://lwn.net/Kernel/LDD2/ch02.lwn) and I can't insert it into the
    kernel.

    I found hundreds of bug reports about it on google without any solution.
    I must be doing something wrong...

    /*----------mymodule.c-----------*/
    #define MODULE
    #include <linux/module.h>
    int init_module(void)
    { printk("<1>Hello, world\n"); return 0; }
    void cleanup_module(void)
    { printk("<1>Goodbye cruel world\n"); }
    /*----------EOF-----------*/

    # gcc -c mymodule.c
    # insmod mymodule.o
    insmod: error inserting 'mymodule.o': -1 Invalid module format

    Thanks a lot

    steph

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Randy.Dunlap: "Re: (kernel 2.6.9) insmod: -1 Invalid module format"

    Relevant Pages

    • Fwd: Help needed: GCOV - not getting HOW TO!!!
      ... I have patched my kernel and i have configured the gcov kernel module support. ... I compilied my module and i run insmod and i got my module executed. ... void cleanup_module { ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: modules in 2.6.0-test11
      ... a> The kernel works fine, all modules too but i have to insert them ... a> with insmod or modprobe, i cannot make that modules became loaded ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Help needed: GCOV - not getting HOW TO!!!
      ... I have patched my kernel and i have configured the gcov kernel module support. ... I compilied my module and i run insmod and i got my module executed. ... void cleanup_module { ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Fw: signed kernel modules?
      ... On Thu, 14 Oct 2004, David Howells wrote: ... What can the kernel that insmod can't do? ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: (kernel 2.6.9) insmod: -1 Invalid module format
      ... > I'm new to Linux module dev, I copied a very simple module from a book ... > kernel. ... for Linux 2.6.x. ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)