LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-11-2006, 05:55 PM   #1
allomeen
Member
 
Registered: Dec 2005
Posts: 83

Rep: Reputation: 15
LKM register_chrdev_region(..) problem


I just installed Fedora Core 5, and I updated the kernel to 2.6.16-1.2080_FC5 to get the latest kernel build files, and the system reboots fine. Then I wrote a real simple "Hello World" Linkable Kernel Module. It compiles fine but when it is inserted, I get an error saying that "insmod: error inserting 'HelloWorld.ko': -1 Device or resource busy" even though I use an unused static major or a dynamically created one. The error is generated by the register_chardev_region(dev, 1, "Hello"). See code below. The /var/log/messages indicates that the driver load failed with -16.
Can u help me in this?

int init_module(void)
{
int result = 0;

printk(KERN_ERR "Hello Loading...\n");

// Register device with static MAJOR number
result = register_chrdev_region(MKDEV(100, 0), 1, "Hello");
if(result < 0)
{
printk(KERN_ERR "Hello Driver Load Failed! (%d) \n", result);
return result;
}
printk(KERN_ERR "Hello, World\n");

return 0;
}
Reply With Quote
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
LKM rootkit help GodSendDeath Programming 1 05-01-2004 12:49 PM
LKM trojan? help! synaptical Linux - Security 3 03-07-2004 08:16 AM
lkm trojan nullpt Linux - Security 3 12-26-2003 07:42 PM
lkm trojan nullpt *BSD 3 12-25-2003 01:09 AM
chkrootkit and lkm Crashed_Again Linux - Security 3 06-08-2003 09:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:18 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