Tuesday, December 26, 2006

All Hail NdisWrapper

I am fairly certain that the Linux scene would be very different if NdisWrapper was not around. NdisWrapper is a simple, easy to use network driver wrapper allowing you to use Windows network drivers under Linux. Here is a brief overview from the NdisWrapper site:

"Some vendors do not release specifications of the hardware or provide a Linux driver for their wireless network cards. This project implements Windows kernel API and NDIS (Network Driver Interface Specification) API within Linux kernel. A Windows driver for wireless network card is then linked to this implementation so that the driver runs natively, as though it is in Windows, without binary emulation."

In my limited work with Fedora Core 5, NdisWrapper would prove to be quite the challenge. Fedora at that stage utilized a 4KB stack size. This may seem innocent enough, but it seems that the kernel stack size on Windows required up to 12KB. This meant that the kernel would need patching to support 16K stacks. The patches were thankfully available on the NdisWrapper site here.

Before patching, the driver would crash the system on modprobe. The downside to patching the kernel was that some platform specific packages would no longer work. Another option would be to recompile the kernel with a different stack size. This is something I looked into briefly but realized that I would need a great deal more Linux experience beforehand.

This particular incident would teach me a great deal about kernel sources, stack sizes and sheer persistence. When I moved to openSUSE, the problem was negated as SUSE utilizes a 16KB stack size by default (I believe). I've always wondered about native vs NdisWrapper performance... do you suffer a performance hit when using NdiWwrapper?

Incidentally, those people who use NdisWrapper should consider donating to the cause, enabling the team to buy new test equipment. You can donate through SourceForge here. Donations will not be tax deductible.

0 comments: