When learning Linux device driver, the first step is to build the kernel tree, first download the Linux kernel, according to the author of Linux Device dervier 3, as long as the linux-2.6.xxx kernel can be, I am a linux-2.6.30.4.
Procedure:
(1) download the kernel source package, and unzip: [root @ Yanbo kerneltest] # tar-zxvf linux-2.6.30.4.tar.gz
(2) [root @ Yanbo linux-2.6.30.4] # Make mrproper
(3) [root @ Yanbo linux-2.6.30.4] # Make menuconfig
Configure the required options (you can configure only the required items or in the. config file ).
(4) Compilation: [root @ Yanbo linux-2.6.30.4] # Make
(5) The compilation module: [root @ Yanbo linux-2.6.30.4] # Make modules
(6) Installation module: [root @ Yanbo linux-2.6.30.4] # Make modules_install
(7) installation: [root @ Yanbo linux-2.6.30.4] # make install
(8) [root @ Yanbo linux-2.6.30.4] # ls/lib/modules/
Check whether a directory named 2.6.30 is generated. After compilation, the module can compile it, or specify the Directory through makefile or make in other directories.
Note: when building the kernel tree, you need to pay attention to a lot of issues, that is, there is no problem during the building, and it will also be encountered in future compilation and Loading modules, but the network is the best resource.