Re: Sharing of major number

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

 



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.

HTH,
-mandeep

On Wed, 2004-09-29 at 18:52, matrix reloaded wrote:
>   see, major no basically says that the device is of a particular type [eg. Printer in 
> this case], but the minor no is the one who specifies a particular functionality of the 
> driver. For eg in case of Printer only Major = 6, but minor can be 0,1,2,3... which 
> basically decides a particular type of printer. 
>  
> Thanks. 
> Sumit Sharma, 
> IBM, Bangalore. 
>  
> 
> On Wed, 29 Sep 2004 Zeeshan Ali wrote : 
> >Hello, 
> >   I think I must clarify with examples. Lets say i develope a driver 
> >for a particular printer device (call it X) and there is already a 
> >driver for another printer that i have (call it Y). Now there are two 
> >instances of two different printers connected to my PC: X and Y. As 
> >these are different printers, they have different I/O interface and 
> >therefore they need different drivers. But for user, they should be 
> >accessible using the same device major number but different minor 
> >numbers. So would'nt these two SEPERATE INDEPENDENT drivers share the 
> >same major number? NOTE: i've taken the example of printer for the 
> >sake of explanation. 
> > 
> >-- 
> >Kernelnewbies: Help each other learn about the Linux kernel. 
> >Archive:       http://mail.nl.linux.org/kernelnewbies/
> >FAQ:           http://kernelnewbies.org/faq/
> > 

--
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