2 days back, this was in the updates…
I thought, after this, driver names should be shown
Under the “Devices”, for my network card, driver is listed as 'unknown"
Is my understanding of this get_driver_for_device wrong?
When can I know what driver is being used for my network cards?
In that commit, you added attributes specifying the path to the device in devfs, along with the name of the module used by the device. You didn’t add the path to the module image which is the driver file that contains one or more modules. You aren’t the first one to be confused by the difference between a module name, a module image, and a device path.
So, here’s an explanation just to clarify for everybody else too:
Image file: A generic executable file, shared library file, or an add-on
Module image file: A shared library/add-on that exports multiple loadable Modules. (You can think of this as the actual driver file.)
Module: Usually a module image will export two modules. (However, there is no limit to how many modules can be exported by a module image.) One module exports a more generic interface to a compatible device through devfs. The other module is meant to handle specialized communication with the device that is then used by the first module, or other modules for reuse.
So to clarify, in Haiku, what one may call a “driver file”, is actually a “module image file”.
This mean that drivers/disk/scsi/scsi_disk/driver_v1 (interface driver_module_info) is used as node driver and drivers/disk/scsi/scsi_disk/device_v1 (interface device_module_info) is used as /dev/disk/0/4/0/raw devfs file handling driver.
Thing like drivers/disk/scsi/scsi_disk/driver_v1 is a “module path” that is passed to get_module() API. Module is a bit bad naming, it actually means an interface exported by kernel module add-on, add-on can export multiple “modules” (interfaces).
Module path consists of 2 parts: path to kernel module add-on and a suffix identifying one of possibly multiple interfaces that add-on export. In this case drivers/disk/scsi/scsi/disk is a add-on path and driver_v1 is a suffix specifying one of add-on interfaces. Add-on path is relative to <prefix>/add-ons/kernel, where “<prefix>” is one of:
/boot/home/config/non-packaged
/boot/home/config
/boot/system/non-packaged
/boot/system
In this case full add-on path is /boot/system/add-ons/kernel/drivers/disk/scsi/scsi_disk.
Add-on path and interface suffix are separated by walking path until some file is found (supposed to be kernel add-on), the rest is interface suffix.
Kernel add-on exports interfaces by modules global variable, for example:
Off-topic: wasn’t there a topic named “how to write a video driver” somewhere in the documentation section in the main site? i can’t seem to find it, anyone knows where it is located? i hope i’m not just imagining this?