lucky13’s bsd blog

October 4, 2008

Finally: OpenBSD’s bwi on My Laptop

Filed under: dragonflybsd, freebsd, laptop, my stuff, openbsd, wifi — lucky @ 10:38 pm

It’s been a while since I’ve had time to update this blog, so here’s a rambling omnibus catch-up.

The Laptop and the OpenBSD 4.4 Snapshot

I finally had a chance to burn the 4.4 snapshot I’d downloaded but, unfortunately, I only got dumps when I tried booting it on my laptop. So I grabbed the 4.3-install CD. I’ll download another snapshot shortly and give it another shot. I hope it’s not due to a change in ACPI/APM. I have a couple things ahead of it on my todo list before I’ll find out.

OpenBSD 4.3 on Laptop

I’ve run 4.3 on this laptop before, albeit wired rather than wireless. I typically run my router with my SSID hidden and with WPA. This has made it difficult given the fact that some operating systems don’t fare so well with hidden SSIDs, and OpenBSD pre-4.4 lacked WPA. Still, I wanted to use OpenBSD on this laptop with this card, which uses the bwi driver, even if it means using WEP until I can install 4.4.

I installed 4.3 Thursday night and started my updates Friday morning, and just before an IPv6-related patch was released (which failed when I rebuilt the kernel on my desktop but I’ll save that subject for later after I get a chance to see what happened). The install was fast, but it takes a while to build the system on a sub-ghz computer — and I’ll be honest, I don’t like compiling anything on this poor little old laptop.

Wireless Configuration with bwi

Anyway, I had a chance today while watching some college football to configure wireless and set up X. I figured I would at least have to broadcast my SSID again. I considered turning off all encryption to see if I could connect at all but that wasn’t necessary. The biggest issue seems to be timing intervals — I get watchdog timeouts before getting a DHCP offer from the router. This was time-consuming and annoying because it would go through that charade for a few minutes before giving me a login.

Running “ifconfig bwi0″ showed that I didn’t have a lease (so did looking at the router). So I took it down, brought it back up, ran dhclient, and got my lease. Now I can shell in from the laptop (which I’m doing now).

(Edit: I wrote a script that adds a sleep period that allows enough time for the router to give me a lease; I’ll add that to my rc.local tomorrow.)

Comparisons of Broadcom 43xx Between Operating Systems

Let me give some impressions about differences between FreeBSD, OpenBSD, and Linux as it relates to Broadcom 43xx-based wifi. Broadcom has an excellent and well-earned reputationwith their communications equipment. While their chips work very well in Windows and in Apple products where they can protect their intellectual property by agreement, it’s been a long road for open source operating systems in trying to support these chips. I understand Broadcom’s reasons for not divulging anything that could harm their business. I respect that. I also commend their decision this summer to release a Linux-specific driver for other 43xx cards (not mine), which I presume was made because of Dell’s offering of Ubuntu on laptops (Dell is a big client of Broadcom) and perhaps a shot at getting more of these particular chips in the burgeoning netbook niche.

This card wasn’t my first choice, it was just what remained after selling another laptop and card combination (to a friend who was impressed with OpenBSD and didn’t want to install it himself) and my USB wifi adapter (Atheros) swiped by another friend. I held onto this card because I knew there was active development among the Linux community. I crossed my fingers. And I also cursed a lot.

I’ve now used this card in Windows XP, Linux (2.6 but not 2.4), FreeBSD (6.2, 7.0), and OpenBSD 4.3. Needless to say, it works wonderfully in Windows. The manufacturer has all the leverage when it gets to write a driver that’s designed to work in only one operating system. Too bad I don’t have that operating system on my laptop.

It’s been hit and miss in Linux. I wanted to use it in DSL but between the older versions of ndiswrapper, 2.4 kernel, and wireless extension/tools, it just wasn’t to be. The card has been a pain in the ass to configure in kernel 2.6 since the bcm43xx driver was split up (bc43 and bc43legacy), and it wasn’t very easy to configure before then depending which version of wireless extension/tools were used. The one distro that had it working easiest and as I wanted it to (hidden SSID, WPA) had too many shortcomings for me to continue using it.

I’d briefly used the card in FreeBSD 6.2 early last year, but preferred the native Atheros driver to using ndis. Prior to installing OpenBSD 4.3, I decided to try a quick FreeBSD install to see how easy it would be to set it back up like I want. Getting it to work with a hidden SSID was a failure. I was able to use wpa_supplicant once I un-hid the SSID. I decided to give 7.0 a quick shot to see if it was any better with respect to ndis or wpa_supplicant. The one thing I appreciated was having wpa_passphrase in 7.0 (missing in 6.2?). One thing I don’t like about FreeBSD is having config and setup in /boot/loader.conf and in /etc. I was able to get it working in both 6.2 and 7.0. To FreeBSD’s credit, ndisgen is much easier than manual ndiswrapper configuration in Linux was.

Despite the issues I mentioned above, OpenBSD is by far the easiest to set up this card. By FAR. The card has been detected as “Broadcom 4306″ whether it’s been configured or not. I obtained the recommended firmware using pkg_add, which installs it in the appropriate firmware directory in /etc. Once that was installed, I manually entered:

