LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 08-19-2008, 03:19 AM   #1
unikgila
LQ Newbie
 
Registered: Jul 2008
Posts: 27

Rep: Reputation: 15
how to know misc_register() have run


Hi all,

I read a tutorial about device driver, especially for Miscellaneous Character Drivers which is employed two functions (misc_register and misc_unregister).

I put here some source code
Code:
static int	__init backlight_init(void)
{
	misc_register( &backlight_dev );

	printk(" backlight device driver register \n");

	return 0;
}
I can compiled and insert that module to kernel. However, according the tutorial in http://www.linuxjournal.com/article/2920.

After successful registration, the new misc device will appear in /proc/misc. But i try to reach the directory by using (ls -l /proc/misc) there isn't a new misc device.

Please help me
 
Old 08-19-2008, 04:35 AM   #2
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,414
Blog Entries: 33

Rep: Reputation: 222Reputation: 222Reputation: 222
Hi, Try

ls -l /proc/misc/
 
Old 08-19-2008, 06:31 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678
Did you read "listing 1" in the article?
 
Old 08-19-2008, 07:32 AM   #4
comeonbaby00
LQ Newbie
 
Registered: Aug 2008
Posts: 1

Rep: Reputation: 0
hi

all the best !
 
Old 08-19-2008, 07:47 PM   #5
unikgila
LQ Newbie
 
Registered: Jul 2008
Posts: 27

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by GlennsPref View Post
Hi, Try

ls -l /proc/misc/
Yes i have tried ls -l /proc/misc
but it look like the misc is not directory, so i cannot find the backlight as name of driver. Actually this is my question core.
 
Old 08-19-2008, 07:56 PM   #6
unikgila
LQ Newbie
 
Registered: Jul 2008
Posts: 27

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jschiwal View Post
Did you read "listing 1" in the article?
I didn't make the "listing 1", instead of I follow this:

Code:
#insmod backlight.o
#mknod /dev/backlight c 10 63  {i found minor number from my coding}
#chomod a+rw /dev/backlight
But i still cannot look if there is new file in /proc/misc

PS. basic question, you mention about script in "listing 1", how to make and run this script?
 
Old 08-20-2008, 04:55 AM   #7
unikgila
LQ Newbie
 
Registered: Jul 2008
Posts: 27

Original Poster
Rep: Reputation: 15
Oke, for this question, i got the answer, i found my driver when i use this command:

Code:
[root@tb-xt lcd]$cat /proc/misc
 63 backlight
 69 tynuxpm
 15 touchscreen/wm9705
135 rtc
[root@tb-xt lcd]$
But I still need more explanation for connecting between user space to kernel space. I will post a new thread for this
 
  


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
I run Fedora 9 and I boot from USB, how I run at startup Firewall and antivirus? gginis Linux - Software 3 06-08-2008 04:19 AM
computer asks me to run a FSCK Manually, but won't : says can't run on mounted lightwave Linux - Newbie 12 04-02-2008 01:25 AM
Is a script, run at boot time from init.d, run with root authority? tmbrwolf53 Linux - Server 2 03-31-2007 09:15 PM
A lot of processes run automatically when I run a single process. dalvirgautam Linux - Enterprise 4 12-01-2006 07:10 PM
Cannot get NVIDIA-Linux-x86_64-1.0-6629-pkg2.run to run properly doctorwebbox Linux - Hardware 0 02-06-2005 07:18 AM

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

All times are GMT -5. The time now is 01:22 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration