LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   As the kernel finds the correct driver on the disk? (https://www.linuxquestions.org/questions/linux-kernel-70/as-the-kernel-finds-the-correct-driver-on-the-disk-939284/)

andrmuel 04-11-2012 09:29 AM

As the kernel finds the correct driver on the disk?
 
Can someone explain to me where the table with the assignement between
the hardware and drivers to be loaded can be found in the system?

Or:

How does the kernel know which driver has to be load when it sees a peace of hardware ?

kilgoretrout 04-11-2012 10:29 AM

Which distro. The methods vary depending on the distro.

bsat 04-11-2012 11:50 PM

I think this is handled by the udev .

andrmuel 04-12-2012 12:51 AM

Quote:

Originally Posted by kilgoretrout (Post 4650254)
Which distro. The methods vary depending on the distro.

oh - really ?
I thought it was kernel task ..

Debian Squeeze

andrmuel 04-12-2012 12:54 AM

Quote:

Originally Posted by bsat (Post 4650744)
I think this is handled by the udev .

..but where exactly is the associated table: HARDWARE <---> DRIVER

bsat 04-13-2012 02:46 AM

I am not sure if it is dependent or distro or not, but here is the working of udev system

https://www.linux.com/news/hardware/...ls/180950-udev

WizadNoNext 04-15-2012 03:49 AM

It is not depend on distro. The association is make by kernel and kernel alone! It is part of /lib/modules/ and files are created using depmod, which is reading all modules and extract pci.ids and usb.ids and include it to files.
Code:

alias pci:v000010B7d0000900Asv*sd*bc*sc*i* 3c59x
alias pci:v000010B7d00009006sv*sd*bc*sc*i* 3c59x
alias pci:v000010B7d00009005sv*sd*bc*sc*i* 3c59x
alias pci:v000010B7d00009004sv*sd*bc*sc*i* 3c59x
alias pci:v000010B7d00009001sv*sd*bc*sc*i* 3c59x
alias pci:v000010B7d00009000sv*sd*bc*sc*i* 3c59x
alias pci:v000010B7d00005952sv*sd*bc*sc*i* 3c59x
alias pci:v000010B7d00005951sv*sd*bc*sc*i* 3c59x
alias pci:v000010B7d00005950sv*sd*bc*sc*i* 3c59x
alias pci:v000010B7d00005970sv*sd*bc*sc*i* 3c59x
alias pci:v000010B7d00005920sv*sd*bc*sc*i* 3c59x
alias pci:v000010B7d00005900sv*sd*bc*sc*i* 3c59x
alias pci:v000010B7d0000990Asv*sd*bc*sc*i* typhoon
alias pci:v000010B7d00009909sv*sd*bc*sc*i* typhoon
alias pci:v000010B7d00009908sv*sd*bc*sc*i* typhoon
alias pci:v000010B7d00009905sv*sd00002102bc*sc*i* typhoon
alias pci:v000010B7d00009905sv*sd00002101bc*sc*i* typhoon
alias pci:v000010B7d00009905sv*sd00001102bc*sc*i* typhoon
alias pci:v000010B7d00009905sv*sd00001101bc*sc*i* typhoon
alias pci:v000010B7d00009904sv*sd00002000bc*sc*i* typhoon
alias pci:v000010B7d00009904sv*sd00001102bc*sc*i* typhoon
alias pci:v000010B7d00009904sv*sd00001000bc*sc*i* typhoon
alias pci:v000010B7d00009903sv*sd*bc*sc*i* typhoon
alias pci:v000010B7d00009902sv*sd*bc*sc*i* typhoon
alias pci:v000010B7d00009900sv*sd*bc*sc*i* typhoon
alias pci:v00001022d00007462sv*sd*bc*sc*i* amd8111e
alias pci:v00001023d00002000sv*sd*bc02sc00i* pcnet32
alias pci:v00001022d00002000sv*sd*bc*sc*i* pcnet32
alias pci:v00001022d00002001sv*sd*bc*sc*i* pcnet32
alias pci:v00001969d00001048sv*sd*bc*sc*i* atl1
alias pci:v00001969d00002048sv*sd*bc*sc*i* atl2
alias pci:v00001969d00001066sv*sd*bc*sc*i* atl1e
alias pci:v00001969d00001026sv*sd*bc*sc*i* atl1e
alias pci:v00001969d00001083sv*sd*bc*sc*i* atl1c
alias pci:v00001969d00001073sv*sd*bc*sc*i* atl1c
alias pci:v00001969d00002062sv*sd*bc*sc*i* atl1c
alias pci:v00001969d00002060sv*sd*bc*sc*i* atl1c
alias pci:v00001969d00001062sv*sd*bc*sc*i* atl1c
alias pci:v00001969d00001063sv*sd*bc*sc*i* atl1c
alias ssb:v4243id0806rev* b44
alias pci:v000014E4d0000170Csv*sd*bc*sc*i* b44
alias pci:v000014E4d00004402sv*sd*bc*sc*i* b44
alias pci:v000014E4d00004401sv*sd*bc*sc*i* b44
alias pci:v000014E4d0000163Csv*sd*bc*sc*i* bnx2
alias pci:v000014E4d0000163Bsv*sd*bc*sc*i* bnx2
alias pci:v000014E4d0000163Asv*sd*bc*sc*i* bnx2
alias pci:v000014E4d00001639sv*sd*bc*sc*i* bnx2
alias pci:v000014E4d000016ACsv*sd*bc*sc*i* bnx2
alias pci:v000014E4d000016AAsv*sd*bc*sc*i* bnx2
alias pci:v000014E4d000016AAsv0000103Csd00003102bc*sc*i* bnx2
alias pci:v000014E4d0000164Csv*sd*bc*sc*i* bnx2
alias pci:v000014E4d0000164Asv*sd*bc*sc*i* bnx2
alias pci:v000014E4d0000164Asv0000103Csd00003106bc*sc*i* bnx2

you would find it in modules.alias

Again it is not distro depend! It is plainly kernel thing and for instance you have id in pci.ids, but as long as kernel do not include device in driver, you wont be able to use device!

andrmuel 04-17-2012 05:47 AM

Thanks a lot!!!
That was the answer I searched for!!

.. and now I search for the method how the kernel creates
such ID's:
pci:v000014E4d0000164Asv*sd*bc*sc*i*

But I think the kernel will create an ID without '*' and the
'*' are wildcards ..

Can I create such an ID by hand with a tool ??


Quote:

Originally Posted by WizadNoNext (Post 4653097)
It is not depend on distro. The association is make by kernel and kernel alone! It is part of /lib/modules/ and files are created using depmod, which is reading all modules and extract pci.ids and usb.ids and include it to files.
Code:


alias pci:v000014E4d0000164Asv*sd*bc*sc*i* bnx2
alias pci:v000014E4d0000164Asv0000103Csd00003106bc*sc*i* bnx2

you would find it in modules.alias

Again it is not distro depend! It is plainly kernel thing and for instance you have id in pci.ids, but as long as kernel do not include device in driver, you wont be able to use device!


sundialsvcs 04-17-2012 08:42 AM

udev is the mechanism by which device entries are located and the proper drivers are selected for them. The same mechanism also comes into play (IIRC...) when a USB device is inserted.

A device driver is always "part of the kernel" and it may therefore either be resident, or a loadable module.

Personally, I like to use a bootable-CD distro to determine what drivers are suitable for my system, then specify those specific drivers in a custom-built kernel. Drivers needed for non-removable hardware are compiled in. Drivers needed for removable hardware that I know I need, are modules. In this way I am able to eliminate the "initial RAM disk" step at boot-time altogether. If I don't have, say, a "DECsystem token-ring adapter card," :rolleyes: I don't need to build a driver for it and I don't need to search for it at startup time.

WizadNoNext 04-18-2012 02:23 AM

You are free to do so, but I am afraid it won't work, as module won't have this id.

sundialsvcs: I recommend to you to build kernel with modules for most hardware even this integrated in motherboard. It comes handy when you want to reset hardware - simply unload module.


All times are GMT -5. The time now is 08:41 PM.