ifconfig bwi0 nwid "mynetwork" nwkey "mywepkey"
ifconfig bwi0 up

I looked to make sure it was correct (ifconfig), then:

dhclient bwi0

and I had my lease.

Another point in OpenBSD’s favor is how the configuration files are all in /etc. It’s very easy to set up new interfaces: set up /etc/hostname.if (where if is the interface name) for each interface — e. g., hostname.url0, hostname.bwi0, hostname.ral0, and so on. When all goes well, these are scanned at boot and the interfaces brought up (or attempted). See the man page for hostname.if for details whether using DHCP or whatever. It’s very easy.

As I noted earlier, I’m getting watchdog timeouts using hostname.if so I’m going to see what I can do about that or else stick with starting the network via script or alias (edit: see other edit above). I’m content either way because, short of installing Windows (not going to happen), it works and it works easily.

So even though Windows is by far the easiest way to use this card, OpenBSD wins the ease contest among the BSDs (actually, DragonflyBSD deserves credit because they wrote the driver), and FreeBSD trumps Linux in getting bcm43xx cards set up with WPA. The newer bc43/legacy drivers very well may work best (short of Windows), but that’s been the most difficult setting up with my particular card.

I’m still going to try getting a 4.4 snapshot installed so I can use WPA.

Don’t Pass the Kool-Aid… Yet

Finally, not everything has been smooth sailing. OpenBSD can be finicky about certain things. That’s to be expected when security is Priority One.

There are some USB-related issues I’ve experienced. The first is the inability to use a USB keyboard during installation, which is a longstanding issue among the BSDSs (I’ve had mixed success with FreeBSD in this regard with it working in one release and breaking later; I was able to useĀ  my USB keyboard during my lone install of NetBSD 3.1). My primary desktop is all USB, no PS/2, no onboard networking, and no PCI slots. So I installed on another computer and moved the hard drive back here.

FreeBSD and OpenBSD also have a similar issue in requiring a particular port for USB keyboards — they seem to work in only one port, no other. Unfortunately for my desktop, it’s the same one required for the USB-ethernet adapter. The solution is a USB hub inserted into that port so both devices can share the address.

Next USB issue: I inserted a USB stick to transfer some config files. I couldn’t mount it. I checked dmesg and saw that the stick wanted to draw twice as many milli-amps as the USB port allows. Not just one stick, all of them. So I took the mouse out of my external USB hub — which is powered — and inserted in it. Voila. Fortunately the mouse can work in another unpowered USB port in the computer. Not a big problem and it’s not OpenBSD’s problem that this rinky-dink computer is underpowered and quirky.

I’ve also encountered issues with ACPI, which isn’t limited to any particular operating system because BIOS writers seem to have their heads up their asses. This has been on both laptop and desktop. I wrote about the ACPI issues I had on my desktop (while using FreeBSD 6.2) that made me choose between powering down and using my floppy — an easy choice for me to make. OpenBSD has some trouble with the same computer: I can’t halt it and even pressing the power button to shut it off after halting causes it to reboot (whoops!). OpenBSD works wonderfully on the laptop but FreeBSD won’t boot without first disabling ACPI. Like I wrote above, this is beyond the BSDs. Some Linux distros also have had (more or less) trouble with either or both of these particular computers. It’s something that comes with the territory, just like the thing with ndis or any other device requiring proprietary code to operate properly.

Everything considered, I’m pretty satisfied with the performance of OpenBSD on my computers. It installs with a lean configuration, making it ideal for the “classic” computers I use. It’s installed on my primary desktop complete with X. It’s now on my laptop. I also run it on a server here at the house. It’s proven itself to be worthy of use across the board. (I also boasted of its superior sound driver in a post on my Linux blog.)

I’m down to Linux on one hard drive now, and that’s become a spare since I bought a much larger one for the desktop. I have some data and multimedia on it to copy over to the desktop computer and then I’ll probably repartition it for use with OpenBSD. Maybe stick it in the server. Maybe use it as a floater between computers.

Who knows, and who knows when I’ll get around to it with my schedule lately.

September 9, 2007

Rolling Along, One Glitch, I’m Happy with My Decision

Filed under: freebsd — lucky @ 4:28 pm

Most of my computers have been simple to set up with FreeBSD 6.2. The documentation is superb, especially the handbook.

One of my computers is very quirky, though, but I’m getting there. It’s the one I set up to boot without ACPI to see if that would remedy the floppy. Well, that fixed the floppy problem but it’s also caused something else to go awry: now I can’t properly power down. Before I changed to no ACPI, I could run shutdown and then press my power button and it would turn off. Now I run shutdown and pressing the power button reboots the computer. No big deal since I rarely turn it off, but I really hate turning the power off during POST (which is the first chance in the whole sequence I get to use the power button again).

I’ll see if there’s something else I can do about the floppy or find a tweak for ACPI before I decide to live with it (it’ll probably get lengthy uptimes between boots regardless) or without floppies (not exactly a priority). I’m pretty confident I’ll be able to get it sorted out. Just not tonight.

