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.
The simplest method is to follow LDD (Linux devive driver.