Find the answer to your Linux question:
Results 1 to 4 of 4
I am getting this error when i am try to insert kernel.ko into kernel My system fedora 12 with gcc 4.4.2 insmod kernel.ko insmod: error inserting 'kernel.ko': -1 Invalid parameters ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2010
    Posts
    3

    insmod: error inserting 'kernel.ko': -1 Invalid parameters


    I am getting this error when i am try to insert kernel.ko into kernel

    My system
    fedora 12 with gcc 4.4.2

    insmod kernel.ko
    insmod: error inserting 'kernel.ko': -1 Invalid parameters

    my program
    __________________kernel.c________________________ ___________

    #include <linux/module.h> /* Needed by all modules */
    #include <linux/kernel.h> /* Needed for KERN_INFO */

    int init_module(void)
    {
    printk("Hello world 1.\n");
    return 0;
    }

    void cleanup_module(void)
    {
    printk("Goodbye world 1.\n");
    }
    _________________________END______________________ _____________


    --------------------------------------Makefile--------------------------------------------------------------
    obj-m += kernel.o

    all:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

    clean:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

    ---------------------------------------------END------------------------------------------------------------------
    -----------------------------------------FILE GENERATED---------------------------------------------------
    -rw-r--r--. 1 root root kernel.c
    -rw-r--r--. 1 root root Makefile
    -rw-r--r--. 1 root root kernel.o
    -rw-r--r--. 1 root root modules.order
    -rw-r--r--. 1 root root Module.symvers
    -rw-r--r--. 1 root root kernel.mod.c
    -rw-r--r--. 1 root root Module.markers
    -rw-rw-r--. 1 root root kernel.mod.o
    -rw-r--r--. 1 root root kernel.ko

    ___________________________END____________________ ___________________

  2. #2
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    Can't see anything wrong with your module...Why would you name it kernel.c, its seems to me that's asking for trouble..
    Make mine Arch Linux

  3. #3
    Linux User
    Join Date
    Jan 2006
    Posts
    414
    Yeah, try renaming your module and file to anything but kernel, it should then work... also
    Code:
    printk("Hello world 1.\n");
    should really be
    Code:
    printk(KERN_INFO "Hello world 1.\n");
    but wouldn't be the cause of your problem here.

  4. #4
    Just Joined!
    Join Date
    Feb 2010
    Posts
    2

    hi

    hi,

    I think u should be in super user mode to insert module.Please check that ....

    thanks

Posting Permissions

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