All posts by basicbsd

Broadcom BCM4312 Wireless Network Card on FreeBSD 11.1

To load the required modules into the kernel, you need the kernel source code. Use subversion to download and unpack into the correct location:

svnlite checkout https://svn.freebsd.org/base/releng/11.1/ /usr/src

Before downloading the required kernel modules, update and download the ports tree:

portsnap fetch extract

Build and install Portmaster for simpler port management:

cd /usr/ports/ports-mgmt/portmaster
make install clean

Then install the Broadcom BCM 4312 modules:

portmaster sysutils/b43-fwcutter net/bwn-firmware-kmod

Instruct FreeBSD to load modules into the kernel during boot by adding the following lines to /boot/loader.conf

siba_bwn_load="YES"
if_bwn_load="YES"
bwn_v4_lp_ucode_load="YES"

If you don’t have the Broadcom BCM4312 low power model as is installed in this system, change the last line to:

bwn_v4_ucode_load="YES"

Now edit the system processes file /etc/rc.conf and add the following lines:

wlans_bwn0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"

Create the /etc/wpa_supplicant.conf file to setup WiFi details as follows:

network={
 ssid="YOUR WIFI NETWORK"
 psk="YOUR WIFI PASSWORD"
}

Reboot the system with shutdown -r now and you should have WiFi up and running.

FreeBSD Installation into a dual boot environment with Windows 10 (MBR/BIOS not UEFI)

 

If you’re going to install FreeBSD, I suggest you check at least the following two pages for hardware compatibility. Given its relatively smaller user base, manufacturers aren’t as forthcoming with firmware and drivers for operation under FreeBSD. If you want most things to just work out of the box, research compatible hardware options to make sure the computer you’re considering won’t require further configuration after installation. Some incompatibilities can be more troublesome than you might expect–despite what the experts say.

As a rule of thumb, refurbished Think Pads have a high strike rate and can often be picked up at a good price.

I mentioned it was a Dell Inspiron 1545 x64; further hardware specifications are detailed below.

Processor: Intel Celeron CPU 900 @ 2.2 GHz
RAM: 3 GB
HDD: Samsung HM501II 451 GB
Wireless Network Card: Broadcom BCM4312 802.11b/g
Ethernet Network Card: Marvell Yukon 88E8040 PCI-E Fast Ethernet Controller
Video Adapter: Mobile Intel 4 Series Express Chipset GMA 4500MHD WDDM1.1 1.5 GB 64MB
DVD/CD-ROM: Optiarc DVD+-RW AD-7700H

Old and basic, but a fitting system for my return to FreeBSD.

The installation process is relatively pain free. I downloaded the FreeBSD-11.1-RELEASE-amd64-memstick.img file (make sure you get the one that matches your system architecture) from the official https site:
https://download.freebsd.org/ftp/releases/ISO-IMAGES/11.1/

I was in the existing Windows OS on the notebook so downloaded Win32 Disk Imager from Source Forge to burn the FreeBSD installer image to a USB flash drive:
https://sourceforge.net/projects/win32diskimager

It was at this moment that I decided to keep Windows and setup a dual boot environment with FreeBSD. So I opened the native Windows application Disk Management, which is super easy to use. Just follow the instructions at the first link to shrink the existing disk volume, and then follow the instructions at the second link to create a new partition for the FreeBSD install.

  1. https://technet.microsoft.com/en-us/library/gg309169.aspx
  2. https://technet.microsoft.com/en-us/library/gg309170.aspx

I split the 450 GB HDD in half; opened Win32 Disk Imager and burnt the downloaded FreeBSD-11.1-RELEASE image to a trusty old 1GB USB flash drive; rebooted the system; hit F12 at boot to enter the system BIOS; set the first boot device to the USB drive; and booted into the live version of FreeBSD 11.1-RELEASE on the flash drive.

