First, open the road of driving development
1, the preparation of driving development
(1) The Development Board of the normal running Linux system. The zimage of Linux in the Development Board must be compiled by itself and not compiled by others. The reason is that security checks are performed when the module is installed
(2) kernel source tree, in fact, is a configuration after the compilation of the kernel source code. We need the kernel source to compile our own modules
(3) NFS Mount Rootfs, host Ubuntu must build an NFS server. This is essential for driving development upfront and can improve our development efficiency.
2, drive the development of the steps
(1) Drive source code writing, makefile writing, compiling
(2) Insmod loading module, test, Rmmod unloading module
3. Practice
(1) Copy the original provided x210kernel.tar.bz2, find a clean directory (/root/driver), unzip it, and configure the compilation. After the compilation has been completed: 1, the kernel source tree. 2, compile OK zimage
(2) FastBoot The 1th step of the zimage burned to the Development Board to start (or throw zimage to tftp shared directory, uboot start tftp download start), in the future after the driver is compiled, you can test in this kernel
Try. Because this zimage and the kernel source tree is a bunch of, so the driver installs the version check does not have the error.
I generally choose to use TFTP to download the zimage image file in the host server-side shared directory after uboot boot, instead of burning the zimage image file directly into Flash, because we may be in the process of developing the driver
The kernel will be re-configured to compile, and then let the development Board to start the newly compiled kernel image file, if this repeated burning flash is more troublesome, not high efficiency.
Reference: "Zhu Youpeng embedded Linux Development \5.linux Driver Development \5.2. Character Device driver Basics"
Linux driven Learning Driver development readiness