The only noticeable performance difference I can tell is GNU screen doesn’t hang when switching around between things and my audio doesn’t stutter when I have stuff compiling. That’s not much of a benchmark and it’s only anecdotal, but watching top while all that was happening leads me to believe that FreeBSD schedules much better than Linux 2.4 (and probably better than 2.6 even though I can’t address it because I remember ever installing 2.6 — just used 2.6 on live CDs).

Over all, I’m pretty happy with how smoothly everything has gone.

September 8, 2007

Done. Sort of.

Filed under: freebsd — lucky @ 8:08 am

FreeBSD 6.2 is now installed on every computer except my XP box (which will eventually get the same “upgrade”) and my old NT hard drive (I have thumb drives with more storage, so why bother?).

More to come later this weekend. Or Monday.

September 6, 2007

Update: Settling on FreeBSD… Probably

Filed under: freebsd — lucky @ 12:03 pm

I think I’m finally settling on a FreeBSD-based system without ports or pkgsrc, and just compile what I want to use. I find myself using the same apps and utilities so it makes more sense to me to compile what I want than to add 400 MB of makefiles, etc., I’ll barely use — aside from my own files and audio collection, 400 MB is about all I’m going to have on my system anyway (unless I keep the sources). I still might install ports to “jump start” the installation of dependencies, and there’s about a 10% chance I’ll change my mind and decide on either NetBSD or OpenBSD instead. But I’m leaning pretty firmly in one direction now.

I’ve been running mostly from my FreeBSD 6.0 installed on my laptop and also a transient spare hard drive shuttled between computers ranging from a 100 mhz Pentium to my 1300 mhz Athlon.I installed man pages and ports. From ports, I’ve added GNU screen and mp3blaster (and the dependencies needed to get them up and running). From source, I’ve compiled a few more apps.  GNU screen is mandatory for me. I won’t be installing X. I installed mp3blaster to test FreeBSD with my soundcards.

The only issue I’ve had is with an Intel i810 internal sound card where I got a message (several actually) that loading the meta snd_driver may not have succeeded. But it did, so there’s no issue. All the rest of my sound cards have worked flawlessly — load the driver, voila. I didn’t set up to load specific drivers because I’ve been shuttling around hard drives and didn’t want to have to keep changing drivers. The meta driver will be great if I make any live CDs.

I’m having the same issue I mentioned before with my USB keyboard only working in one port. I can live with that for now. I haven’t tried loading CDCEther in different USB ports yet.

Finally, I haven’t been able to mount a floppy. I get an error message that it’s not configured. I’ll try it with a non-ACPI kernel and see if that does the trick.

I’ll likely upgrade all partitions with clean installs of FreeBSD 6.2 this weekend.

September 2, 2007

Yes, All Three

Filed under: freebsd, netbsd, openbsd — lucky @ 3:31 pm

Progress! Got everything set up this weekend. I initially was going to set up my computers on NetBSD. I decided, after some discussion, to install NetBSD, FreeBSD, and OpenBSD on different hard drives so I can switch them between computers and get an assessment of which works best with which hardware. With one exception, all are set up with pkgsrc. The one exception is a FreeBSD install with ports.

Everything has gone very smoothly save for a couple minor issues. One was with NetBSD and ethernet over USB while using a USB keyboard. The USB keyboard only works in one port (what’s up with that?). That’s the same one ethernet wants to use (what’s up with that?!). Not a big issue (more a matter of convenience), so I’m just using a standard NIC. No idea if the mouse wants that port, too, but it doesn’t matter since I don’t have plans to install X on any partition.

The second issue is the time required for compiling source on a RAM-challenged, slow CPU machine. Nothing that time won’t cure in the short term (if the electricity stays on). Short term is relative; I know it wouldn’t take so long if it weren’t a spanking fresh install with all kinds of dependencies to meet. The long-run fix for that is using binaries or a combination of more patience and less coffee.

I’m pressed for time and the lights are flickering (storm), so I’ll post impressions of installing and setting up each this week.

August 24, 2007

Change Sucks

Filed under: freebsd, netbsd — lucky @ 8:10 pm

I’ve added this blog because I’m going to start transitioning more of my computers to FreeBSD and/or NetBSD. One of my main reasons for changing is because it looks like the BSDs will retain better support for older hardware than Linux will moving forward.

One of the ironies is that the desktop-oriented BSD forks like PC-BSD are focusing squarely on bleeding-edge hardware and including Beryl by default. That leaves a void for those of us who want to use functional hardware we already own without having to buy more hardware just to stay current.

I’ve been tinkering with some of my ideas I implemented in various DSL remasters and am considering using FreeBSD in a similar fashion. I think a similarly-minded bloat-free project aimed at supporting older hardware could fill a niche (especially if DSL will move on and abandon older hardware). I don’t know if I’ll end up releasing anything yet because I really don’t care to have to support my own source repository for GPL compliance. Freedom has a price when FSF has lawyers to feed.

Blog at WordPress.com.