Author: Huaqing Yuanjian Embedded College. Simply put, a driver is a program that sets a piece of hardware to complete its inherent functions. For example, a network card device driver is a program that sets the relevant registers of the network card so that it can normally send and receive network data packets. The driver interacts directly with the hardware device, and most of its work is to operate the hardware-related registers. First of all, the register is also a kind of RAM. After the system is powered off, the contents in the register will be lost. During the system power-on reset process, the hardware register is generally reset to a default value. In the default state, the hardware cannot work normally, such as the interrupt enable is masked, the work enable bit is also masked, and some key control registers that determine the working status of the hardware also need to be reconfigured. And all these tasks depend on the completion of the device driver. Drivers are generally part of the operating system kernel. Even though many systems now support dynamic loading of drivers, the driver code is still executed in kernel code mode when it is executed. In other words, the driver code has a system privilege level. In addition to the hardware device resources corresponding to its own resources, it also has full access to the operating system resources. Therefore, if a driver has a bug, it will directly cause the entire operating system to crash. Therefore, debugging the driver is a very critical task. The driver must be carefully checked and needs to withstand the test of long-term operation. Application layer programmers often have awe of peripheral drivers that belong to kernel programming, and think that driver programming is a very complicated task. In fact, low-level driver programming often has greater flexibility than application layer programming, just as there is no hardware that cannot be debugged, and there is no low-level driver that cannot be debugged, but application layer bugs sometimes cannot be debugged. The debugging process of the low-level driver is a process of verifying both the hardware and the driver. Low-level drivers are often used to locate hardware design errors or possible problems with the hardware chip itself, so low-level driver programmers must have a relatively full understanding of the hardware devices to be driven, and also need to have a relatively clear understanding of other hardware or external environments that interact with the hardware.
You Might Like
Recommended ContentMore
Open source project More
Popular Components
Searched by Users
Just Take a LookMore
Trending Downloads
Trending ArticlesMore