FreeBSD 7 on a Thinkpad T40 update
Not too long ago I wrote a how-to article on how to get FreeBSD 7.0 working on my IBM Thinkpad T40. Among other things, I omitted a section on getting proper video drivers working. The graphics chip is an ATI RV250 (Mobility 9000). This means the driver you should use is the 'radeon' driver. Use 'pciconf -lv |grep ATI' to see which chip you've got. After toiling a bit with it, I figured out how to get the Open Source ATI drivers working.
Because I want to generally keep my systems pretty current, I recently installed FreeBSD 7.1 on my T40. It's important to know that the FreeBSD project generally breaks up development into three separate releases, namely CURRENT, STABLE, and RELEASE, in order of most bleeding edge to most stable. After building Xorg 1.6.0, I tried to start an X session just to see if I would get the ugly TWM desktop. To my surprise I got just a black screen but that was it. Even more surprising was that the usual "three finger salute" (ctrl + alt + backspace) didn't kill my X session. I then hit 'alt + F2' to log into another vty and manually kill off X. Here's where the fun began. It killed more than X; it locked my entire machine up. I continued futzing with my xorg.conf, kernel modules, and locking my system up for a good hour. I then threw in the towel and wound up asking a friend who's a FreeBSD developer WTF was going on. I learned a few interesting facts:
- The DRM code in 7.1 was more than 2 years old
- It is not necessary to manually load or pre-load any kernel modules for video
- X.org should work well with ATI graphics cards (but the amd64 release may not work) since the ATI driver model has had substantial structural changes to it.
On the first point, there's two ways around the old code: Either download/burn/install the FreeBSD 7.2 release candidate or rebuild world. Since I'm a glutton for punishment, I decided to rebuild world. It's not actually that hard, just time consuming. Use the 'csup' utility to grab the entire CVS source tree from your nearest csup server and follow the directions listed here to rebuild your system using the RELENG_7 tree.
The second point is easy enough. There's no need to add anything to your /boot/loader.conf file in order to get X working. X.org will load any necessary kernel modules when you type 'startx'. As an interesting aside, I actually locked my system up when attempting the unload the radeon.ko kernel module when I had learned that preloading isn't necessary. Doh!
Once you've rebuilt your system and are running 7.2-STABLE, it probably wouldn't be a bad idea to rebuild your installed ports. This isn't necessary per se since X.org should work without even building a config file, but it is a good step, just to make sure everything is up to date. I use the portupgrade utility located in /usr/ports/ports-mgmt/ with the following: portupgrade -aRr. That should upgrade all outdated ports recursively as well as recursively rebuilding dependencies.
I'll expand on the last point a bit. ATI has been much more generous with contributing documentation to the Open Source community than Nvidia. In fact, Nvidia hasn't contributed anything other than a proprietary driver for Linux and FreeBSD, though there's a project called Nouveau which aims to build an Open Source Nvidia driver. Because of this, FreeBSD has an Open Source ATI driver (/usr/ports/x11-drivers/xf86-video-radeonhd and usr/ports/x11-drivers/xf86-video-ati) and using the old proprietary fglrx driver is no longer necessary. There's one hiccup to this though. The driver has to be re-worked every time a new ATI chip comes out. To solve this, ATI is moving towards the same unified driver model Nvidia has used for years and taking it a step further. They now have an Open Source BIOS abstraction layer called ATOMBios. The idea is to make it easier to more rapidly deploy drivers for new graphics cards. Read all about that in this article. Bravo ATI!
By the time you finish reading this, your ports should be up to date and you should be able to use hardware accelerated ATI drivers on your Thinkpad. I'm running XFCE4 on my Thinkpad and it's causing me to reevaluate the old "FreeBSD vs. Linux" question. Maybe I'll spend a little more time working on the other parts that I overlooked in my article.
Enjoy!
April 26th, 2009 - 20:54
Thanks for writing this.