20101118

FreeNAS 8 Beta released

iXsystems is pleased to announced FreeNAS 8.0 Beta. FreeNAS 8.0 has undergone a complete rewrite. We've redesigned the GUI to be easier to use and extend. We've upgraded many technologies in the system for improved hardware support, faster I/O, better modularity, and easier upgrades. We trust that you'll find the system easier to use and, in time, much more feature rich than the current FreeNAS offering.

The base system has migrated from FreeBSD 7.x and the m0m0wall build system to FreeBSD 8.1-RELEASE and NanoBSD. The system startup has migrated from the older php scripts to the standard FreeBSD rc.d boot system. We've pushed many of the bug fixes and system improvements back into FreeBSD.

We've rewritten the GUI using Python and Django. We've completely removed the old php system. In addition to Django, we're using Dojango and Dojo to implement AJAX features. The new system is much more modular than the old system. We will use this modularity in a future version for easy integration of custom features into your FreeNAS box.

The installer has been rewritten using pc-sysinstall, the future FreeBSD installation technology. The scripts have a similar feel to the old PHP scripts for users of the current system. The ISO now is only an installer. You can no longer run in live mode from a CDROM.

The installation types have changed; there's no longer an embedded or full install, nor can the image be installed on a data disk. You must now install FreeNAS onto a dedicated device. FreeNAS supports USB flash, CompactFlash, hard drives, ssd or any other mass storage device supported by FreeBSD.

FreeNAS 8.0 features ZFS version 14.

FreeNAS 8.0 beta has retained the core functionality of a storage appliance. The media center features of the box have not been reimplemented in the core FreeNAS package. A media center add-on package will provide this functionality in the future. We've focused on creating a robust, easy-to-use, and extensible system. We're creating the base to allow other types of packages to be added, such as printer support, scanner support, or home automation.

To help prioritize what current features are turned into packages in future FreeNAS releases, please visit http://support.freenas.org/ to provide feedback. Please add feature requests tickets. If a feature you would like to see in FreeNAS already has a ticket please just subscribe to it add a small comment, even if it's a "++." It will help us better judge and meet community needs.

You can download FreeNAS from Source Forge and read all the release notes on our wiki.

20101028

Using devfs.conf as a porting aide

I've recently been given the task of moving some software from FreeBSD 4.x to FreeBSD 6.x on a consulting basis. This move was very simple and easy, except for one area: serial device names.

In the great tty-rewrite to make it MP safe that was done, there were a number of name changes that were unavoidable when making the tty layer more uniform between drivers. Unfortunately, sio was one of the drivers that had its names changed. This company used many multi-port expansion cards, so finding all the places where /dev/cuaaX was hard coded was difficult.

To validate the rest of the software, I created the following /etc/devfs.conf file to allow the old names to work while I hunted down all the places they were used.


# 4.x compat names on 6.x
link cuad0 cuaa0
link cuad0.init cuaia0
link cuad0.lock cuala0
link ttyd0.init ttyid0
link ttyd0.lock ttyld0


These blocks were repeated for each of the serial devices in the system (I wrote a quick script to generate them for all 12 devices). One thing to remember is that the 11th device is named "/dev/cuada" not "/dev/cuad10", so you need to print the unit number as hex.

You could easily extend this to FreeBSD 7 the names changed again when FreeBSD moved from sio to uart.


# 6.x names on 7.x system
link cuau0 cuad0
link cuau0.init cuad0.init
link cuau0.lock cuad0.lock
link ttyu0 ttyd0
link ttyu0.init ttyd0.init
link ttyu0.lock ttyd0.lock


again, it is a simple matter to look over the unit numbers necessary.

Note, this will only work for devices that are statically created at boot time. If you have a number of usb serial devices on a newer FreeBSD system that are replacing an older sio based FreeBSD 4.x system, you may need to use devfs.rules to accomplish this transition, which is beyond the scope of this article.

20101001

New FreeNAS alpha

After a few unforeseen delays, we have a new FreeNAS snapshot available over at source forge. As an experiment, we are distributing these snapshots using xz as well as bzip2 compressed images. It makes a big difference.

What's new?

First and foremost, we have a completely new GUI look and feel. We've imported dojango into the GUI to take advantage of Dojo JavaScript Toolkit. The flow of the interface is much nicer, it looks better, and we've added additional help to make it easier to use. We think you'll like this new GUI. We've made dozens of improvements over the past few weeks to the GUI. We hope you like the new location for enabling shares.

We've also added support for Apple's AFP protocol to the new GUI. You can now use the GUI to export CIFS, AFP and NFS shares (which we'll be calling Windows, Apple and Unix shares in the GUI). We've added back-end support for FTP as well. The major protocols are now all supported, although some media options are still unimplemented.

This image has a universal booting feature. The first image was difficult to use on some VM systems since they were exclusively SCSI disks (appearing as da0, rather than the ad0 that was hard-coded into the fstab). We've added support for using UFS filesystem labels to nanobsd, so we're now able to produce an image that you can put on any kind of disk that FreeBSD supports and have it boot, since it finds the partitions for /, etc by looking for a label on the filesystem rather than insisting on ad0s1a.

At the present time, we support only adding NEW volumes to the system. If you add a volume to the system, we will always initialize it. This means that you shouldn't (yet) attach old volumes to FreeNAS 8. We will try to correct this problem for the forthcoming FreeNAS 8 beta. While we've made every effort to make things reliable, we've not put this software through a complete QA cycle, so it should be used for testing purposes only.

20100929

PC-BSD install without a bootable DVD

Recently, I tried to get PC-BSD onto an older system. This system didn't support booting off of USB, nor did it support swapping in a DVD player for the CD player that was shipped with the system. The computer seemed to be fast enough to support PC-BSD. Since all I really wanted was something that could play some games that my 4-year-old wanted, I wasn't willing to spend a ton of money on a new computer just yet. Better to wait a year or two until we really needed something better.

PC-BSD only installing off a memory stick or off a DVD these days. I opted to go the DVD route because this computer didn't support booting off USB media as far as I could tell (I tried it on two machines: an old HP eVectra 933MHz box, and a slightly newer Dell Optiplex GX270).

The summary of this hack is 'Copy all the files from /boot on the ISO image onto a hard disk that has been made bootable and use a USB expansion box to store the real DVD'.

First, I needed to create a bootable hard disk. I put the hard disk that was going to be installed into the system info a USB expansion box and plugged it into my FreeBSD system. This gave me a disk as 'da0'. This disk had an old Windows installation on it. All commands are run as root. You are advised to triple check your typing, as transposed letters and such might have adverse effects.

Relabeling the Disk

Since I had an old windows install on the disk, I just needed to delete the old windows partition and create a FreeBSD one.
  1. gpart delete -i 1 da0
  2. gpart add -t \!165 da0
  3. gpart create -s bsd da0s1
  4. gpart add -t \!7 da0s1
Did the trick. Your milage may vary at this stage. I've also used "gpart delete -i X da0" and "gpart destroy da0" to totally wipe a GPT scheme off the disk in the past. If you do that, you'll also need "gpart create -s mbr da0" before proceeding to step 2 above. There's lots of other ways to skin this cat too involving dd, but since gpart has been added to the system, its so easy to use I prefer it for quick tasks like this so I don't have to remember "do I need to blank the front of the disk, or the end of the disk..."

Making the disk bootable

Next we need to make the disk bootable. This is a lot easier than it used to be in days of yore:
  1. gpart bootcode -b /boot/boot0 da0
  2. gpart bootcode -b /boot/boot da0s1
We have to make it bootable twice due to the multi-stage boot-loader that FreeBSD has (other systems are likely similar). "boot0" just prompts for which partition to boot (doing the first one by default). "boot" will then load /boot/loader to finish out the booting process and hand control over to FreeBSD's kernel.

Copying The Files

The pc-bsd installer for the DVD just loads a ram disk, and then runs off that. All the early stages of the boot loader need are contained in /boot. This includes the kernel, the third stage boot loader and various config files and scripts. So the next steps are to copy these files from the cd onto the bootable hard disk we just made. This assumes that the mdconfig command below prints "md0" for unit 0. If it prints anything else, you'll need to adjust accordingly. Also, if you are reading this in the future, you may need to change the PCBSD iso name.

  1. newfs /dev/da0s1a
  2. mount /dev/da0s1a /mnt
  3. mdconfig -f PCBSD8.1-x86-DVD.iso
  4. mount -t cd9660 /dev/md0 /cdrom
  5. mkdir /mnt/boot
  6. cd /cdrom/boot
  7. tar cf - . | (cd /mnt/boot; tar xvf -)
  8. cd /
  9. umount /mnt
  10. umount /cdrom
  11. mdconfig -d -u 0

Moving the disk

At this point, I had to unplug the USB expander from the first system, remove the hard drive and install it into my target box. I also grabbed my UBS DVD player and connected it to the box with a copy of the DVD I burned from the above file. I selected hard disk as the boot media in the bios and let the system boot. It booted off the hard disk, but then started looking for the proper cd device. Luckily for me, it found the DVD on cd1 instead of cd0 (which is what was built-in to the Dell I was booting off of). It then became a 'normal' PC-BSD installation, which is described in detail elsewhere.

Hopefully, people find these instructions useful. Since I only had one of these systems, I didn't create any kind of script to make it easier. Sorry.

[[ Updated to fix problem noted in the comments ]]

20100921

FreeNAS 8 -- Update

If you are following the commit messages to FreeNAS, you'll already know that FreeNAS 8 is shaping up nicely. If not, allow me to summarize some of the progress here.

In the past two weeks we've managed to break the gui completely, and put it back together. In the process, we've moved from a fairly static system to a more dynamic DOJO driven system that's much easier to use. It is less cluttered, while still providing escape hatches to the more complicated stuff. In addtion, we've written an installer (really, used the installer from PC-BSD, now part of FreeBSD-current). We've upgraded all the ports to FreeBSD 8.1-RELEASE (basically about 6 weeks newer ports). We'll need to do security updates before beta on some of these as well, so we've added the ability to patch the ports tree (which should also mean we'll retain much of the flexibility that the legacy FreeNAS system has wrt upgrades).

All of this is building to a new alpha snapshot. We're nearing the feature complete phase and want to get at least one more alpha out the door before we go to beta, most likely early next month. Watch this space for updates.

If you've been trying to follow the process at a source code basis, you may have run into a problem. While the build system does a good job at applying new patches to FreeBSD's src and ports tree, it doesn't do a very good job when the patch has been updated. Its unclear to me what the best way to manage this process is, since it can be hard to manage a new ports tree, new src and ports patches, as well as preserve the '-b' functionality of nanobsd which allows for fast builds after an initial build.

