Many friends may be interested in Linux driver programming, but the first step in learning a driver is to build a kernel tree in your Linux system, how to construct it
The following is for you to explain, but I was just beginning to learn, so the kernel package used is also relatively old. To a certain extent, I will start to try the latest kernel package myself.
Then we'll share it with you.
First, obtain the kernel source code.
1. View the Linux kernel source packages that can be downloaded:
www.kernel.org
The system displays the following information:
2.6.32.67-linux kernel source for version 2.6.32.67
2. Select the source package you want to download:
#wget HTTPS://WWW.KERNEL.ORG/PUB/LINUX/KERNEL/V2.6/LONGTERM/V2.6.32/LINUX-2.6.32.67.TAR.XZ
3 after the completion of the decompression
#tar-XVF Linux-2.6.32.67.tar.xz
Two. Start compiling the kernel after the source is obtained
1. Enter the kernel root directory to configure the Linux kernel:
#make Oldconfig
2 "compilation
#make Bzimage
The compilation time is long, and after completion, a VMLINUX.O file is generated in the current directory.
3 "Compilation module
#make Modules
The compilation time is also relatively long
4 "Installation Module
#make Modules_install
After completion, a folder Linux-2.6.32.67-generic is generated under the/lib/modules directory,
Constructs the kernel tree successfully.