Sixth chapter writing Linux drivers

Source: Internet
Author: User

Linux-driven work and access is one of the highlights of Linux, and has been widely praised by the industry. The Linux system maps each driver into a single file. These files are called device files or drive files.

To write a Linux driver:

First step: Build Linux driver skeleton (load and unload Linux drivers)

Step two: Register and unregister the device files

Step three: Specify driver-related information

Fourth step: Specify the callback function

Fifth step: Writing business logic

Sixth step: Writing the Makefile file

Seventh step: Compiling Linux drivers

Eighth Step: Install and uninstall Linux drivers

For a Linux driver, you can start early development and testing on Ubuntu Linux. The hardware can also be simulated with software on Ubuntu Linux.

To test the Linux driver steps using the s3c6410 Development Board:

First step: Test Linux drivers with executable programs on the S3C6410 board

Step two: Test Linux drivers on the s3c6410 Development Board using the Android NDK

Step three: Compile the driver into the Linux kernel for testing

In Ubuntu Linux, it is common to use VI or gedit to edit C + + source files. Other distributions in Linux are generally present in the vi text editor, and of course, you can also use any of your own favorite editor/C + + source code files.

This chapter not only introduces an example, but also describes how to test Linux drivers using different methods. These methods are mainly differentiated by platform.

Sixth chapter writing 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.