Kernel modules and devices

How can I list all connected devices (USB, PCI, …) and see which kernel module is used for a specific device?

listusb shows what devices are connected to USB.
listdev shows all the found devices.
listimage | grep drivers/ shows all the loaded drivers.

1 Like

listimage | grep add-ons/kernel/ show all loaded drivers, legacy and new device_manager ones.

AFAICT, there is no easy way to see which modules are used by which module, so it’s hard currently to see which kernel module is used for a specific device.

1 Like

Thanks a lot. What do you mean by legacy and device_manager drivers? Legacy = BeOS way to write drivers? And device_manager is something new for Haiku?

Basically yes. We designed a new device driver system. The main difference is the way drivers are matched with hardware. In the BeOS model, at boot, the kernel will load each driver, and ask it, for each device in the machine: “can you handle this” ?
This process is slow, especially if there are a lot of drivers or a lot of hardware.

The new model lets the driver register for a certain range of devices (using their vendor and product ID, usually), which makes it possible for the kernel to know which driver to turn to when there is a new device plugged.

Unfortunately, a lot of our drivers are not migrated yet to the new model. So both models curently live side by side in Haiku. Of course, the way to know which hardware is handled by which driver is different in these two cases.

Interesting. Is there any documentation available how the new model should be used?