Sunday, April 17, 2005

FreeBSD NDISulator

FreeBSD 5 has introduced a NDIS emulator that allows you to use Windows binary drivers on FreeBSD, the so-called NDISulator, or "Project Evil". The main use for this is for wireless network cards because many vendors do not release source code or schematics for their drivers to the open source community. See section on this page of the FreeBSD Handbook for documentation on using the NDISulator.

I have a Linksys WPC11 v4 PCMCIA wireless card. Versions 1-3 were supported by the wi driver in FreeBSD, but v4 is a Realtek 8180 chipset that isn't yet supported. (I won't get started on my soap box about how vendors should never change chipsets without changing model numbers) I do have a few supported wireless cards, but figured I'd give the NDISulator a shot with it. This is actually the card I regularly use in my FreeBSD laptop now.

  1. Download the Windows XP 8180 drivers from Realtek here.
  2. Unzip the downloaded file to:
  3. Run the following commands:
    # cd /usr/src/sys/modules/if_ndis

    # ndiscvt -i NET8180.INF -s rtl8180.sys -o ndis_driver_data.h

    # make && make install
  4. The driver is now ready. To load it, run the following commands:
    # kldload ndis
    # kldload if_ndis
  5. Now check your dmesg output.  If all went well, you'll see something like the following: 
    ndis0: port 0x1000-0x10ff mem 0x88000000-0x880001ff irq 11 at device 0.0 on cardbus1

    ndis0: NDIS API version: 5.1

    ndis0: Ethernet address: 00:0c:41:a7:98:45

    ndis0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
If all went well, you can now ifconfig the interface as desired (see the Handbook) and you're ready to go.

I initially had some serious performance issues. Throughput was inconsistent, and didn't exceed 200-300 Kbps. This was with a driver I found recommended on a FreeBSD list post or website I found on Google (don't recall where). After downloading the latest driver from Realtek, I'm getting good throughput. iperf consistently gets around 5 Mbps across the wireless connection, about as good as you're going to get on a 802.11b card.

Overall I am very impressed with the FreeBSD NDISulator. I wasn't expecting it to be as seamless, easy to get working, and well-performing as it is. Great work to Bill Paul and the FreeBSD team.


Anonymous Anonymous said...

i have try using "project evil" (RTL8180), but still dont work, please send me you driver rtl for compiling (NET8180.INF and rtl8180.sys), if you dont mind. thank you very much.


11:57 AM  
Anonymous korruptedkarbon said...

can you email me the compiled driver also? thanks

12:43 PM  

Post a Comment

<< Home