NdisWrapper Setup on Slackware

Posted by: Andrew Smith
Poster contact info: andrew-smith at mail ru
Author: same as 'Posted by'
Software: Slackware 10.1, NdisWrapper 1.2

This guide describes how to compile ndiswrapper on Slackware Linux with the 2.6 kernel. The instructions on the ndiswrapper wiki are valid but this walkthrough is specific to Slackware to make it less of a headache for newbies.

The 2.6 kernel is on the second Slackware disk under testing/linux-2.6. I will not describe it's installation in this guide.

Do everything as root since regular users won't have the permissions to do anything usefull :)

Errors
If you already tried to compile ndiswrapper and it didn't work (that's why you're reading this i guess :) you probably got an error such as this:
make -C driver
make[1]: Entering directory `/root/kit/ndiswrapper-1.2/driver'
Can't find kernel sources in /lib/modules/2.6.10/build;
  give the path to kernel sources with KSRC=<path> argument to make

or this:
version magic '2.6.10 SMP preempt PENTIUM4 4KSTACKS gcc-3.3' should be '2.6.10 486 gcc-3.3'

The first one means that the kernel headers are missing and the second that the kernel headers were found but do not reflect the actual configuration of the running kernel. Let's fix that stuff first.

Kernel Headers
Let me be honest here: I am not a hugely advanced linux user so there is probably a better easier way to get these headers in place.

Also, I am assuming that you did not install the kernel-headers package off the second Slackware disk.

Check whether you installed the kernel-source package properly (you shoud see something that's not an error):
ls -l /lib/modules/2.6.10/build
lrwxrwxrwx  1 root root 21 2005-06-11 17:26 /lib/modules/2.6.10/build -> /usr/src/linux-2.6.10-> /usr/src/linux-2.6.10/
cd /usr/src/linux-2.6.10/

Now to make sure that you get the proper headers, you have to do some tricky stuff:
make menuconfig

An application will start. You shoud exit without changing anything and save your configuration at the prompt.

Now edit the .config file that was just created and comment out the following lines:
CONFIG_SMP
CONFIG_PREEMPT
CONFIG_MPENTIUM4
CONFIG_4KSTACKS

Start compiling the modules the makefile will detect the missing pieces of your .config and will ask you some questions. Select 486 for the processor and say no to everything else.
make modules

Now you should have the modules ndiswrapper wants.

NdisWrapper
Download the latest version (if a version newer then 1.2 is available, I recommend you give it a try since it probably has more cards supported and fewer bugs but it's up to you). The compile should go real smooth now, try:
tar xvzf ndiswrapper-1.2.tar.gz
cd ndiswrapper-1.2
make distclean
make
make install


That's it! I hope you got it to work becase I don't have any more advice :) Setting up your card is a different story, check out the NdisWrapper Wiki (these days at http://ndiswrapper.sourceforge.net/phpwiki/index.php/) to see whether your card is supported, where to get the windows driver and which file to use.

Enjoy.