LinuxQuestions.org
Help answer threads with 0 replies.
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 04-23-2002, 10:42 PM   #1
nu2linux
LQ Newbie
 
Registered: Mar 2002
Location: Texas
Distribution: VectorLinux 2.0
Posts: 7

Rep: Reputation: 0
Unhappy Module Programming


I have written a simple char module. Sometimes it loads and sometimes not. 2 problems are present and do not always show up.

Problem 1:
My register_chrdev(MY_MAJOR, "My Mod", &fsOps), with MY_MAJOR=120, works just fine. However if I reboot and try to load the module, I can't register 120. If I change MY_MAJOR=150 and recompile, works fine. Until I reboot.

Problem 2:
MY_ADDRESS = 0x3f8
MY_RANGE = 8

create_region(MY_ADDRESS, MY_RANGE, "MY_MOD") fails although check_region succeeds.

Error Msg: Device is busy.

This is frustrating.

Rick
 
Old 04-28-2002, 06:28 PM   #2
Hano
Member
 
Registered: Sep 2001
Location: Venezuela, Caracas
Distribution: RedHat 9.0
Posts: 196

Rep: Reputation: 30
I think you HAVE to make yourself more clear


Hano
 
Old 05-06-2002, 11:18 AM   #3
herambshembekar
Member
 
Registered: Feb 2002
Location: India
Distribution: redhat 7.1
Posts: 70

Rep: Reputation: 15
try different possiblities,

1) Try with major no between 241 to 255 for testing purposes
for ore detail about device nos see,

documentation/devices.txt (orsomething similar) on source code path

2) check /proc/iomem (i exactly don't remember name as i am sitting on window machine) serch for something similar (in /proc)if not fonund to check wether the region is allocated.
 
Old 05-06-2002, 02:14 PM   #4
Socma
LQ Newbie
 
Registered: May 2002
Posts: 5

Rep: Reputation: 0
...

1)MN's in the ranges 60 to 63, 120 to 127, and 240 to 254 are reserved for local and experimental use. No real (serious) driver would be assigned such numbers).

2)Dynamic allocation:
If the major number specified, is set to 0 (register_chrdev), then the function selects a free number and returns it.
 
Old 06-01-2002, 02:01 PM   #5
kervin
Member
 
Registered: Jan 2002
Location: Melbourne, FL.
Distribution: redhat
Posts: 168

Rep: Reputation: 31
If you didn't find a suitable answer to your question, you might want to try http://kernelnewbies.org/

--Kervin
 
  


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
Programming a module.. need help tantrix Programming 3 04-14-2005 06:15 PM
module programming b123coder Programming 0 12-13-2004 03:05 AM
Kernel Module programming Config Programming 2 03-24-2004 04:48 PM
Module programming linuxanswer Programming 2 12-12-2003 02:16 PM
Kernal Module Programming herambshembekar Programming 2 02-22-2002 11:34 AM

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

All times are GMT -5. The time now is 12:44 AM.

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