最近在做嵌入式linux系统,这个系统主要应用于无线网络的研究,所以需要安装无线网卡驱动和一些网络服务,无线网卡的驱动我们用的是madwifi,linux内核版本是2.6.22.5
我们需要把madwifi驱动以静态的方式编译近内核。
模块和驱动怎样编译进内核就不多说了,网上有很多教程,但是,找了半天也没找到madwifi怎样编译进内核,难道要自己写Kconfig和Makefile文件???
在madwifi源代码中的patches/
This directory contains the bits needed to integrate the Madwifi source
distribution into a Linux kernel source tree. To do this, unpack the
kernel source if needed, then run the install.sh script from this
directory.
If you want to patch the currently running system you can run install.sh
without arguments, otherwise specify the source tree location on the
command line:
./install.sh /usr/src/linux
The driver sources will be copies into drivers/net/wireless/madwifi and
some kernel files will be patched to know about this directory.
Now you can run "make menuconfig" or similar command and configure the
driver using the normal mechanisms. If the kernel is already configured,
run "make oldconfig" to skip the questions you have already answered.
If you want to build modules, it's recommended that you use the
standalone build rather than integrate the driver into the kernel. Use
integrated build to compile Madwifi into the kernel. However, it's
possible to build Madwifi modules when the driver is integrated into a
2.6.x kernel.
这个说明文档大概意思就是 我们可以运行install.sh脚本,这个脚本文件会把驱动的源码复制到内核源码的drivers/net/wireless/madwifi目录下,并且会打上一些补丁。
传递给脚本的参数是内核源码的路径,然后我们运行make menuconfig,配置内核文件,就可以将madwifi驱动静态编译进内核。
重启 everything is OK。。。。。。