So, if you encounter problems updating your tree from an earlier snapshot, there's an easy work around. If you define 'force_update=1' in your environment, then you'll force the do_build.sh script to update your src and ports trees (it is needed if you have a June 24th ports tree from before the cut over). This will force csup to run, which 'fixes' all the files that have been patched. I've enhanced do_build.sh so that it will force all the patches to be reapplied when you do this. It is best to avoid the -n and -b flags to do_build.sh when doing this, since you really want a fresh build after the latest series of changes.

Later this week, we'll have another alpha snapshot ready. The last bit of GUI work should be done tomorrow (we need to add back the ability to control sharing/exporting of volumes which was lost in the great GUI reshuffle). We'll also need to test it to make sure the basics work and then we'll put binaries up to share. The installer may even be ready too, so that might also include ISO images you can boot and use to install the images into a CF.

Finally, we've reworked Olivier Cochard-Labbé's to nanobsd for device label support to be more flexible. As a result, they are now in both FreeNAS, as well as in FreeBSD. The practical upshot is that now a single image can boot off CF (where the root device is /dev/ad0s1a), a VirtualBox container (where it might be /dev/ada0s1a or /dev/ad0s1a) or a USB Stick/VMWare container (where it would be /dev/da0s1a). This should solve some difficulty people reported using VMWare in the first alpha, as well as provide a nice, flexible system to have a single image for all media types going forward. Briefly, we can label things within NanoBSD so they appear as /dev/ufs/FreeNASs1a so that the root filesystem can be found on any underlying media. If you're interested in the details of this, check out glabel and the -L option to tunefs and newfs.

As always, we welcome feedback. We'll have something in place soon to help collect and organize the feedback from the beta tests. I'll announce it after we go live.

20100919

My BSDTalk Interview

I just gave Will Backman over at BSDTalk an interview on FreeNAS 8, NanoBSD, ZFS and embedding FreeBSD. You can check it out at the BSDtalk blog. Hope you all enjoy.

Another FreeNAS Alpha snapshot is slated for early this week. Stay tuned. It will include a revamped user interface, local user support, FreeBSD 8.1-RELEASE ports and a few other goodies.

20100906

FreeNAS 8 -- First alpha snapshots

My blog has been somewhat quiet lately. I've been busy with other things lately.

The biggest of the other things is FreeNAS. iXsystems stepped up to the plate late last year when FreeNAS was going to become a Linux based platform.

The iXsystems engineering team has moderized FreeNAS in a number of ways. We wanted a platform that was more extensible than the current m0m0wall-based framework allowed. We wanted to create a platform that could be expandable by modules (possibly not even written by us). We wanted to make it easier to upgrade the base FreeBSD release, as well as leverage more base FreeBSD technology that has been integrated into the system since FreeNAS was originally developed.

We've migrated the build to be NanoBSD based. This allows us to leverage the embedded work that has gone into NanoBSD. It also allows us to push some of the features that are important to FreeNAS back into the base FreeBSD distribution. NanoBSD gives us the flexibility that we need. Since we're using the FreeBSD package system to add ports and packages, users will be able to add their own packages (we'll likely expand the basics to use the PBI's that PC-BSD produces for ease of installation). We're using the normal rc.d system, so upgrading is easier as well.

On the GUI side we've moved to using django. This is a python-based front-end to sqlite3 which is extensible and easy to use. While we've kept things rather plain so far, we plan on jazzing things up a bit now that we have the basics working fairly well. Since the GUI is based on django, we'll be able to allow packages to hook into the GUI to present a united interface to the user.

The GUI calls into a middleware layer that manages the services on the box. This middleware is responsible for generating updated config files, as well as starting, stopping and restarting daemons on the system. The same code generates the files at boot as well. Having all the configuration data in one database makes it easier to upgrade from release to release, since you don't have to merge your changes into the config files: the system takes care of that details.

If you'd like to read about the nuts and bolts about trying out the latest snapshot, you can check out my forum post on the topic over at the FreeNAS forums.

20100828

What is all the TBEMD stuff

I've been getting questions about what TBEMD means in my commits to FreeBSD head.

First, I'll tell you the name. TBE stands for TARGET_BIG_ENDIAN. For the MIPS and ARM ports, it is an environment variable that you have to set to build these targets for big endian (otherwise they default to little endian). MD is Must Die. A few years ago, there was an action movie whose title was more memorable than the file "Romeo Must Die." So I just stole the name for this branch.

So why must TARGET_BIG_ENDIAN die? It breaks things. For all the other platforms that FreeBSD supports, you just set TARGET and/or TARGET_ARCH to do cross builds. You know everything you need to know from the MACHINE and MACHINE_ARCH in the resulting image. In addition, the build system segregates things so you can build all the targets in one tree..But for mips and arm, you don't know what endian a binary is, the obj tree will collide if you try to build both little endian and big endian binaries at the same time. There's also other, more subtle issues. For example, TARGET_BIG_ENDIAN isn't set on big endian mips, so a native biuldworld tries to build little endian binaries (oops).

So, mips will be moving to mipsel (for little endian) and mipseb (for big endian). Arm will move to arm (for little endian) and armeb (for big endian). You could fill an entire email archive with all the possible other names and why they are better or worse than these names. History, however, trumps all those arguments: these are the names used elsewhere and we're just following convention.

Once tbemd is completely merged, you'll be able to build both endians of MIPS in the same object tree, for example, and all the other issues I've discovered. It also helps with new architectures as we move into powerpc64 (already merged) and mips64 (to be done after tbemd is collapsed). It will also mean we can have different packages for the different endians now.

20100814

The dangers of forgetting svn add

I spent a lot of time before the 8.1 release adding code to transparently map COMPAT_IA32 to COMPAT_FREEBSD32. I tested all kinds of different scenarios to make sure that it works, that it got error messages from old config programs, etc.

Today I got a complaint that COMPAT_IA32 doesn't work in 8.1-RELEASE. Linux module was failing to load properly. I thought it was really odd and that the folks complaining must be doing something wrong.

It turns out that I did something wrong. When I originally merged the work, I modified the options file, but didn't add the new options-compat file to stable/8 tree, so it didn't get merged into the releng/8.1 tree used to create 8.1. The result is that COMPAT_IA32 just fails silently in 8.1-RELEASE.

All that hard work ruined because I forgot to do a svn add... How disappointing.

20100530

silly vpn hack

I finally got frustrated by the inability of /etc/resolv.conf to do what I'd say in pseudo code:

if domain==example.com; then nameserver=1.2.3.4
else nameserver=4.3.2.1

since I need that when I'm on my VPN to example.com.

So, round one of the hack is to tell dhclient to use my local nameserver, and do it with named.

So, in /etc/dhclient.conf, I have:

interface "wlan0" {
prepend domain-name-servers 127.0.0.1;
}


and I have the following snippets in named.conf:

...
options {
...
forwarders {
4.3.2.1;
};
...
};
zone "example.com" IN {
type forward;
forwarders {
1.2.3.4;
};
};


The only problem I have yet to figure out is how to dynamically update the 4.3.2.1 in /etc/namedb/named.conf as I roam from network to network. There doesn't appear to be a hook in dhclient to say 'run this command when my IP address changes' or 'run this command when I get a new lease' or anything useful like that....

All this is with FreeBSD-current, but these techniques should work back to at least FreeBSD 6.x.

Finally, does anybody know a good way to quote code (as opposed to text) in blogger.com? By default, it seems, all leading whitespace is eaten, which make this post look ugly.

20100501

video on FreeBSD with skype

Hans Peter Selasky has been very busy adding support for web cams and other usb video devices. We tried a number of different cameras that we had laying around iX Systems the other day. All of them were recognized as valid video cameras. Some of them worked with pwcview and skype. Some of them had problems with the palettes, or would only work with some resolutions.

I was able to make a Skype call on my FreeBSD to another developer. Unfortunately, the distfile necessary for this isn't freely available. You have to download it from Skype. And it is no longer available from Skype. I got lucky and down loaded it a while ago, thinking I'd play with skype.

If you haven't had a chance to check it out, install the multimedia/webcamd. There's lots of devices that it works with.

Now, the interesting part. Hans Peter Selasky has implemented a user land driver for all of this. He implements a device driver in two parts. One piece in the kernel, which setups the shims to talk to webcamd, and the actual driver in webcamd. He uses the Linux drivers in webcamd. This separates the GPL drivers from Linux from the BSD kernel. So there's no issues with licenses. This is the same technique that's done in the Linux world to implement proprietary drivers and keep them separate from the Linux kernel. This opens the door for a wide array of devices. It is useful to think of this as something similar what Bill Paul did with NDIS and Windows drivers (except in two different address spaces rather than one).

20100126

Booting instructions for FreeBSD on Cavium Octeon

Here's a quick note on how to net boot the Cavium EBT3000 board running uboot. The Cavium kernel is still a work in progress as I restore all the fixes I made to an earlier version of this code that I was unable to release.

You'll need to break into the boot sequence for this board. Usually that's just hitting ^C before uboot starts to load the kernel.

Once you have a uboot prompt, similar to below, you'll be ready to start to fix the environment for netbooting.
U-Boot 1.1.1 (Development build) (Build time: Jan 26 2007 - 14:06:35)

EBT3000 board revision major:4, minor:0, serial #: xxxxxxxxx
OCTEON CN38XX-NSP revision: 1, Core clock: 500 MHz, DDR clock: 266 MHz (532 Mhz data rate)
DRAM: 2048 MB
Flash: 8 MB
IPD backpressure workaround verified, took 14 loops
Clearing DRAM........ done
BIST check passed.
Net: octeth0, octeth1, octeth2, octeth3
Bus 0 (CF Card): OK

ide 0: Model: SanDisk SDCFB-1024 Firm: Rev 0.00 Ser#: X0308 20050726142909
Type: Removable Hard Disk
Capacity: 977.4 MB = 0.9 GB (2001888 x 512)

Octeon ebt3800#


It couldn't be easier to setup for netbooting. You'll need to setup an tftp server. I had to install the FreeBSD port from net/freebsd-tftpd to get a working tftpd, since there appears to be some issues with the stock FreeBSD tftpd. Once I had that, I set different addresses like so:
set ipaddr 10.0.0.30
set netmask 255.255.255.0
set serverip 10.0.0.10
set gatewayip 10.0.0.1
set bootdelay 0
saveenv

This sets the board's address to 10.0.0.30/24. 10.0.0.1 is the router to the other networks. The tftp command will now use tftp from host 10.0.0.10 to get the named file. saveenv makes these setting permanent. I usually reboot at this point to make sure that the settings took.

