Skip to contentSkip to conversation

System.map

DISCUSSION Philip 2 participants 2 messages Oct 14, 2007

lore
Share & tools
lore

Philip

author
#0 lore raw

Hello

I want to write a script, which shows the name of the relevant kernel module for each listed pci device shown by 'lspci -m'. It's easy to find out the name of the corresponding module, if the driver has been compiled as a loadable kernel module: The file /lib/modules/$(uname -r)/modules.pcimap lists module names based on pci device's vendor -and device id (shown by 'lspci -n'). But how can I find out the name of the corresponding kernel module if the module has been compiled directly into the kernel ? I thought that I can find them in the kernel's machting System.map based on vendor -and device id as well. But I can't find those id's there. Where do I have to look for it ? I want to be informed by my script, if the driver (module) for a specific pci device is available as a loadable module, in-kernel module or not available at all.

Many thanks in advance for your answers and I hope, my question is not too annoying for you developer guys :-)

Cheers,
Phibo

#1 lore raw
Quoted 9 lines · Philip

I want to write a script, which shows the name of the relevant kernel module for each listed pci device shown by 'lspci -m'. It's easy to find out the name of the corresponding module, if the driver has been compiled as a loadable kernel module: The file /lib/modules/$(uname -r)/modules.pcimap lists module names based on pci device's vendor -and device id (shown by 'lspci -n'). But how can I find out the name of the corresponding kernel module if the module has been compiled directly into the kernel ?

Well if it is compiled in, it is not a module, so you cannot find it the usual way.

Quoted 6 lines

I thought that I
can find them in the kernel's machting System.map based on vendor -and device id as well. But I can't find those id's there. Where do I have to look for it ? I want to be informed by my script, if the driver (module) for a specific pci device is available as a loadable module, in-kernel module or not available at all.

That does not work reliably either. There might be PCI devices which have the same PID:VID, but need a readb() or so for further finding out whether the actual piece of hardware has a driver.

And then there is that sort of modules which do not have typical IDs (i.e. udev cannot/won't autoload them) at all, like pcspkr.ko/psmouse.ko