Once in, I selected the Install option and chose guided partitioning. It’d been several years since my last return to FreeBSD, and I wanted this process to be as painless as possible. From memory, setting up a dual boot environment with Windows is easy enough provided Windows is already installed and you don’t install FreeBSD on ZFS, so I was keeping it vanilla as possible. I selected to Partition and not use the Entire Disk as I wanted to keep the existing Windows OS, and chose the volume previously allocated in Windows Disk Management, which was displayed just as it was made. Hit Finish then Commit and let the FreeBSD Installer work its magic! Once the installation process had completed, I was presented with a prompt to enter a new root password. FreeBSD then ran through the usual process of network configuration, location and local time setup, startup processes selection, and user account addition. Following the prompts is easy and self-explanatory. The most complicated process might be static IP assignment if not selecting DHCP automatically assigned IP addresses, but I went with the latter. Once the FreeBSD installation was complete, I rebooted into FreeBSD 11.1-RELEASE.

To finish setting up the Windows 10 / FreeBSD dual boot, I ran the following commands:

root@pinkdell:~ # gpart show
=> 63 976773105 ada0 MBR (466G)
 63 80262 1 !222 (39M)
 80325 1595 - free - (798K)
 81920 30720000 2 ntfs (15G)
 30801920 474314800 3 ntfs (226G)
 505116720 471656447 4 freebsd [active] (225G)
 976773167 1 - free - (512B)

=> 0 471656447 ada0s4 BSD (225G)
 0 463470592 1 freebsd-ufs (221G)
 463470592 8185854 2 freebsd-swap (3.9G)
 471656446 1 - free - (512B)

root@pinkdell:~ # boot0cfg -B ada0

gpart just to confirm the disk label and boot0cfg with the -B flag to write the FreeBSD Boot Manager to the MBR (Master Boot Record) of the hard disk so that I could choose whether to boot into Windows or FreeBSD at startup. I then sent shutdown -r now to the console and rebooted to make sure everything worked. Sure enough, the FreeBSD Boot Manager screen presented me with the options to boot Windows with F1 or FreeBSD with F4. Success!

After booting into Windows to make sure everything was still in tact and operational, I rebooted back into FreeBSD to start setting up my system, only to discover that the Broadcom wireless network card wasn’t detected. A quick search revealed that there was no driver support in the generic FreeBSD kernel for the Broadcom BCM4312 wireless network card, so I set myself to task to fix it. I’ll show you how in the next article!

Back to BSD

It’s been a long time!

“True love has a habit of coming back.” — Turcois Ominek

MSDOS

So I dug out an old Dell Inspiron 1545 that had been relegated to the pile of unused notebooks due to some catastrophic if not fatal hardware failure. Soon after powering her up, I realised it had died the slow death of a failing battery. I now remembered: it couldn’t hold charge and had to be permanently plugged into a power supply else it would power down. Rather than purchase a new battery, I bought a cheap replacement. She would make a perfect return to the first experience I had with a Unix OS: FreeBSD. I had to go back a long way to remember my first time. It was 1997, and the Internet was just taking off with dialup being the only provided internet service at the time. I remember upgrading to a 56Kbps modem from a 28.8 and thinking it was the best! Lag times dropped dramatically and I was ready to spread my wings. A friend of mine had purchased some FreeBSD CDROMs from what must have been FreeBSD.org. Although I had been using computers for the past five or six years, up until this point, my PC experience was limited to Windows and DOS. My friend had just started using Linux and wanted to give FreeBSD a run; my computer was the test dummy. We miraculously got FreeBSD version 2.x.x or 3.0–I can’t remember with any accuracy–installed and I immediately fell in love. To this day, I can’t say why but I had developed a weird infatuation with the command line ever since my first introduction to it many years earlier with MS-DOS on an Intel 486–and FreeBSD was all CLI! The unfettered control and limitless power that such an interface possesses instils an itch of curiosity that can’t ever be satisfied no matter how much you scratch. With each command you could discover something new or irreparably break something. Creation and destruction so indistinguishably intertwined as to leave one simultaneously carefree and cautious with every interaction. And I couldn’t get enough. I’d stay up for hours, night after night–and it was never enough. It’s indescribable. But I loved it. That was 20 years ago…