Introduction
Writing a Linux device driver is undoubtedly a complex task. This article will introduce the device driver of non-standard hardware, discuss the hardware application programming interface, and use the Cirrus Logic EP9312 on-chip system embedded platform to add device driver to analyze the case.
If some programming content is not covered in this article, readers can also refer to similar device driver codes for reference. Another way is to retrieve historical files or to ask the Linux kernel Information Center for inquiries.
Linux Overview
Linux is a replica of the UNIX operating system, which was first developed by Linus Torvalds in 1991 and continues to be improved by open source organization through an open source development model. Any person or group that uses Linux does not have to pay any copyright fees.
Only the kernel is not enough, usually Linux is bundled with some windows environments, Windows managers, and applications running on the kernel. However, because of the embedded platform, the Windows environment is not essential. Unlike Microsoft's Windows operating system, Linux does not require a fixed set of applications or utilities that must be used, so it can meet the customized requirements of embedded market terminal solutions.
The most basic components of the operating system include 1 resource managers, a scheduler, an interface between hardware and application software, a network manager, and a document System Manager. The Linux operating system also includes these components, and of course there are other parts. This paper mainly describes the interface between hardware and application software--device driver.
Device driver Type
Device drivers can be grouped into 2 broad categories: Hardware device drivers and software device drivers. Hardware device drivers are connected to physical hardware devices, such as UART devices or IDE devices, while software device drivers act as interfaces between low-level data structures, or between hardware device drivers and advanced data structures. The graphics console driver is a software device driver. Among them, 1 LCD controller drivers load and manage the display, while the graphics console colors the characters that will be displayed and gets the information entered from the keyboard. Another example of a software device driver is the document System execution-the document System driver uses 1 hard disk drivers to store data, and the hard drive is directly connected to the physical hard disk.