LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-16-2010, 12:35 AM   #1
rachilmeth
LQ Newbie
 
Registered: Jan 2010
Posts: 19

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


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____________________ ___________________
 
Old 01-16-2010, 01:09 AM   #2
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
What was the point in creating a new thread with the same problem in your previous thread ??
http://www.linuxquestions.org/questi...rogram-782301/

Any way, now on Fedora 12, I hope you didn't compile the kernel yet again !!

Again did u try removing the following files and re-make and re-install the module ?

rm Module.symvers modules.order kernel.o kernel.mod.o kernel.mod.c kernel.ko

Is it still resulting in the same problem after this step ?

Last edited by Aquarius_Girl; 01-16-2010 at 01:53 AM.
 
Old 01-16-2010, 01:53 AM   #3
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
I did forget the following file, remove this also, and re-make and re-install the module ?

rm Module.markers
 
Old 01-16-2010, 08:10 AM   #4
sovereign_aua
LQ Newbie
 
Registered: Jul 2009
Distribution: Suse 11.0
Posts: 7

Rep: Reputation: 0
In my opinion you have to add:
module_init(init_module);
module_exit(remove_module);

Better way to load a module is modprobe.
 
Old 01-16-2010, 11:49 PM   #5
rachilmeth
LQ Newbie
 
Registered: Jan 2010
Posts: 19

Original Poster
Rep: Reputation: 0
problem with the name of the file . so i renamed it and compile it
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] insmod: error inserting 'vntwusb.ko' : -1 Invalid module format NightHorse Slackware 4 06-23-2009 11:33 AM
insmod: error inserting 'm2.ko': -1 Invalid parameters nikhil86 Programming 1 04-02-2008 08:26 PM
insmod: error inserting 'usbip.ko': -1 Invalid module format barunparichha Linux - Software 1 01-13-2007 08:51 PM
insmod: error inserting 'new.ko': -1 Invalid module format hemk76 Programming 2 01-26-2005 10:52 AM
insmod: error inserting 'new.ko': -1 Invalid module format hemk76 Programming 2 01-24-2005 10:42 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration