Knowledge of Linux Drivers

Source: Internet
Author: User

Knowledge of Linux Drivers

Operating system through a variety of drivers rely on home and hardware devices, it has shielded a variety of devices for users, drive hardware is the most basic function of the operating system, and provide a unified operation. Device drivers are one of the most basic components of the operating system and are more than 60% in the Linux kernel source program, so familiarity with driver writing is important.

The Linux system maps each driver into a single file. These files are referred to as device files or driver files and are present in the/dev directory. Thus, in the application's view, the hardware device is just a device file, and the application can operate the hardware device as if it were a normal file, which greatly facilitates the processing of the device.

Steps to write a driver:

(1) Build Linux driver skeleton (load and unload Linux drivers) any type of program has a basic structure, and Linux drivers are no exception. The Linux kernel needs to load the driver first when it uses the driver. Some initialization work is also required during the loading process.

(2) Registration and cancellation of equipment files

Any Linux driver requires a device file, or the application will not be able to interact with the driver.

(3) Specify driver-related information

The driver is self-describing.

(4) Specifying a callback function

A driver does not necessarily specify all of the callback functions.

(5) Writing business logic

(6) Writing makefile files

(7) Writing Linux drivers

(8) Installing and uninstalling Linux drivers

http://www.cnblogs.com/cherry-blossom/

Knowledge of Linux Drivers

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.