Hardware scan and driver loading process

  
 

System Start--> Scan PCI Bus (PCI Bus Enumeration)--> Read Hardware Information from Hardware Configuration Space-->PCI Bus Descriptor Contains a List of Detected PCI Devices (Before the specific device driver is loaded) -> The kernel sends the udev event--> User mode udev executes the corresponding udev rule to load the corresponding device driver, for example: /etc/udev/50-udev. Rules:ACTION=="add", SUBSYSTEM=="?*", ENV{MODALIAS}=="?*", RUN+="modprobe $env{UDEV_MODPROBE_DBG} $env{MODALIAS}" --> When loading the device driver, read /lib/modules/`uname -r `modules.alias file (not modprobe.conf file), load the corresponding driver modules.alias file according to alias by kernel according to each kernel module information (The alias information in the modinfo, including the hardware supported by the driver) is uniformly generated. --> When the device driver loads, call pci_register_driver to register pci_driver when the module is initialized, which contains pci_device_id, which enumerates the device ID that the driver can handle--> The PCI layer uses the pci_device_id table to view the list of detected PCI devices. Which devices match, so create a list of devices for the driver, and call the associated device (such as a network device) for each matching device by calling the probe function of pci_driver.

Copyright © Windows knowledge All Rights Reserved