Next, you'll need to know how to load a FreeBSD kernel. This is also fairly straight-forward, although finding the right addresses took a bit of guesswork. You are tftping the ELF kernel to a chunk of memory. The bootoctlinux command then takes that image and copies it to the right place and starts executing it. So you have to be sure whereever you load it doesn't clash with uboot's memory use or with where the kernel will ultimately reside.
tftp a800000 kernel.octean1-32
bootoctlinux a800000 numcores=1


As with any u-boot platform, it can often be useful to define macro commands. I did the following:
set fbsd 'tftp a800000 kernel.octeon1-32; bootoctlinux a800000 numcores=1'
so that I don't have to keep typing it over and over. I can just type
run fbsd
to run my next test.

The Cavium port is in a state of flux right now. The latest status as I am preparing this to be published is that there's an interrupt problem that's causing the serial port to be non-responsive after going to multi-user (eg, the login: prompt) and also the network stops responding. Also, I have to comment out the enableintr() call in mips_vector_init around line 365 of sys/mips/mips/machdep.c. I'm trying to hammer these issues out, and I think they are related. Earlier versions of the code worked with earlier versions of FreeBSD, so I'm sure this is just a shift in interfaces that needs to be accounted for.

Here's the latest slightly trimmed log from a boot:


U-Boot 1.1.1 (Development build) (Build time: Jan 26 2007 - 14:06:35)

EBT3000 board revision major:4, minor:0, serial #: xxxxxxxxx
OCTEON CN38XX-NSP revision: 1, Core clock: 500 MHz, DDR clock: 266 MHz (532 Mhz data rate)
DRAM: 2048 MB
Flash: 8 MB
IPD backpressure workaround verified, took 32 loops
Clearing DRAM........ done
BIST check passed.
Net: octeth0, octeth1, octeth2, octeth3
Bus 0 (CF Card): OK

ide 0: Model: 512MB CKS Firm: 2N3-0925 Ser#: 2435E7C34A52930007
Type: Removable Hard Disk
Capacity: 491.6 MB = 0.4 GB (1006992 x 512)
Octeon ebt3000# print
bootdelay=0
baudrate=115200
download_baudrate=115200
ls=fatls ide 0
nuke_env=protect off BFBFE000 BFBFffff; erase BFBFE000 BFBFffff
autoload=n
ipaddr=10.0.0.31
gatewayip=10.0.0.1
netmask=255.255.255.0
serverip=10.0.0.16
fbsd=tftp a800000 kernel.octeon1-32; bootoctlinux a800000 numcores=1
fbsd_cf=fatload ide 0 a800000 kernel.imp; bootoctlinux a800000 numcores=1
coremask_override=0xffff
numcores=16
stdin=serial
stdout=serial
stderr=serial

Environment size: 1274/8188 bytes
Octeon ebt3000# run fbsd
octeth0: Down 10Mbs Half duplex, (port 16)
Using octeth0 device
TFTP from server 10.0.0.16; our IP address is 10.0.0.31
Filename 'kernel.octeon1-32'.
Load address: 0xa800000
Loading: octeth0: Up 100Mbs Half duplex, (port 16)
########################
done
Bytes transferred = 3370489 (336df9 hex)
argv[2]: numcores=1
ELF file is 32 bit
Skipping non LOAD program header (type 0x6)
Skipping non LOAD program header (type 0x3)
Skipping non LOAD program header (type 0x70000000)
Allocated memory for ELF segment: addr: 0x1000000, size 0x295a60
Loading .text @ 0x81000000 (2064384 bytes)
Loading .MIPS.stubs @ 0x811f8000 (16 bytes)
Loading .rodata @ 0x811fa000 (33248 bytes)
Loading .reginfo @ 0x812021e0 (24 bytes)
Loading .rodata.str1.4 @ 0x812021f8 (189300 bytes)
Loading set_sysctl_set @ 0x8123056c (3496 bytes)
Loading set_sysinit_set @ 0x81231314 (1684 bytes)
Loading set_sysuninit_set @ 0x812319a8 (952 bytes)
Loading .interp @ 0x81231d60 (13 bytes)
Loading .dynsym @ 0x81231d70 (78320 bytes)
Loading .dynstr @ 0x81244f60 (72163 bytes)
Loading .hash @ 0x81256944 (35984 bytes)
Loading set_kdb_dbbe_set @ 0x8125f5d4 (8 bytes)
Loading set_modmetadata_set @ 0x8125f5dc (288 bytes)
Loading set_cons_set @ 0x8125f6fc (8 bytes)
Loading .data @ 0x8125f704 (116476 bytes)
Loading set_pcpu @ 0x8127be00 (3136 bytes)
Loading .got @ 0x8127ca40 (5296 bytes)
Loading .rld_map @ 0x8127def0 (4 bytes)
Loading .sdata @ 0x8127def4 (12 bytes)
Clearing .bss @ 0x8127df00 (97120 bytes)
## Loading Linux kernel with entry point: 0x81000000 ...
Bootloader: Done loading app on coremask: 0x1
Boot Descriptor Ver: 6 -> 1/2 CPU clock: 500MHz
Dram: 2048 MB Board Type: 2 Revision: 4/0
Octeon Chip: 0 Rev 0/0 Mac Address 00.0F.B7.10.1B.32 (14)
octeon_dram == 80000000
reduced to ram: 2048 MBReal memory bytes is 7ffff000
phys_avail[0] = 1296000 phys_avail[1] = fffffff
realmem_bytes is now at 5ffff000
Next block of memory goes from 20000000 to 7ffff000

Total DRAM Size 0x80000000
Bank 0 = 0x 1296000 -> 0x FFFFFFF
Bank 1 = 0x20000000 -> 0x7FFFF000

physmem: 0x6ed69Cache info:
picache_stride = 4096
picache_loopcount = 8
pdcache_stride = 128
pdcache_loopcount = 64
cpu0: Cavium processor v1.0
MMU: Standard TLB, 32 entries
L1 i-cache: 4 ways of 64 sets, 128 bytes per line
L1 d-cache: 64 ways of 1 sets, 128 bytes per line
Config1=0xbe3303da
Config3=0x80
Physical memory chunk(s):
0x1296000 - 0xfffefff, 248942592 bytes (60777 pages)
0x20000000 - 0x7fffefff, 1610608640 bytes (393215 pages)
Maxmem is 0x7ffff000
KDB: debugger backends: ddb
KDB: current backend: ddb
hz=100 cyl_per_hz:250000 cyl_per_usec:250 freq:250000000 cyl_per_hz:2500000 cyl_per_sec:250000000
Copyright (c) 1992-2010 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 9.0-CURRENT #141 r202986:202997M: Mon Jan 25 20:07:07 MST 2010
imp@paco-paco.bsdimp.com:/tmp/imp/be-obj/mips/pe/imp/svn/head/sys/OCTEON1-32 mips
real memory = 1859555328 (1815972K bytes)
Physical memory chunk(s):
0x013ab000 - 0x0fffefff, 247808000 bytes (60500 pages)
0x20000000 - 0x7d830fff, 1568870400 bytes (383025 pages)
avail memory = 1813180416 (1729MB)
mem:
nfslock: pseudo-device
null:
nexus0:
Compact flash found in bootbus region 3 (8 bit).
rgmii0: on nexus0
rgmx0: Ethernet address: 00:0f:b7:10:1b:32
rgmx0: type (null), full duplex
rgmx1: Ethernet address: 00:0f:b7:10:1b:33
rgmx1: type (null), full duplex
rgmx2: Ethernet address: 00:0f:b7:10:1b:34
rgmx2: type (null), full duplex
rgmx3: Ethernet address: 00:0f:b7:10:1b:35
rgmx3: type (null), full duplex
rgmii0: [FILTER]
cf0: on nexus0
clock0: on nexus0
clock0: [FILTER]
obio0 at mem 0x1 flags 0x1 on nexus0
uart1: on obio0
uart1: [FILTER]
uart1: fast interrupt
uart1: console (115200,n,8,1)
uart0: on obio0
uart0: [FILTER]
uart0: fast interrupt
uart0: console (115200,n,8,1)
Device configuration finished.
Reducing kern.maxvnodes 117045 -> 100000
Timecounter "MIPS32" frequency 250000000 Hz quality 800
Timecounters tick every 10.000 msec
GEOM: cf0: partition 2 does not start on a track boundary.
GEOM: cf0: partition 2 does not end on a track boundary.
GEOM: cf0: partition 1 does not start on a track boundary.
GEOM: cf0: partition 1 does not end on a track boundary.
GEOM: cf0s2: geometry does not match label (64h,32s != 16h,63s).
Trying to mount root from ufs:cf0s2a
WARNING: / was not properly dismounted
warning: no time-of-day clock registered, system time will not be set accurately
start_init: trying /sbin/init
Setting hostuuid: 1c99760e-1dd2-11b2-bd6a-00156dc12838.
Setting hostid: 0xb0f278c1.
No suitable dump device was found.
Entropy harvesting:.
Starting file system checks:
t_delta 16.010fac783006c1a6 too long
/dev/cf0s2a: 11100 files, 256973 used, 150946 free (426 frags, 18815 blocks, 0.1% fragmentation)
Mounting local file systems:.
t_delta 15.fece5003dd62224a too short
Setting hostname: ebt3000.
SIOCSTIFFLAGS UP/Running
Starting Network: lo0 rgmx0 rgmx1 rgmx2 rgmx3.
lo0: flags=8049 metric 0 mtu 16384
options=3
inet 127.0.0.1 netmask 0xff000000
rgmx0: flags=8843 metric 0 mtu 1500
options=3
ether 00:0f:b7:10:1b:32
inet 10.0.0.31 netmask 0xffffff00 broadcast 10.0.0.255
media: Ethernet autoselect
rgmx1: flags=8802 metric 0 mtu 1500
options=3
ether 00:0f:b7:10:1b:33
media: Ethernet autoselect
rgmx2: flags=8802 metric 0 mtu 1500
options=3
ether 00:0f:b7:10:1b:34
media: Ethernet autoselect
rgmx3: flags=8802 metric 0 mtu 1500
options=3
ether 00:0f:b7:10:1b:35
media: Ethernet autoselect
Starting devd.
Creating and/or trimming log files.
Starting syslogd.
/etc/rc: WARNING: Dump device does not exist. Savecore not run.
ELF ldconfig path: /lib /usr/lib /usr/lib/compat
Clearing /tmp (X related).
Updating motd:.
Starting cron.
Starting inetd.
Starting background file system checks in 60 seconds.

