Relationship between Linux device drivers and the entire hardware system 1. Device Classification and features the hardware of a computer system consists of CPU, memory, and peripherals. With the development of the IC (Integrated circuit) manufacturing process, the integration of chips is getting higher and higher, and memory and peripheral adapters are often Integrated into the CPU. The driver targets memory and peripherals (including memory and peripherals integrated within the CPU), rather than CPU cores. 1.1 device categories and features Linux classifies memory and peripherals into three basic categories: character devices: devices that must be accessed in serial order. Does not pass through the system's quick cache. Block devices: they can be accessed in any order. It is cached quickly by the system. Network Device: it is designed for receiving and sending data packets and does not correspond to nodes in the file system. The communication between the kernel and network devices is completely different from that between the kernel and character devices and Block devices. However, character devices and Block devices do not have obvious boundaries. For example, for Flash devices, they comply with the characteristics of Block devices, but we can still access them as a character device. 2. Relationship between Linux device drivers and the entire software and hardware 1 shows that, except for network devices, character devices and Block devices are mapped to the files and directories of the Linux File System, you can access character devices and Block devices by calling open (), write (), read (), and close () interfaces of the file system. All character devices and Block devices are uniformly presented to users. A block device is more complex than a character device. A disk or Flash file system is first created on it, which defines the organization of files and directories on the storage media ). Applications use the Linux system to call interface programming, but can also use library C functions. C functions are recommended for the purpose of code portability. Figure 1: