Linux Device Driver Programming-Linux general technology-Linux programming and kernel information-complex device driver-the following is a detailed description. The complex device drivers mentioned here involve PCI, USB, network devices, Block devices, and so on (strictly speaking, these devices are not in the same concept, for example, they are tied with Block devices by character devices, PCI and USB devices may all belong to character devices. The drivers of these devices involve complex data structures and program structures related to specific device types. This article will not describe too much about the driver details of these devices, but just give a brief description.
PCI is The abbreviation of The Peripheral Component Interconnect-Bus. The CPU uses The PCI bridge chipset to communicate with The PCI device. The PCI bridge chipset processes all data interactions between The PCI subsystem and The memory subsystem, the PCI device is completely isolated from the memory subsystem. Demonstrate the principles of the PCI subsystem:
(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // dev.yesky.com/imagelist/06/44/f00mjk3tvl70.jpg'); ">
Each PCI device has a 256-Byte Device Configuration block. The first 64 bytes are used as the device ID and basic configuration information. Linux provides a set of functions to process PCI configuration blocks. Before a PCI device can be used, the Linux driver needs to determine the specific parameters of the device from the information in the PCI device configuration block and set the parameters so that the PCI device can be operated correctly.
The general process of PCI device initialization function processing is as follows:
(1) check whether the kernel supports PCI-Bios;
(2) check whether the device exists and obtain the configuration information of the device;
1 ~ 2. The two steps are as follows: