Step 10 learn Linux driver development

Source: Internet
Author: User

The popularity of Microsoft Windows 7 won't squeeze out Linux, Which is unquestionable. If you are a Linux user, you want to learn more. If you encounter Linux driver development problems, here we will introduce the necessary steps for Linux driver development and share them with you.

1. Learn to write simple makefile

2. Compile an application and run it with makefile.

3. Learn to write the driver makefile

4. Write a simple char driver. The makefile is compiled and can be insmod, lsmod, or rmmod. Print hello world in the init function of the driver. After insmod, you should be able to see the output through dmesg.

5. write a complete driver, and implement various functions such as read, write, ioctl, and polling. In ioctl, the structure is transferred from the user space to the kernel space.

6. write a block driver, and implement various functions such as read, write, ioctl, and poll.

7. It is the most difficult to learn about memory management and understand the implementation details of various memory alloc functions. This is a basic skill in Linux development.

8. The application of the learning lock mechanism is not the most difficult but error-prone, and involves many synchronization and concurrency problems.

9. view the driver code of the actual application in the kernel. You will find that the most basic thing you know is that the big frameworks are the same. It is nothing more than the implementation of functions such as read, write, and ioctl, but it contains a lot of small implementation details that I did not know before. At this time, we need to consider many other problems, not just the implementation of basic functions.

We recommend that you refer to one of the integrated kvm drivers in 2.6.20. Remember that it is very interesting in driver/lguest, that is, the virtual machine driver in Linux. The code is not long, but the function is powerful. If you have the ability, you can write an operating system to make a disk image as required and load it into a virtual machine. Then, the client can have its own 4G virtual address space.

10. After reading the driver, welcome to the Linux kernel learning.

In this way, you can easily complete the Linux driver development steps.

  1. Linux vs uCLinux
  2. Yuan Meng explained "little Linux" to you"
  3. Abandon the Linux operating system and select Microsoft?
  4. Better online shopping for Linux Online Banking
  5. Linux open-source projects are brilliant

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.