October 2017
Intermediate to advanced
586 pages
14h 8m
English
So far, we have only discussed how to fill different structures of both devices and drivers, but now we will see how they are registered with the kernel, and how Linux knows which devices are handled by which driver. The answer is MODULE_DEVICE_TABLE. At compilation time, the build process extracts this information out of the driver and builds a human readable file called modules.alias, and located in the directory /lib/modules/kernel_version/.
This macro lets a driver expose its ID table, which describes which devices it can support. In the meantime, if the driver can be compiled as a module, the driver.name field should match the module name. If it does not match, the module won't be ...