Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

First of all sorry for this basic question but I am really confused here.....

So my question is :

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 ?

I am sticked here please help me.....

share|improve this question

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.

1 Answer 1

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

share|improve this answer

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