Tue Jan 26 02:07:16 UTC 2010

FreeBSD/mips (ebt3000) (ttyu0)

login:

20100115

DLINK DIR-615 REV C1 Redux

After hitting a dry hole with my DIR-615 REV A1, I thought I'd try the DIR-615 REV C1 that I have. It has an Atherose AR9130 in it. This is very similar to the AR7130 that the RouterStation I have running, and I thought it would be a simple matter to use uboot to netboot this code.

Again, I was mistaken. There's no way to break into the boot sequence for this device. The best I can hope for is to create a compressed image that's < 1MB and blow it into the FLASH partition for the kernel under linux. That would work out OK, if I had known good image to start from. Alas, I don't. And there doesn't appear to be an accessible JTAG header that I can use to write a new u-boot. Linux seems to protect u-boot from being overwritten as well.

But the biggest issue of all is that the FLASH is only 4MB in size. It would take some doing to get everything shrunk down that small. The DIR-615 REV A1 at least had 8MB of FLASH, which is doable. Maybe I'll perfect the kernel for the DIR-615 REV A1 on the Marvell eval board I have. Looking at the Linux sources, the deltas between these kernels are small and inconsequential for bootstrapping purposes. Hmmm, the Linux kernel just has support for the DNS-323, now that I look closely, but the required bits of hacking after I have a known good kernel doesn't seem huge. Plus, if I could get one good kernel on the box, then I could put a better uboot on there which would support the network for netbooting...

If I ever make good images for these boards, I'll be sure to post pointers to them here.

DLINK DIR-615 REV A redux

Yesterday I burned a couple of hours playing with the DIR-615 REV A1 that I have had for ages. FreeBSD runs on the Marvell Orion SoC that's inside it now and I thought I'd netboot the box and try to put together an image that can replace my firewall since this little box uses less power and my firewall doesn't need to do *THAT* much.

Unfortunately, it appears as if the network was purposely crippled on this box. Not disabled entirely, but crippled to not work. Sometimes you can get packets out, but generally there's a huge packet loss rate that makes pinging impossible, let alone netbooting.

Talking to other folks that have worked in this area, it appears that this was a deliberate attempt to discourage others from running alternative operating systems on the box.

Since the box will still boot to Linux, there's hope that one can bootstrap the FreeBSD installation from there. When I get some time again, I'll be pursuing that avenue. Maybe I can find the JTAG header for this board and reflash uboot that way, since debugging a new kernel can be difficult to get right in one shot on hardware the kernel has never run on before...

I had planned on publishing instructions for netbooting the thing, but alas, it appears that isn't possible.

20100113

Post-mortum on projects/mips branch

Greetings to one and all. As you have read elsewhere, I recently merged all the changes from the projects/mips branch onto head. In other reports, I've made cryptic reference to the branch being damaged. I thought I'd go through all the problems we encountered running this development effort on the projects/mips branch.

First, we created the branch in the normal way:
svn cp svn+ssh://svn.freebsd.org/base/head svn+ssh://svn.freebsd.org/base/projects/mips

and then started committing to it. So far so good.

Then it came time to merge in changes from head. Here is where we made our first mistake. We merged just the kernel changes, and not the entire tree. The next time we merged the entire tree. The effect of this sequence meant that the changes between the creation and the first merge in the rest of the tree (outside of src/sys) were lost. I don't know if this is the result of a buggy svn client, or if they are a fundamental flaw in svn. So when it came time to collapse the results back into head, we couldn't just do a reverse integration, or even a more conventional merge.

Next, we pulled in pieces of the projects/mips tree into head, either by hand or with the svn merge command. Doing both was a mistake, I think. Although svn coped with later merged from head into projects/mips fairly well, occasionally we'd have issues to sort out.

So, when it came time to merge everything back into head, we were left with a number of difficult choices. We opted to copy the new files/directories in the repo (to preserve the history) and merge patches by hand with svn log entries. The latter went really well. There were no problems with it apart from the odd fuzz and .rej file to sort out (no different than a normal merge). The former, however, causes a lot of problems.

First, it created svn:mergeinfo entries on the files I copied over. This conflicts with the project's "merge everything from sys" edict. This happened because I did the copy in the server rather than the client (which was an attempt to preserve history). It was a simple matter to delete these entries when it was brought to my attention.

