Home > Article > System Tutorial > Classification and characteristics of Linux device drivers
Linux device driver is an important part of the Linux kernel. It is responsible for interacting with hardware devices and providing a unified interface for user mode. Linux device drivers can be divided into three major categories according to their functions and characteristics: character devices, block devices and network devices. This article will introduce the definition, characteristics and implementation methods of these three types of device drivers.
Linux divides memory and peripherals into three basic categories: character devices, block devices and network devices.
Character devices refer to those devices that must be accessed in serial order, such as touch screens, tape drives, mice, etc. Block devices can be accessed in any order and operated in blocks, such as hard disks, floppy drives, etc. Character devices do not go through the system's fast buffer, while block devices go through the system's fast buffer. However, there is no clear boundary between character devices and block devices. For example, a Flash device conforms to the characteristics of a block device, but we can still access it as a character device.
The driver designs of character devices and block devices are very different, but for users, they all use the file system’s operating interfaces such as open(), close(), read(), write() and other functions. access.
In the Linux system, the network device is designed for the reception and transmission of data packets. It does not correspond to the nodes of the file system. The communication between the kernel and network devices is completely different from the communication between the kernel and character devices and block devices.
In addition, TTY drivers, I2C drivers, USB drivers, PCI drivers, LCD drivers, etc. themselves can be classified into three basic categories. However, for these complex devices, the Linux system also defines a unique driver architecture.
This article summarizes the classification and characteristics of Linux device drivers. By reading this article, you can understand the basic concepts and working principles of Linux device drivers, laying a solid foundation for further learning and practice. In actual development, you also need to refer to the documentation and sample codes of different processors and platforms, as well as the various APIs and frameworks provided in the Linux kernel source code.
The above is the detailed content of Classification and characteristics of Linux device drivers. For more information, please follow other related articles on the PHP Chinese website!