Monday, February 15, 2010

FreeBSD 8.0 Installed

After about 1.5 years gap with FreeBSDs, yesterday I finally got FreeBSD 8.0 Release version installed. My main interests are to get some libusb based programs to work under FreeBSD, including the USB demos from Microchip, pk2cmd for PICkit 2.

The installation itself is not flawless. Initially I tried with ACPI disabled (last time it helped) but this resulted in General Protection Fault on this Acer M1641 PC (Nvidia 620i/Geforce 7050 integrated chipset). With ACPI enabled, the install CD can boot up. But the installed could not find the SATA DVD-RW. Luckily the network card was recognized. So I used network install and it was not too bad, faster than I expected. I then spent some time to get Nvidia driver port to work. I have to disable the Linux emulation support in nvidia-driver since I could not download the large Linux emulation base packages (linux_base-f10) due to dead mirrors.

There are some other minor things to fix up, like I need to mount procfs to /proc (edit /etc/fstab) to get the gdm login screen to be able to properly shutdown/reboot the PC.

I tried a few simple programs based on libusb 0.1 and they seem to work fine under FreeBSD 8.0 release. Last time I had to patch the kernel and use the then alternative USB stack from Hans Petter Selasky (FreeBSD USB developer).

Then I tried to build pk2cmd and it seemed to work. The "-s" option does not see to work just as the release note of pk2cmd 1.20 says. I have not tried updating the firmware which was not working last time I tried it.

libusb 1.0 API has not fully been synced by the FreeBSD /usr/include/libusb.h. Luckily Hans says that he will make the libusb 1.0 compatible layer available to FreeBSD.

USB permision setup is now much easier than last time. By default, it seems USB device will have a ugen driver associated. The /dev/ugen* device belong to the operator group. So it is quite easy to add the user to the operator group and then the user can run libusb based program without root privilege.

I had problems to build OpenOCD git code, luckily Tomek Cedro provided a port so that I could build OpenOCD 0.4.0-rc2. I had to update the port system to build libftdi 0.17. This seems to be a prerequisite for OpenOCD.

Overall this time I have more positive views about FreeBSD. It is not as smooth as Ubuntu, but at least it is quite usable.

$ uname -a
FreeBSD MyFreeBSD.WORKGROUP 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Tue Jan 5 16:02:27 UTC 2010 i386

[mcuee@MyFreeBSD /usr/home/mcuee/Desktop/build/pk2cmd/pk2cmdv1.20LinuxMacSource]$ ./pk2cmd -?V

Executable Version: 1.20.00
Device File Version: 1.55.00
OS Firmware Version: 2.32.00

Operation Succeeded

No comments: