Find the answer to your Linux question:
Results 1 to 7 of 7
when I use insmod to insert a very simple module ( which used in kernel 2.4.* normally) into kernel 2.6.5, system indicate the error! I've searched by google for two ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2005
    Posts
    5

    Invaild module format ---insmod in fedora core 2


    when I use insmod to insert a very simple module ( which used in kernel

    2.4.* normally) into kernel 2.6.5, system indicate the error!

    I've searched by google for two days , but have no idea

    anybody has any idea , or please give an example, thankyou!

  2. #2
    Linux Enthusiast puntmuts's Avatar
    Join Date
    Dec 2004
    Location
    Republic Banana
    Posts
    562
    Did FC2 include a version of the modinit tools ? They are needed for a 2.6 kernel.
    I\'m so tired .....
    #200472

  3. #3
    Just Joined!
    Join Date
    Jan 2005
    Posts
    5
    so i have!! module-init-tools-3.0 !!

  4. #4
    Linux User
    Join Date
    Oct 2004
    Location
    /dev/random
    Posts
    404
    You can't insert a module compiled for kernel 2.4.x into kernel 2.6.x - if that's what you're trying to do. You have to recompile the module for kernel 2.6.x .
    The Unforgiven
    Registered Linux User #358564

  5. #5
    Just Joined!
    Join Date
    Jan 2005
    Posts
    5
    yes, just I have did something to recompile ,

    but have lots of problem ,

    could any freinds tell me how to insmod ? (

    my system is FC2, kernel-2.6.9 thankyou !

  6. #6
    Linux Enthusiast puntmuts's Avatar
    Join Date
    Dec 2004
    Location
    Republic Banana
    Posts
    562
    Some more, detailed information would be nice, this sounds like 'HELP, my system is not working' , we need more information.
    So provide the details about what you were doing and what the errors were.
    I\'m so tired .....
    #200472

  7. #7
    Just Joined!
    Join Date
    Jan 2005
    Posts
    5
    thanks !
    details:
    I want to insert the famous examplle of module in kernel-2.6.9, error:
    /************* error below*********************************/
    /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../crt1.o(.text+0x1: In function `_start':
    : undefined reference to `main'
    hello.o(.text+0xf): In function `hello_init':
    : undefined reference to `printk'
    hello.o(.text+0x2c): In function `hello_exit':
    : undefined reference to `printk'
    collect2: ld returned 1 exit status
    make: *** [hello] Error 1
    /************error above **********************************/
    /************** helllo. c source code********************/
    #include <linux/init.h>
    #include <linux/module.h>
    #include <linux/kernel.h>

    static int hello_init(void){
    printk("Hello, world\n");
    return 0;
    }

    static void hello_exit(void){
    printk("Goodbye, cruel work\n");
    }

    module_init(hello_init);
    module_exit(hello_exit);
    /* end of hello.c */


    #my make file is:
    ifneq ($(KERNELRELEASE),)
    obj-m += hello.o

    else
    KDIR += /lib/modules/$(shell uname -r)/build/
    PWD += $(shell pwd)

    default:
    $(MAKE) -C $(KDIR)SUBDIRS=$(PWD)modules
    endif

    /****************need your help!*********************/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •