Re: Sharing of major number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

< mandeep_sandhu@xxxxxxxxxxx> wrote:
> just to add to this...a MAJOR number is used by the kernel to
> figure out which driver to call and the MINOR number is simply passed
> on to the device driver for its use. The driver uses this minor num.
> to distinguish btw. the various devices it controls.
> 
> Major num serves as an index into an array which holds the various
> drivers registered with the kernel.

    I dont know how to communicate my concern. I can't digest how come
MAJOR NUMBER identifies the driver rather than the device type as I
see different drivers for different devices of the same type but the
device file is ALWAYS the same. E.g (i dont know if this is a good
example or not) when i say /dev/video0 the kernel knows i am talking
about the tv capture card and when i say /dev/video1 the kernel knows
that i am talking of my webcam. Now the major number of both are the
same but the device driver is definatelly not the same. How do you
explain that?

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux