Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 was marked as an exact duplicate of an existing 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

share|improve this answer

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