When any device is attached how kernel will know which driver need to be loaded ?

I think its based on major-minor numbers but I did not get how major number is detected when device is attached ... Does major number is assigned by manufacturers or what ?

marked as duplicate by Gilles, slm, Anthon, rahmu, jasonwryan Oct 5 '13 at 18:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Linux device model takes care of that..it starts when you register your device and associate a name for it.

The moment you register your driver which has the same name as that of device, the binding is done between the device and the driver

Consider example of any platform device and platform driver. Both are binded when they have same name.

As far as major and minor number is concerned, they come into picture in case of char device drivers and are used in binding between user-space application and the (char) driver

Not the answer you're looking for? Browse other questions tagged or ask your own question.