* Doubt in major and minor numbers
@ 2014-11-16 11:09 me storage
2014-11-16 11:20 ` Robert P. J. Day
0 siblings, 1 reply; 2+ messages in thread
From: me storage @ 2014-11-16 11:09 UTC (permalink / raw)
To: kernelnewbies
Hi All,
I am reading chapter 3 in LDD3 i checked same topics in LDD2 so i got some
confusions.According to my understanding
Major number is used by kernel to identify the driver i.e major number
tells about driver .
Minor number is used by the driver module to know about the device which is
using this module i.e minor number related to device number
can i any one please tell am i correct?
if wrong please explain me a bit more
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20141116/a6211c18/attachment.html
^ permalink raw reply [flat|nested] 2+ messages in thread
* Doubt in major and minor numbers
2014-11-16 11:09 Doubt in major and minor numbers me storage
@ 2014-11-16 11:20 ` Robert P. J. Day
0 siblings, 0 replies; 2+ messages in thread
From: Robert P. J. Day @ 2014-11-16 11:20 UTC (permalink / raw)
To: kernelnewbies
On Sun, 16 Nov 2014, me storage wrote:
> Hi All,
>
> I am reading chapter 3 in LDD3 i checked same topics in LDD2 so i
> got some confusions.According to my understanding Major number is
> used by kernel to identify the driver i.e major number tells about
> driver . Minor number is used by the driver module to know about the
> device which is using this module i.e minor number related to device
> number can i any one please tell am i correct? if wrong please
> explain me a bit more
for the most part, that is entirely correct -- the major number
identifies the driver (either block or char), and you can see the
current list of registered drivers with:
$ cat /proc/devices
Character devices:
1 mem
4 /dev/vc/0
4 tty
4 ttyS
5 /dev/tty
5 /dev/console
5 /dev/ptmx
7 vcs
10 misc
13 input
...
Character devices:
1 mem
4 /dev/vc/0
4 tty
4 ttyS
5 /dev/tty
5 /dev/console
5 /dev/ptmx
7 vcs
10 misc
13 input
...
and while the minor number *usually* then identifies a particular
instance of a device being controlled by that driver, it doesn't
*have* to. in fact, the driver is free to interpret the minor number
any way it wants but, as you suggest, it typically just refers to a
specific instance of a device.
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-16 11:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-16 11:09 Doubt in major and minor numbers me storage
2014-11-16 11:20 ` Robert P. J. Day
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).