Next, somehow we created the files on the branch without the required svn:keywords, svn:eol-style and svn:mime-type properties. This caused problems when we went to commit changes to these files. The precommit complained, at this point, that the files lacked svn:keywords, and we had to add $FreeBSD$ by hand (since the copy didn't complaint that they were lacking). Also, I didn't discover these problems on my own. Other sharp-eyed individuals saw the problems and reported them to me.

Finally, since I did the copies on the server, there was no way to batch them. When I copied a directory, I got the whole directory. When I copied a file, I got the file. Each one generated a commit message.

I'm unsure what other damage was lurking in the projects/mips tree, but the lack of properties, the inability to easily use merge info and the missing commits lead me to the conclusion that it was easier to abandon the branch and create a new branch if needed in the future.

The mips team plans to create more branches, that are more for special purposes, that will be shorter lived in the future. We have no further plans to have one monolithic mips branch that acts as a staging ground for commits into head.

20100112

Hack to allow automatic wired/wireless failover with lagg on FreeBSD

For years I've had a love/hate relationship with my wireless card. On the one hand, it allows me to roam. On the other I like being able to plug into the wired Ethernet when I'm sitting at my desk since I get better throughput and lower latency. So for years, I just loaded and unloaded kernel modules to make dhclient (and/or wpa_supplicant) do its thing. This changed the IP address of my box, which messed up NFS mounts until I went back to the old way.

Recently, Josh Paetzel came up with a way to use lagg to do automatic failover. Inspired by the lagg man page, he created a number of rc.conf lines that would do this automatically. Xin Li and I refined the trick a bit. To completely integrate this into FreeBSD, I suppose that the rc.d scripts would need to be enhanced to automatically generate these lines when appropriate. However, the hack is so easy to do now, I'm going to share it with you here. Xin Li is writing up a longer description of how to set this up for the handbook. Let's say you have a ath0 wireless interface, and a re0 wired interface, just add the following to your /etc/rc.conf file:

  • ifconfig_re0="up"

  • ifconfig_ath0=`ifconfig re0 ether`

  • ifconfig_ath0="ether ${ifconfig_ath0##*ether }"

  • wlans_ath0="wlan0"

  • ifconfig_wlan0="WPA"

  • cloned_interfaces="lagg0"

  • ifconfig_lagg0="laggproto failover laggport re0 laggport wlan0 DHCP"



This bit of code brings up re0, programs ath0 with the ethernet MAC address of re0 (so your MAC doesn't change when you switch over), creates a wlan0 interface from ath0, causes lagg0 to be created and configured to do the fail over.

Hope this tip is useful...

Revision at Wed Jan 13 16:00:00 UTC 2010:

Note: "ifconfig re0 ether" doesn't work in versions prior to 8.0. The following should fix it, but I don't have a system to test it on:
  • ifconfig_ath0=`ifconfig re0 ether`

  • ifconfig_ath0="${ifconfig_ath0##*ether}"

  • ifconfig_ath0="ether ${ifconfig_ath0%%inet*}"

  • This sequence avoids using grep, awk and/or sed to accomplish this (and thus touch /usr too early for systems where / and /usr are on different partitions).

    Also corrected the bwi0 reference in the feedback...

    Revision at Mon Jan 18 23:00:00 UTC 2010:
    Corrected () vs {} confusion in the above...

    FreeBSD/mips updated

    The base/projects/mips branch has been merged into base/head. The merge is complete and the sanity tests have passed. The code has booted on both a Ubiquiti RouterStation (big endian) as well as in gxemul (little endian).

    The branch lived for one year, minus a day, and accumulated much work:
    • A new port to the Atheros AR71xx series of processors. This port supports the RouterStation and RouterStation PRO boards from Ubiquiti. Other boards should work with minimal tweaking. This port should be considered as nearing production quality, and has been used extensively by the developers. The primary author of this port is Oleksandr Tymoshenko (gonzo@freebsd.org).

    • A new port to the sibyte BCM1250 SoC on the BCM91250 evaluation board (aka SWARM). This port is reported to be stable, but this hardware is a little old and not widely available. The primary author of this port is Neel Natu (neel@freebsd.org). Only one core is presently supported.

    • A port, donated by Cavium, to their Octeon and Octeon plus series of SoC (CN3xxx and CN5xxx). This code is preliminary, supporting only a single core right now. It has been lightly tested on the CN3860 evaluation board only in 32-bit mode. Warner Losh (imp@freebsd.org) has been driving the efforts to get this code into the tree.

    • A port, donated by RMI, to their XLR series of SoCs. This port is single core only as well. The code reaches multi-user but should be considered beta quality for the moment. Randal Stewart (rrs@freebsd.org) has been driving the efforts to integrate this into the tree.

    • Preliminary support for building a mips64 kernel from this source base. More work is needed here, but at least two kernels successfully build in 64-bit mode (OCTEON1 and MALTA64).

    • Very early support for N32 and N64 ABIs

    • Support for booting compressed kernels has been added (gonzo@).

    • Improved support for debugging

    • Improved busdma and bus_space support

    • Many bug fixes

    • More types of MIPS cores are recognized

    • Expanded cache handling for newer processors

    • Beginning of a port to the alchemy au1XXX cpus is present but experimental.

    • Work on SMP is underway to support multicore processors like the sibyte, Octeon and XLR processors.



    I'm sure there are minor items I've forgotten. If so, please forgive any omission on my part...

    The branch had been updated incorrectly several times over the past year, and the damage was too much to repair. We've retired the branch and will do further mips development in "head" for the time being. If you have a checked out tree, the suggested way to update the projects/mips tree you have is to do a "svn switch svn://svn.freebsd.org/base/head" in that tree.

    I'd like to thank everybody that has contributed time, code or hardware to make FreeBSD/mips better.

    We are still investigating how feasible merging all this work into stable/8 will be, as it represents a huge leap forward in code stability and quality.

    As development proceeds, I'll keep posting updates. In addition, I hope to have some mini "how-to" wiki pages done for people that want to try it out.

    20091105

    Some TiVo hacking

    Recently, I started hacking a TiVo HR10-250 that I've had for a million years unhacked.

    Back when I first got it, there were dozens of threads of hundreds of messages in about 10 different forums you needed to read in order to hack the goofy thing. Everybody did their own thing, it was manual and a big pain.

    Then came zipper (you can find all the details out at this link). It makes it very easy to hack the TiVos in general. However, there was just one problem. The ISO authoring tools it used were windows-based. Since I don't generally run on a Windows machine, this was a problem for me. So I tried to do the steps from the batch file by hand, and it didn't work out so well.

    So I rewrote the batch file in a unix script running on FreeBSD. FreeBSD's iso extraction feature of tar made this process hassle free. I can build a new ISO image from an old one using only one port (mkisofs) and no privs are needed at any step. I thought about trying to teach tar how to create an iso image, but since mkisofs does such a good job, and there are *SO* many knobs and dials that need to be implemented to do that right, I just let mkisofs do its thing. I just can't get over how easy FreeBSD's tar made it to break apart the old bootable cd that does the hacking to add the zipper files. Kudos!

    I've uploaded the script to the TiVo Community Forum thread about zipper if you are interested in looking into it.

    20091104

    T-Mobile and iPhone 3.1.2 firmware update issue

    Recently, I used PwnageTool on my mac to update my 2G iPhone from 2.2.1 to 3.1.2. I've been using T-Mobile since day one with my iPhone without hassle. Well, except for the upgrade hassles that I have from time to time. Once I unlocked the SIM, I was able to use the SIM from my T-Mobile DASH in the phone.

    When I upgraded this time, however, there was a problem. My data connections stopped working. Since 3.1.2 was otherwise a nice upgrade for me, I went looking for the problem. It turns out that the bundled carrier files that describe what you can and can't do with the iPhone basically said no data.

    Carrier files that are correct for T-Mobile, and the data plan I have, can be found iPhone-Dev.ca under the IPCC section of the web page. Instructions for loading the IPCC file were there as well. For T-Mobile, you'll need to call T-Mobile to find the right APN to use. For my plan it turned out to be wap-apn. Your milage may vary, but worst case would involve trying all 4 of the files.

    While not a programming hack, this should come in handy for anybody that's in a similar situation. Alas, I have no experience with the 3G or 3GS phones, and problems with the upgrades for those phones seem to be more widely covered (and blogged about).

    20090514

    Broadcom BCM43xx support (bwi) committed

    The BCM43xx driver from DragonFlyBSD has been ported to FreeBSD. Andrew Thomas and others have done the port. I've pushed it into the tree, and plan on fixing the one or two quirks with my card.

    The driver is far from perfect. 802.11a isn't support. Some older BCM4306 cards don't support channels 1, 2 or 3. It is rumored not to work at all for some people.

    The driver was written by Sepherosa Ziehau for DragonFlyBSD. He used the specs available at http://bcm-specs.sipsolutions.net/Specification to write the driver. The driver is written against the v3 firmware. The v4 firmware is needed for support of newer cards, and many people have made noise about porting to that, but nobody has emerged yet to do that work.

    The driver will be in FreeBSD 8.0. A back port of the driver to 7.x is difficult because it relies on all the new VAP work that Sam Leffler has done that is not in 7.x (although backports exist for 7.x, they won't be committed to the FreeBSD tree because it breaks binary compatibility).

    You need the net/bwi-firmware-kmod port installed for the firmware. Although the binary .o file that the firmware is extracted from is apparently easy to distribute, distributing derived works of that .o file is not. So, there's a port to download, extract the firmware and make a kld for the driver to access.

    A man page will be committed soon.

    20090505

    Belkin F6D4230 "Enhanced Wireless Router"

    Just got the Belkin Enhance Wireless Router F6D4230-4. Looks like it has a ralink RT3052 or RT3050 under the hood. This is a MIPS24KEc based SoC, with a full Linux GPL tarball available from Belkin's web site.

    I haven't had a chance to open the box yet to see what else is inside, and this is inferred entirely from the Linux config file that was in the GPL compliance package.

    Not sure what I'm going to do with this box...

    20090423

    ExpressCard

    Now that I've managed to knock down the number of bugs in NEWCARD to a more reasonable level, I've started looking at ExpressCard again.

    As you may know, FreeBSD supports ExpressCard right now for usb devices. They all work, and there's no additional work needed here, except maybe to make more drivers. In fact, I recently purchased an ExpressCard to CardBus adapter (one that lets me plug in an expressCard into a CardBus slot) and it worked with all the usb-based ExpressCards that I have laying around with no changes.

    The problem with ExpressCard for PCIe-based devices is one of resource allocation. If the BIOS allocates the resource, then the ExpressCard works without hot-plug. If the BIOS doesn't, then we can see the device with pciconf -l, as well as probe the device. However, since there's no resources setup for the PCI bridge, attempts for the driver to allocate them fail. There's also some bus numbering issues as well.

    I've started to attack the resource problem. I'll keep people posted

    20090421

    Update my old CardStatus page...

    If anybody still cares about 16-bit PC Cards and 32-bit CardBus cards still, I've updated the latest testing I've done.

    You can find it here. I think it does more to show what a big pack-rat I am, but maybe someone will find it useful. It shows I'm down to one or two ed cards that aren't working for me yet...

    20090413

    3Com 3C1 works

    Years ago, I bought a 3Com 3C1 CF card. This card was an early attempt by 3Com to minimize the power usage of the traditional 3C589 line of cards. These cards were important for the early palm-sized PDAs that were on the market. Through a number of different connections, I was able to get documentation on the 3c1. At the time I got it, I barely understood network drivers or even how the hardware worked. The documentation I got from 3com had pages for the flow charts for transmit and ISR, but the flowcharts weren't actually included on those pages. My connections couldn't get a better copy of the documentation, always saying it was coming soon.... The descriptions of the commands had some vague hints, but I never could make them connect. This was around 1999 or so.

    Over the years, I kept trying to make this card work on FreeBSD. I considered it unfinished business from my past and I kept trying to find time to work on it. I never could find the time, or if I had the time my brain was burned out from the deliverables I had to produce for work. Over the years I've acquired all the cards that I could find in the 3c5xx line and made them work, but never got the 3c1 working.

    Recently I stumbled across the 3c1 documentation and had a few minutes to read it. It was a nice change of pace from all the other stuff I'd been working on lately. After reading through it, I realized that there were a few key items that I'd not properly implemented before. There was a cryptic new command to turn on and off the TX PLL. So I had 30 minutes the other night and started reading the document again.

    In the interim between when I started looking at the 3c1 documentation and now I did a lot of work in the high precision time and frequency world. This world is all about PLLs and controlling the oscillators/clocks to an insanely high degree of precision. So this clicked in my brain "Hmm, TX PLL sounds like it controls the clock used to do the transmission." So everywhere we enabled TX in the driver, I added a call to turn on TX PLL. This got me started: dhclient worked! I was able to transmit packets. This was the first. However, it stopped working after a while. So I searched through the 3c1 docs. There was nothing about PLL enable and disable, except for the documentation of the command. It appears there's an automatic timeout in the hardware which was turning off the PLL. So, an additional enabling of the PLL in start did the trick. I only enabled the PLL when we're not actively transmitting (which means we were idle for some unknown period of time). I could refine it further if I knew what the timeout of the PLL (which isn't documented), but there appears to be no ill effects doing it all the time the TX unit has been idle.

    Ah, one more piece of unfinished business from the past is now complete. I can move on to other more interesting things...

    20090402

    More PC Card enhancements

    Every few months/years I take all the cards that I have in my collection and start to run through them testing to see what's working in FreeBSD and what's broken. Over the past year or two I've neglected this task as I've been involved in other things. After my last trip to Akihabara, I've been playing with this stuff, so I thought I'd pull out the cards again. However, for the moment, I'm restricting things to the cards supported by the ed driver.

    I've already blogged about the AX88x90 enhancements. The only additional enhancement is that I've eliminated some code that duplicates reading the NIC from what is just memory. I'll be committing that soon.

    I've finally implemented the workaround for fullduplex disabling SQE in the DL10019 parts. This gives slightly better performance on the parts that are affected, but I'm having trouble measuring it. I'm not sure that it is worth the hassle.

    I've also made a number of cards work by tweaking the MII initialization. I think I have a good way to kick the PHYs that are on these cards to get them working (this has helped to get three cards going).

    I'm approaching 100% of the ne-2000ish cards working. I'll do a final cleanup of my patches and try to get them into the tree. It is time to move on to the CardBus cards. Most of them appear to work, once certain resource allocation issues are addressed. At the very least I need to test them all to see how they work. I may skip this and move directly and address the resource issues there.

    20090330

    AX88x90 updates

    After focusing so much time on that old Toshiba card, I thought I'd see if I could get something more modern working as well. I've had one card in my bag knocking around in my bag based on the AX88790 chip. This is the corega FEther II-PXD. I saw it on sale in Akihabara when I was there a few weeks ago, and this card came from Akihabara a few years ago from a friend in Japan. So I thought I'd try it out.

    Well, at first it didn't work too well. The MII code was finding gobs of PHYs that were phantoms. This in turned caused bad things to happen when dhclient(8) was run.

    There turned out to be three root causes. First, the mii bit-bang code was wrong for reads, yielding bad register reads. Second, the AX88790 has an odd quirk for talking to its internal PHY, so more code was needed to cope with that. Third, the reset code for the NE2000 was also causing problems, so I rewrote it to be AX88x90 reset code. Finally, the internal phy for the AX88790 has a few quirks in silicon that need software workarounds.

    Once I'd corrected these problems, the card started working again. Since most of this data is readily available on the net (the asix web site has datasheets for these parts), I'll skip over all the blow-by-blow details. I hopefully had enough comments in the code for people to follow along, as well as the datasheet should make what I've done easy to see.

    Now, the arduous task of testing all the AX88x90 cards in my collections... The target card now works correctly, and I believe all of the ones in my collection will work too. Maybe I'll get to the point were all my ed-based PC Cards in my collection will work (except for the Mitsubushi B8895 which I've given up on, and the ones I don't have proper dongles for).

    20090327

    Toshiba LANCT00A PC Card

    When I was in Akihabara last, I got a lot of PC Cards from the junk vendors for 100 Yen. One of these cards was the Toshiba LANCT00A. This card didn't probe when I first got it. FreeBSD didn't support it. This was a challenge.

    As long-time reads of this blog may know, I sometimes go out of my way to hack on really oddball hardware that somehow I get it into my head needs to work. Never mind that I have a dozen other projects cooking that is more relevant to FreeBSD and its user base. Never mind that some of this hardware was obsolete when I started hacking on FreeBSD's PC Card layer. The cool thing is that I can find just enough documentation to be interesting on these cards.

    This Toshiba card was like that. Google searches for information about it turned up a half dozen posts to different FreeBSD and Linux mailing lists asking about it, plus some speculation about what's in the card. One brave soul even took his card apart and reported it had a NS DP83902 under the hood. However, nobody that I can find ever got this card working under FreeBSD or Linux. Checks of the current Linux kernel was no help. Checks of OpenBSD and NetBSD also yielded no results. There was a windows driver available (actually an NDIS driver of unknown version).

    So I was printing out random values for this card. At one time the FreeBSD PC Card probe routine for ed tried to probe WD80x3 cards as well as NE2000 cards. I removed this about 4 years ago after failing to find any cards that needed this, used it, etc. However, this card is almost a WD80x3 clone. I was printing the board type in the attach routine, trying to track down why attach was failing. I saw that it was 20 decimal or 0x14. A quick scan of the if_edreg.h file showed this was one of the Toshiba cards. The comments said it was a PCETC board. I immediately thought "Hmmm, isn't this a Toshiba card?" and then wondered if the 'C' in LANCT00A meant it was the same silicon revision as the 'C' in the PCETC. So I hacked up a quick little test into the if_ed_pccard probe routine.

    It recognized it the card when I did that! Success. Well, almost. There was a snag. The memory allocated for this card was at 0x88000000. This didn't pass through the sanity test in the driver designed for ISA cards, so it didn't work. A little more hacking and I was getting a sane MAC address and the card was attaching. It dhcped its address w/o incident.

    However, all is not right in mudville. As soon as I started using TCP, I started getting sbdrop panics. It looks like the packets that the WD80x3 code is pumping out aren't quite rightly aligned, or something (I have never had a sbdrop panic, so I'll have to investigate what that means when I have some time). This isn't too terribly surprising, since I haven't tested the ISA cards in years. Maybe something broke for the memory copyout path, but not for the PIO copyout path. I'll have to track that down another night.

    [[ UPDATE: It looks like it was the copyin path. There was a bug in it that caused 2x too many bytes to be read into memory, causing the corruption. So now it works well enough for me to update this post and commit the change. ]]

    Now, what does this gain FreeBSD? Not much, in the grander scheme of things. I'd be surprised if any of my readers actually had one of these cards and started using it as a result of my work. However, it was a relaxing hour or two of my life. Given my current job stress level, this has great value to me. Also, I think this is one of the first PC Cards to work with both I/O and Memory windows mapped at the same time from the CFE entry. While there are some other cards that manually allocate memory ranges, I don't think any of them have it in their CIS.

    Postscript

    Well, while I was doing research for this blog entry, I stumbled accross http://linux.toshiba-dme.co.jp/linux/eng/download.htm which has a tos_cs for download. There's a lot of voodoo magic in that driver that I'll have to investigate. This driver is 1000 lines long, and was for Linux 2.0.35. It was never integrated into Linux, so I'd stand by my statement that Linux doesn't support it. Just for kicks I tried building it under 2.6.29, and it didn't compile anymore.

    My changes to the ed driver in FreeBSD are more like 20-25 lines of code. There's magic kick of a magic offset in shared memory that isn't present in FreeBSD's ed driver today. I'll keep that in mind in case I have the card wedge on me under load or something.

    20090325

    Dumpster diving for PC Cards at Akihabara Junk Shops

    When I was in Japan two weeks ago, I took a trip to Akihabara and found a few junk shops. Well, these places are just second hand stores for used computer hardware and software. There is quite the range of shops. Some are nice, neat, well lit and have plenty of room to move about. Others aren't quite so nice and are very cramped. The further you get away from the street level and from the main streets, the less polished these stores are. The harder it is for a non-Japanese speaker like myself finds it to do business. This was my first trip to Akihabara that I didn't have Japanese speakers to help me out, so I didn't get too far away from the beaten path. I managed to find about 20 PC Cards at these shops, and spent only 2500 yen for them.

    First, the cards that worked. The CyQ've ELA-010 and NEC PC-9801N-J12 both worked with the ed driver without changes to the drivers. The TDK LAC-CD02x worked with the fe driver, again without changes. In a way, these were the disappointing cards in the lot. While I didn't have examples of them in my collection, I also didn't expand FreeBSD's support for PC Cards at all.

    I was able to modify the fe driver to support two additional cards that I found. One was the Hitachi HT-4840-11. I had to update the fe driver to select an alternative CFE. What's a CFE? It is the Configuration Function Entry in the CIS. These nodes in the CIS describe the resources that the card will use, as well as control different ways the hardware interacts with the system. The PC Card infrastructure usually selects the proper CFE based on the available resources. However, there are cases like this where some CFEs don't work for whatever reason and alternatives need to be selected. That's what happened here. The HT-4840-11 CFE entries less than 10 appear to be designed to be used in a PC-9801 and PC-9821 laptop. They don't work in my modern HP laptop at all. Entries 10 and above all work fine.

    The second fe card I was able to make work was the CONTEC CNETPC. Its first entry had a similar problem to the first few of the Hitachi HT-4840-11, but the rest were good. A quick modification to my earlier modification for the Hitachi and I was supporting both. Well, with one caveat. I can't get this card to get any link with any of the hubs that I have. I don't know if this is because the dongles got mixed up over time and I didn't have a good dongle, or if other parts of the card are 'blown out' or otherwise messed up. I had several cards like this.

    Next up was a Toshiba JT Ethernet card. It worked out of the box with the ed driver. However, there was an issue. The MAC address showed up as 00:20:16:ff:ff:ff which seemed odd. Especially since 002016016b31 was labelled on the card. Digging into this deeper showed that the card has the bogus-looking address in the CIS. None of the other standard ways to get a MAC produced anything other than 0's. There's no aux entries in the CIS that could be mined for this data either. Since that's the case, I'm almost convinced that this is working the best it can given the circumstances. Also, there was no good dongle for this card...

    There were a number of other boring cards. These were cards that I was able to add to the drivers more easily. The NextComK.K NC5310B Ver1.0 seems to work with the fe driver, but I don't know if the driver I have works or not. Also the MACNICA ME1-JEIDA worked with the ed driver, but the dongle didn't seem to be the right one.

    Now, on to the odd-balls.

    The NEC PC-9801N-J02R is a card made especially for PC-9801 and PC-9821 laptops. I've never been able to make this work with the smc driver that's in the tree. The card has a sonic chip in it, and it should just work. However, it is extremely limited to where it can be mapped in the I/O space (only at 0x880!), and none of the laptops I've ever had worked with this address.

    The TDK LAC-CD011 I found turns out to be rare. At one time they were expensive, but no longer. Sadly, I didn't get dongles for this card. There's sources on the web that document it not working with the fe driver, but that it may have the MB86960A inside, which we might be able to make work. Plus, the NetBSD mbe driver supports the CD010, so I may fiddle with the fe driver to see if I can make this work...

    The Toshiba LANCT00A doesn't work out of the box at all. The only information about this card on the net today is that once there was a web page that Toshiba said it was a custom-built card. Chances are good that there will never be a driver for this card.

    I'll take a look at the other cards another time. They are even weirder, I fear...

    20090319

    AsiaBSDCon 2009

    I just presented a paper at AsiaBSDCon 2009 on the FreeBSD/mips status. There's a lot going on with the FreeBSD/mips project these days. You can find out most of the details from my paper, which is available in letter or a4 format.

    In summary, there's a number of new ports underway. There's Cavium Octeon, Atheros 7xxx/9xxxx, RMI Au1xxxx and a couple others.

    AsiaBSDCon is always fun. There's many Japanese developers that don't get a chance to go to other conferences who I only get to see in Japan. This conference allows me to see them, as well as talk to them to see what they are using BSD in general, and FreeBSD specifically. The Japanese have often lead the way in many areas, and seeing their current projects is very interesting.

    Also, I could cut and paste large parts of my paper here, but I'm not sure of the value of doing that. Can people that have strong opinions leave feedback on this issue.

    20090129

    Melman Lives!

    My son got a toy Melman at McDonalds in a happy meal a while ago. He love the thing. He pounds it on EVERYTHING. When you pound it, Melman says one of three phrases. Recently, however, Melman's voice started to give out. So I thought I'd replace the batteries. Should be easy, right, since those toys are just held together with a couple of screws.

    Turns out it wasn't quite so easy. The screws are triangular. This means that a regular screw driver wouldn't work. I tried forcing it with some precision screw drivers I had, but they were all just the wrong size. A few google searches later and I found a few places that have them. The cheapest one sells bits for about $3.00. Currently, there's a catalog link here, but who knows how long it will last. I also found amermeida who sells through amazon that sells a screw driver for the triangle recessed screws for $2.00, but with $5.00 for shipping. I wound up ordering there.

    Once the screw driver arrived, I removed the screws. There were L738H cells in place that were drained. I didn't have any of these cells on hand, and it was a cold night, so I raided my watch battery drawer in my shop. I had Energizer 392's. These were about 1-2mm thinner than the L738, but were close enough. I was able to bend the battery holder a bit and they slid right in. I snapped Melman back together, and I had a happy 2-year-old again.

    Maybe I'll be able to repair other toys with this screw driver. I hope so, since I don't think the original toy itself cost $7.00. There's a couple of cars that he has which are held together with the same type of screw.

    More on FreeBSD/mips another time...

    20090127

    Alchemy Au1550 status update

    I'm in the very early stages of bringing FreeBSD/mips on the Alchemy Au1550. Plat'Home was kind enough to put an OpenMicroServer into my hands for the port. After months of sitting idle, I've started putting the board to use again. I test booted my first kernel tonight. It is still early days, but I thought I'd mention that I'd committed the very preliminary code to the project/mips tree in svn.

    As an aside, the FreeBSD/mips main development has moved from the so-called "mips2" tree in perforce to the projects/mips tree in svn. This move allows us to more easily share the work in progress mips ports that people have been asking for in the past. We'll see how well this works out and see if theory matches reality or not.

    20090125

    More Video Creation hacks

    I believe that I've blogged before about my video creation on FreeBSD. Here's some interesting tips for DIVX players that I've found.

    First, to recap: I tape a lot of hockey games with my DV camera. I use
    fwcontrol -R name.dv -M dv
    to read in the tapes. I then use the kino port to do some editing and convert the .dv files into mpeg 2 files for the DVDs of the games I make. I convert the mpeg2 files to dvds using dvdauthor. When I want to be fancy, I use dvdstyler to create themes for the DVDs.

    Recently, I had my DVD player of many years die on me. It refused to play disks. So I went out gone one that would play DivX disks, as well as normal DVDs. This one also has a USB port on it. Through trial and error, I discovered that I could save myself a lot of disks by putting the videos I wanted to test on a flash drive.

    DivX videos, for those that don't know, are basically MPEG-4 AVI encoded rather than MPEGE-2 encoded like DVD movies. While DVD movies can play as low as about 4 or 5kbps, they are generally encoded at more like 10kbps. At that rate, the average single layer disc can hold about 2 hours of video. DivX movies are encoded at more like 1-2kbps, so are about 3-6 times smaller than their DVD encoded counterparts. Of course, these are gross generalizations, but good enough for people to understand.

    Now, my problem is that I have about 18 hours of hockey games that I'd like to distribute to the parents of the other players. For my son's benefit, I had made one DVD per game, but with 11 other parents, the thought of making 200 DVDs filled me with dread: it was too much time, too much hassle and it was starting to get expensive.

    So, I started experimenting with DivX encoded videos. I tried to get ffmpeg working, but ran into a number of snags that I basically punted on. I had used mplayer for years to watch other videos and DVDs, so I thought about using mencoder. kino had a mode that would encode the DV movies to something else, so I played around with it. I created two test videos. One was at 854x480. This is what you get when you film in 16:9 aspect ratio with a DV camera that has a resolution of 720x480. Google for anamorphic for all the reasons for this, but they can be summarized as non-square pixels converted to square pixels. For the curious, I used:
    mencoder sample.mpeg -cache 8192 -aspect 16:9 -vf harddup,pp=ci,scale=854:480 \
    -ovc xvid -oac mp3lame -lameopts preset=192 -xvidencopts bitrate=2048 -ffourcc DX50 \
    -o high.avi
    to encode the DVD-quality images into divx. This encoding resulted in a factor of 3-4 saving in file sizes. This was fairly good, but didn't get my 40GB of mpeg's to fit on one DVD. In addition, the DVD player I bought didn't like this resolution at all. I figured other people's DVD players wouldn't like it either. Next, I tried a reduced resolution version. I used
    mencoder - -demuxer rawdv -quiet -cache 8192 -aspect 16:9 -vf harddup,pp=ci,scale=426:240 \
    -af-adv force=1 -srate 44100 -ovc xvid -oac mp3lame -lameopts preset=medium \
    -xvidencopts fixed_quant=4 -ffourcc DX50 -o medium.avi
    which resulted in a space savings more like 6-10, which puts the encoding project within striking distance of one DVD. It is well under the DL DVD range, and might be very close to the single layer limit of 4.7GB. We'll have to see how the encoding goes. It is moving about 4x faster than the previous encoding as well.

    One of these days, I'll need to learn how to do the fancy two-pass encoding to ring every bit of quality I can out of my source material. But for now, I'm doing good to get things encoded. I also need to find some way to tame the insane complexity of this problem. The above commands were basically minor tweaks to ones I found in kino's scripts to encode the video.

    As for the DivX disk, I just copied the files over, and they played in alphabetical order. No way I could see to create a menu. No way to encode them in the .divx format that has menus and such in it, since I couldn't find the equivalent to dvdauthor for divx movies (please leave comments if you know of one for FreeBSD/Linux). For the hockey games for the parents, this is likely good enough. For other things, I'd like to do better...

    20090123

    Quick Mac OS X hack: Time Machine

    I have two macs in my house. One has a 750GB drive on it for backups, plus its normal disk. It had been setup for Time Machine before and was working well. I also have a MacBook Pro that needs to be backed up. I didn't want to swap the disk back and forth between the two, since that would significantly erode the value of Time Machine's automatic backups. I didn't see any place where this was well documented, so I thought a quick note would be helpful to people. Most of the references I've seen have talked about different hacks to make this happen, or that it is only on a specialized Apple product that I didn't have.

    I'm running Mac OS X 10.5.6 on both machines.

    First, I went to the store and bought a 750GB drive. I plugged it into the mac mini that I have sitting on my desk. I configured it for Time Machine on the Mac Mini. I did a couple of time machine backups.

    Next, I exported 750GB disk using the 'Sharing.' I clicked on 'File Sharing' tab to enable it. I clicked on the '+' button under the "Shared Folders" menus. I selected the volume that I had setup for Time Machine. I made sure that I was sharing via "AFP" in the "Options..." dialog.

    Once I had things shared this way, I went to the other mac. I went to "Finder" and selected "Go->Connet to Server.." tab. Here I explicitly typed "afp://ipaddr/" and connected. Once I was connected this way, I proceeded to enable Time Machine. The remote disk appeared on the list of choices, so I just selected it and started it up.

    I discovered that I have a 100Mbps switch, rather than a GigE switch. This made the initial backup very slow, on the order of 10GB/hr, which means I'm looking at a 10 hour backup time. Maybe it makes sense to head off to staples/best buy to get a GigE switch to plug them both into.

    I've not tried to do this wirelessly, so I don't know how painful that will be. I've also not tried to connect this to the Samba server that I have running FreeBSD. I can normally see that volume on the macs without needing to do the manual step.

    UPDATE: A GigE switch does help quite a bit. It was more like 6GB/hr with the 100Mbps switch, but with GigE I'm getting about 22GB/hr... So I have about 3 hours left in the backup now... 22GB/hr is about 6MB/s which seems way too slow (the hard disks are limited to about 15MB/s on each side, and the network to 125MB/s, so why the fall off in speed).

    20090122

    Minor at91 hacking

    The recent changes to the SD/MMC stack broke AT91. It seems like there was an assumption that was bogusly baked into the driver. We had assumed that the only data transfer commands would be 512 bytes.

    The problem is that the newer stack does commands that are 16 and 64 bytes long. These aren't really needed for basic support of the stack, but to get things like SDHC and high speed transfers working, they are needed.

    I've fixed this, and now things work again. I've also taken this opportunity to do some minor cleanups to the at91 mmc/sd driver.

    20081216

    Audio Ripping on FreeBSD

    For years I've been batching up my new CDs to rip all at the same time. Sometimes, this means doing a couple a month. Other times, like this year, it means catching up with 12 months of backlog. And while my ripping habits likely are uninteresting to readers, what I've learned over the years may be helpful.

    Years ago I installed the 'abcde' port, and update it from time to time. Having it in-place, and configured, makes all the difference in the world. I use cdparanoia as my reading method since it is the slow but reliable choice.

    There are many silly process things that make things go faster. First, make sure that you have all the CDs in the cases that you have stacked up. A few days before I start to rip, I go through the stack to make sure that none are on walk-about. Next, grab a bottle of windex, and a lint-free cloth. Wash each of the CDs, assembly line style. Sometimes I only do this for the discs that fail, but often times it helps things go so much faster that it can be worth the up front time.

    Once I have the discs prepped, I pick a time that I'm not using my laptop too much to do the ripping. For me, this is often my work day, since I look at it from time to time for email and irc messages only. My laptop DVD player isn't the best in the world, but that's OK. The ones that rip quickly, I don't have to do anything about. The ones that are scratched badly, I put aside for later. The easy ones are boring, since abcde makes them boring, so I'll not describe the process much further. Each disc takes about 10 minutes to rip and transcode them.

    The scratched discs are more of a challange. I've used a lot of players over the years. They vary widely in their quality. The cheapo player I have in my laptop copes with most of the discs. If I see too many + signs in a disc, I'll set it aside for later. Here, too many is 'more + than spaces in the output' when I look over at the screen several times. Or if there's any 'V' indications on any of the tracks. These usually take longer to do anyway, and get in the way of breezing through the easy CDs. Each year, I have maybe 5 discs that are stubborn, out of maybe 30 that I do. Long term averages are that 1 in 10 newly purchased 'used' disc show this. Discs that have been knocking around in the car for months are more likely to suffer from this as well. Really stubborn ones are more like 1 in 100, but more on that in a bit.

    I have a special CD-ROM (not DVD) that I use for the scratched discs. Of all the drives I've tested/used over the years, this one has the best success rate by far of any of them. This one happens to be a 52x/20x/20x IDE drive branded by HP I got at Target, of all places, several years ago. I can take a disc that has 20-30 V's on it with my cheapo laptop setup, and sometimes get a good read with this player. Often, the discs just read quickly, and that's the end of it.

    Sometimes, however, the disc is badly damaged and is that it is very slow. I was able to rescue a Moxie Froovis CD and a Phil Collin's greatest hits CD with this drive. But it took a week each of reading. When the drive is connected to a server, it doesn't matter so much that it is doing this. The CPU time isn't all that great during the week, so it doesn't interfere with the normal server operations. I look in on them once an hour at first, then once a day until the songs are done. Since I rarely have more than one or two of these a year, the extra time isn't that big a deal.

    At one point, I had a dozen laptops with CD Roms that I could use for ripping. I thought this would be great, since I could do so many in parallel. It turns out that the CD Rom drives in these were even cheaper than the one I'm using today. I spent so much time running between the laptops that I didn't get any work done. And the CPUs in these boxes were all, at best, squirrel powered, so they couldn't handle the encoding as well as my 2GHz HP Pavilion laptop does now. At the time, I just did it serially on the server I had (which was a 666MHz Intel), and changed it every hour or two. I could still run it remotely, so I wasn't running back to the server room except to change a disc.

    Today, with iTunes and other music places online, the art of coaxing bits off of audio CDs seems a bit passe. However, it is still something I find I'm doing a lot. Used CDs cost almost nothing, compared to $1/song for iTunes. Plus, format shifting is so much easier with audio CDs than with iTunes. Also note: I'm not talking about sharing my collection over the internet, just making the archival copies, and format shifted copies, as allowed by law and court decision. I still have most of the original CDs, and those I no longer have had been destroyed by my two-year-old when he was younger... But that's a story for a different time...

    20081214

    DLink DIR-615 Rev C1

    Today I saw that Office Depot had a DIR-615 on sale for $40.00. It was a new hardware revision: C1. I took a chance that it was a new non-Ubimax based router. I'm glad I did, at least so far.

    The router is based around the Atheros AR9130 CPU. This is MIPS based, so there's a good chance that I'll be able to put FreeBSD onto it. We'll see how it goes.

    I'll report more when I get a chance to examine the RAM and Flash parts, as well as map out the serial port to see what is reported there. Stay tuned.

    20081213

    More CardBus fixes

    After I committed my previous set of CardBus fixes, reports came in about interrupt storms, first with 16-bit cards, and later with 32-bit cards. These have been corrected in my latest fixes. We always act the CSTS interrupt when we see it. In addition, I've changed the acking of the 16-bit ExCA register to only happen when there's a "R2" or 16-bit card in the slot. Otherwise we now skip it. Hopefilly, this will help the shared interrupt case as well by eliminating some PCI bus cycles...

    The CSTS bit is interesting. It is the least well documented bit in the CardBus standard. It is unclear when it fires from reading the standard, but seems to be related to the card finishing its reset sequence. How this differs from the power-up interrupt, I'm not sure. I think we could further optimize the bring up of CardBus cards with it.

    In addition, I noticed there's a READY bit in the ExCA CSC register. We're currently doing busy waits to bring up the cards, including a couple of millisecond long DELAYs. I'll have to look into the prospect of using that interrupt to get around these issues there.

    Finally, I'm looking in earnest at the Alchemy Au1550 CPU for the OpenMicroServer port I'm doing. I've noticed that it uses a 16-bit PC Card interface. Maybe I'll finally need to rewrite the old PCIC driver from OLDCARD to make use of it (snagging the exca routines to make that easier). The OpenMicroServer has a CF card attached to it.

    20081204

    Cardbus Fixes

    I just checked into the tree some CardBus fixes. The biggest change was to the power-up sequence, as well as transitioning to using filters for the card change events. These two changes are somewhat intertwined, unfortunately, since the latter exposed some holes in the former. In a nutshell, we now register a filter for the card status change events. This means we can mark the card as bad right away before any additional interaction can happen to the card. We defer doing anything about the badness for a little bit (basically until the machine is idle enough for the cardbus kernel thread to run). The interlock mechanism is also much ligher weight, having moved from mutexes and CVs to simple msleeps. Fast interrupts require some care to get right, so I hope I've gotten it all right. The move is dictated by what you can and cannot do in a fast interrupt handler.

    Before making these changes, my atheros card would often reset for no reason. After these changes, I've not had it reset until I started using a kernel without the changes. I'm not sure why this would make such a big difference, and I hate mysteries. They indicate that there's something I don't understand, which I also hate. I'd be interested to see if I still see this when the fully integrated code is committed and looped back (I have several trees, and I most frequently run an unmodified kernel from svn, but sometimes also run one of these trees). There's a small chance that one of my other local changes could be the cause, but given what they are it seems doubtful. Still, a good datapoint if it is.

    In addition, these fixes add a retry option for the BadVcc errors that we'd see sometimes. These are annoying on some machines, and often times the best way to get around them was to reload the driver. They don't happen at all on TI based chipsets that I've seen (at least more recent ones). Instead, they were confined to the Ricoh chipsets. Since I switched my laptop a couple of years ago, I haven't seen them. These changes post-date the change, but have been tested lightly on another Ricoh laptop that I have. They've been heavily tested on the TI laptop. They are based only on the description of the problem in the NetBSD PR, since the implementations are so different for the different BSDs in this area.

    Finally, I did some comment tweaking and shuffling. I also managed a style change or two. These should have absolutely no effect on the running code, but hopefully help the reader of the code understand it better. Past experience has shown that these types of commits are most likely to provoke comment, even though the other two parts of my commits are actually quite a bit more important.

    Oh, why the flurry of commits? I was low on disk space, so I thought I'd go clean up. 11MB free just isn't enough. So I was looking around and discovered I still had a CVS tree and was going to blow it away. I did a final update just to see what changes I had. I'm glad I did, since I found these, and a few others. I still have more local changes there than I realized. Sometimes I guess it is good to run out of disk space and go on a cleaning spree? It also makes for smaller backups when you don't have top copy 5GB of /usr/obj and kernel build trees...

    Moving towards board files

    I've spent a little bit of time implementing the start of board files for the arm port. The initial push has been for the at91 subport only, and many improvements could be made to this. I've written up my initial thoughts on this on the FreeBSD wiki FreeBSD Arm Boards. It could use much improvement, I'm sure.

    One idea that hasn't been reflected there yet, was shown to me by Sam Laffler who suggested using linker sets to allow boards to 'probe', 'init' and other standardized functions. This is an interesting idea and I plan on working on adding it to the above links when Sam has results to share.

    I'd also like to expand the above wiki page to be a 'best practices' guide for all architectures where there's great diversity of boards/cpus/etc (eg, not the homogeneous env that x86 provides).

    I'm also soliciting comments on the above boards in addition to the above. Send them to me, or post them here.

    20081202

    Cassio Fiva's screen dead

    I was very fortunate enough to get a Casio Fiva MCP-205 given to me in 2000. I've used this laptop for years. I built Mozilla on it once, and melted the frame around the LCD! This resulted in a new warning in the Mozilla build instructions. Since Casio is a Japanese company, and I got this as the result of my contacts in Japan at the time, my news of melting the Fiva spread like wild fire there. Recently, when I was in Tokyo for AsiaBSDCon people were asking me about it.

    I've been using this laptop to do background builds, as a mobile terminal, firewire debugging platform, etc since I got it. Recently, i had put the laptop on the shelf. I'd not used it in the past 6 months or so for a variety of reasons. Last night I thought I'd give it a spin again, since I need a nice mobile platform. Sadly, while it was in storage the screen was cracked. I cannot get any text on the screen at all. I don't have the VGA cable so I could keep this laptop around as a server, since there's no console access. I cannot find an LCD to replace it, but I imagine that it would be expensive. More expensive than a modern netbook, which would be better for the FreeBSD project anyway...

    It is sad to see this laptop give up the ghost. Every time I used it, I was reminded of the good times in Japan. I'll hang onto the laptop for a little while on the off chance I can turn up a replacement LCD, but I fear it is dead.

    20081114

    MeetBSD

    I'm in California this weekend for MeetBSD, celebrating FreeBSD's 15th birthday!

    Come on out and join the fun.

    20081013

    Marvell ARM support in svn

    Rafal Jaworowski just committed support for a number of Marvell Processors. There are a number of commits going into the tree. He's just completed the first of these:
    Introduce low-level support for new Marvell core CPUs: 88FR131, 88FR571.

    From an earlier email message, we know that Rafal is working on support for Marvell 88F5182, 88F5281, 88F6281, and MV78100 SoCs.

    The following peripherals will likely be supported:
    • EHCI USB 2.0
    • Ethernet
    • GPIO
    • Interrupt controller
    • L1, L2 cache
    • Timers, watchdog, RTC
    • TWSI (I2C)
    • UART

    This is a fairly mature port that is going into the tree. It works with NFS or USB mounted root filesystems. The port is self hosted. Kernel and world builds succeed on the box. The box also boots to multiuser mode. Rafal has created a web page with all this information on it on the FreeBSD wiki at http://www.wiki.freebsd.org/FreeBSDMarvell

    This is way cool news! Good Job Rafal.

    Note: Much of this information was taken from a posting Rafal made to arm@freebsd.org.

    20081004

    gxemul update

    Oleksandr Tymoshenko posted a patch to gxemul that allows FreeBSD/mips to boot on it.

    I've committed it to the gxemul port. So now if you have gxemul 0.4.6.5_1 or later, you can run FreeBSD/mips, the MALTA kernel. I'll post a howto and a pointer to a image in a few days.

    20080930

    SD/MMC work

    Recently, I've pushed many bug fixes from Alexander Motin to the SD/MMC stack. He's submitted a driver for the SD Assocaition's standard SD Host Controller, and fixed many of these minor issues as part of doing that. I've tested these improvements on my AT91RM9200 system that boots off an SD card.

    There should be more support for MMC cards, as well as SDHC cards forthcoming. In addition, once I get a chance to review the sdhc driver, it too may be ready to head into the tree. I know that if I had such a working driver, I'd be able to work more on SDHC and MMC card support. The current AT91RM9200 box I have makes it difficult...

    Stay tuned for more updates.

    20080919

    FreeBSD/mips updated

    Here's an update in status to the FreeBSD/mips tree. David O'Brien has been working through issues one at a time to get things building, primarily getting gcc support merged in. After learning from David that more patches were needed than were in my blog, I spent some time collapsing changes from p4 into the main tree. I've updated my patches, and confirmed they work.

    First, you can find the patches from my FreeBSD drop box. These patches are 42k right now. This is from my tree that I pulled at revision 183198, taken at 3:30pm MDT September 19th, 2008, for the nit-pickers out there. At this level, I'm able to apply the patch, do a buildworld and all the kernels except SENTRY5 build. To build things:

    % svn update
    % fetch http://people.freebsd.org/~imp/MipsSvn.diff
    % patch -p0 < MipsSvn.diff
    % setenv TARGET mips
    % setenv MAKEOBJDIRPREFIX /tmp/$LOGNAME/obj
    % make buildworld
    % make buildkernel KERNCONF={ADM5120,IDT,MALTA,QEMU}


    I've just done the build testing at this point. Stay tuned in the coming days for how to setup a qemu or gxemul image and how to run this in emulated. I hope to get instructions for how to deal with real hardware a little bit after that. Right now the ADM5120 kernels are a little too big for the hardware that I have and it will take some time to sort out.

    Hopefully we'll have these last 42k of patches into the tree in the coming weeks. I'll keep everybody posted. There are some additional fixes in p4 as well on top of this which I'm still sorting out, but those should be going in as well.

    20080903

    FreeBSD embedded (mips, powerpc, arm) update

    The last week or so has show a spike up in FreeBSD embedded platform work. Fixes for mips and powerpc have gone into the tree. Support for a new ARM platform is getting ready to be committed. FreeBSD/mips is almost self-hosting in the svn tree (it has been in the p4 tree for some time). FreeBSD/powerpc and FreeBSD/arm continue to mature.

    Thanks to a flurry of activity over the weekend by David O'Brien, the number of patches needed for FreeBSD/mips has been reduced to a set for libpam and for binutils. David cleaned up the diffs for gcc and pushed them into the tree in a manner that allows for easier upstream committing.

    In addition, David has cleaned up a number of dangling nits in the build. This is the result of a slight mismatch between p4 and the code in FreeBSD's svn tree. Oleksandr Tymoshenko has looped back most of these changes into p4, and is working on resolving the conflicts that were generated. Once this is sorted out, Oleksandr or myself will generate a new set of diffs and go for the final push into the tree.

    I'm looking forward to having a good base for FreeBSD/mips in the tree. I've been busy with a number of other projects and haven't given it the time that I really want to give.

    On the PowerPC side of the ledger, Marcell Moolenaar and Rafal Jaworowski have been polishing uboot boot loader support in the FreeBSD/powerpc subversion tree. In addition, some bug fixes to and code polishing of the low level Book E PowerPC support have been committed. Many of these improvements were obtained from Semihalf consulting.

    On deck to be committed soon is support for Marvell's Orion NAS chips. This code has been in perforce for a while now and is nearly ready for the FreeBSD tree. I'll keep everybody posted when that happens. I hope to have my DLINK DIR-615 Rev A1 working by then with this code, but time has been tight and there's already too many different projects afoot in my life.