jeudi, octobre 18, 2012

Using BCM4313 wireless chip under FreeBSD

I've got a new laptop at $DAY-JOB, and this laptop have a BCM4313 chip:

# pciconf -lv | grep Wireless
    device     = 'BCM4313 802.11b/g/n Wireless LAN Controller'

I've first try with net/bwn-firmware-kmod and if_bwn without success, but NDIS works great (on 9.1-RC2 at last).
Here here to proced for converting the Windows XP drivers to a kernel module:
# cd /tmp
# fetch  http://gugus69.free.fr/freebsd/Broadcom_BCM43xx_5.100.235.19_win5x.tgz
# tar xzvf Broadcom_BCM43xx_5.100.235.19_win5x.tgz
# cd Broadcom_BCM43xx_5.100.235.19_win5x/
# ndisgen

Inside ndisgen, here is to proceed:

  1. Type 3 for "Convert driver"
  2. INF Filename: bcmwl5.inf
  3. SYS Filename: bcmwl564.sys (or bcmwl5.sys for FreeBSD-i386)
  4. Firmware Files: kept empty

At the end, it should generated the bcmwl564_sys.ko module, now enable it:
# cp bcmwl564_sys.ko /boot/modules/
# kldload bcmwl564_sys

ndis0: mem 0xd4500000-0xd4503fff irq 19 at device 0.0 on pci36
ndis0: NDIS API version: 5.


And check that you have a new ndis0 interface:

# ifconfig | grep ndis
ndis0: flags=8843 metric 0 mtu 2290

You can now configure your rc.conf like that
kld_list='bcmwl564_sys'
wlans_ndis0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"


And enjoy !

dimanche, septembre 09, 2012

FreeBSD kernel for Nintendo Wii

Few months ago I've subsrcibed to the FreeBSD "svn-src-head" mailing-list for being notified of every change to the -current source tree.
And some weeks ago I've seen this message: Initial support for running FreeBSD on the Nintendo Wii.

What ??? FreeBSD is going running on Wii ???

I've looked for more information and found a small page that explain how to build it on the wiki: FreeBSD/Wii.
The commit message includes an important detail: "There are still some MMU problems and to get a working system you need to  patch locore32.S. Since we haven't found the best way yet to address that problem, we're not committing those changes yet."

  1. The -current code is incomplete, but meanwhile we can apply this locore32.S unofficial patch.
  2. The result is not usable: You will not obtain a shell prompt, it will hang before.
Here is the video of the boot process:



For building the kernel you need -current source tree, then the steps for building this kernel are pretty simple:

cd /usr/src
fetch http://gugus69.free.fr/freebsd/wii/locore32.diff
patch < locore32.diff
mkdir /tmp/WII
setenv MAKEOBJDIRPREFIX /tmp/WII ; make TARGET=powerpc TARGET_ARCH=powerpc buildworld
setenv MAKEOBJDIRPREFIX /tmp/WII ; make TARGET=powerpc TARGET_ARCH=powerpc KERNCONF=WII buildkernel

It will generate a kernel for WII here:
/tmp/WII/powerpc.powerpc/usr/src/sys/WII/kernel

Then follow instructions from FreeBSD/wii wiki page for setup the SD card.

You can download my own FreeBSD/Wii archive (to be extracted on the root of your SD card).