This post originally appeared on my personal blog at drupalgardens.com. I’m gradually moving all important entries here, since this is where I spend all my energy. Since then I’ve changed jobs, and laptops, and no longer run FreeBSD as my desktop OS, although I’d really like to once more.
So I got a new laptop: HP ProBook 6570b, with all the toys and the RAM slot filled to bring me up to 8GB. So obviously I immediately wiped the partition table and installed FreeBSD 9.1-RELEASE because that’s just how I roll.
Unusually, in my experience, the sound card Just Worked ™, but the graphics adaptor didn’t. All I had to do was add a few parameters to /etc/make.conf (WITH_KMS=”YES” and WITH_NEW_XORG=”YES”), install x11-drivers/xf86-video-intel from ports and we were in business.
But getting the wireless adaptor was a whole other game. Google told me to use the “bwn” driver module, already compiled in the GENERIC kernel, but that I first need to load the firmware. The firmware comes by installing net/bwn-firmware-kmod. This puts a pair of .ko files in /boot/modules – one for regular broadcom devices, and one for the Low Power editions. Pick the right one, load it by adding
to /boot/loader.conf and rebooting. Log in as root, type ‘ifconfig’ and behold your shiny new bwn0 device, which you can then configure as described in the handbook.
Except that it didn’t work. The drivers all load cleanly, with no errors, and no output in dmesg. And since I had plenty other things to get working, it sat for more than a month at the back of my mind, irritating me with it’s failure to work. When I got back to it, I noticed something interesting in the output of pciconf -lv:
vendor = ‘Broadcom Corporation’
device = ‘BCM43228 802.11a/b/g/n’
And if you read the man page for the bwn driver carefully, you’ll see that this device is not supported. More google reveals that Broadcom driver support is currently weak in FreeBSD, since all the clever device driver developers are hard at work on other sections of the code. And even more googling reveals a bit of unix black magic called Project Evil.
Project Evil provides tools to take Windows drivers for a network device, and… cast a spell on them or something, to turn them into FreeBSD drivers. It’s also a standard part of the FreeBSD distribution, which is nice. So, off to www.hp.com to download drivers. Find the support/downloads section, browse through to the page for my laptop, select “Broadcom” from the list of about 10 difference wifi devices on offer, and download. Run the received self-extracting file on a windows machine, then have a look in C:\SWSetup\SP57088. Grab the WinXP subfolder, and copy it to the FreeBSD environment (Project Evil apparently only works with XP drivers – not Windows 7). Then begin the incantations:
ndisgen bcmwl5.inf bcmwl5.sys
Hit enter at the prompts until it asks about firmware files. Now there are a pair of .dll’s in that WinXP directory, so enter their names, one after the other. After each, you get told that conversion was succesful and prompted for the next file. If there are no more files, just hit enter, and keep doing so till you get returned to your shell. Once this is all done, you’ll have a nice shiny set of .ko files in front of you, which you can copy into /boot/modules.
To test that they worked, load each in turn with kldload:
Run ifconfig, and you should now have a new device called ndis0.
Go ahead and follow the Handbook’s directions from this point:
ifconfig wlan0 create wlandev ndis0
to create the wlan0 device, and
ifconfig wlan0 up scan
to test – that last should return a list of networks to which you can connect. If you’ve gotten this far, then you’re all set up and can proceed as described in the Handbook.
BUT!!! I have one problem still, and if you have a suggestion on how to get past this, please put it in a comment below. If I set the NDIS drivers to load at boot time (adding bcmwl564_sys_load=”YES” to /boot/loader.conf), the kernel panics at boot time and I have to do clever things at the boot prompt to get back into the system. Apparently 64bit ndis drivers are a problem this way? So for now, I’ve had to script the above sequence of actions, and run it by hand. It works, but I wish I didn’t have to.