Major and minor numbers

Nav Kamal navkamal90 at gmail.com
Wed Nov 27 23:10:49 EST 2013


On Nov 27, 2013 3:49 PM, "Sudip Mukherjee" <sudipm.mukherjee at gmail.com>
wrote:
>
>
>
>
> On Tue, Nov 26, 2013 at 4:36 PM, Nav Kamal <navkamal90 at gmail.com> wrote:
>>
>> Am a little stuck at major and minor numbers used to reference the
connection between device file and device driver. Can please somebody
theoretically explain how they work ?
>
> In my opinion major and minor number are like device identifier. The
combination of major and minor number (dev_t) is the deviceid. The major
number is like an id of your driver. And all the devices that are using
this driver will be having their own minor numbers. No two devices can have
the same minor number if they are being controlled by the same driver. So
when you create a device node , you specify the major and minor number with
mknod command , and that means that particular node is associated with the
driver (recognized by major number) and a particular device (recognized by
the minor number).
> Did i explain correctly or is my understanding wrong ???
>
> Regards
> Sudip
>
Thanks , yes its correct . Finally understood the concept.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20131128/e2c8ce3d/attachment.html 


More information about the Kernelnewbies mailing list