Acer Aspire AS5672 and FreeBSD

Just some hints, tips, and debugging info

Specifications for the Acer Aspire AS5672WLMi (from Wikipedia). Specifics of my model: T2250 CPU, ATI Radeon X1600 gfx, 2 GB RAM. See also main page.
This machine is tested with the i386 version of FreeBSD.

BIOS version is v1.3239 (Release date: 01/12/07). Previous BIOS version was v1.3234 (Release date: 08/09/06). This laptop came with BIOS v1.3230 installed, when I got it, the only BIOS available on Acer's web was v1.3224 (3224.zip).

acpidump's: from bios v1.3230, from bios v1.3234, from bios v1.3239,
This machine runs the i386 version of FreeBSD.
The internal sata hard drive is sliced up as follows:
slice 1 - 30 GB - Windows XP Home
slice 2 - 70 GB - a FreeBSD install (currently RELENG_8)
slice 3 - 60 GB - Xubuntu
slice 4 - 72 GB -

Work log so far:
2011-07-28: I installed VirtualBox 4.0.12 from ports. At first usb devices would not show up in vm's, even if I have in /etc/rc.conf:
# enable rules in /etc/devfs.rules
devfs_system_ruleset="devfsrules_local"
and in /etc/devfs.rules:
[devfsrules_local=5]
add path 'usb' mode 0770
add path 'usb*' mode 0660
add path 'usb/*' mode 0660
add path 'ugen*' mode 0660
because /dev/usb was mode 0660, not 0770. I guess a reordering is in place:
[devfsrules_local=5]
add path 'usb*' mode 0660
add path 'usb' mode 0770
add path 'usb/*' mode 0660
add path 'ugen*' mode 0660
That should fix it.

2011-07-26: I changed /sys/dev/usb/usb_device.c from

        /* Set the actual configuration value. */
        err = usbd_req_set_config(udev, NULL, cdp->bConfigurationValue);
        if (err) {
                goto done;
        }

into

        /* Set the actual configuration value. */
        err = usbd_req_set_config(udev, NULL, cdp->bConfigurationValue);
        if (err && 0) {
                goto done;
        }
        err = 0;

and rebuilt the kernel. After the reboot, my stupid label printer is detected like this:
from /var/log/messages:
Jul 26 23:15:23 kg-home kernel: ugen0.2: <vendor 0x0922> at usbus0
Jul 26 23:15:23 kg-home kernel: ulpt0: <vendor 0x0922 product 0x0011, class 0/0, rev 1.10/1.00, addr 2> on usbus0
Jul 26 23:15:23 kg-home kernel: device_attach: ulpt0 attach returned 12
root@kg-home# usbconfig -d 0.2
ugen0.2: <product 0x0011 vendor 0x0922> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON

2011-07-18: slice 2 - XFce 4.8: I had to reinstall the sysutils/garcon port, to get the Xfce menu working again. To get the icons in the panel back, I had to reinstall the sysutils/xfce4-utils port and remove the ~/.config directory.
2011-07-18: slice 2 - Xorg - using the radeon driver (instead of radeonhd) makes Xorg work at least. Log file: Xorg.0.log. From /var/log/messages:
Jul 18 21:25:44 kg-home kernel: drm0: <ATI Mobility Radeon X1600> on vgapci0
Jul 18 21:25:44 kg-home kernel: info: [drm] MSI enabled 1 message(s)
Jul 18 21:25:44 kg-home kernel: info: [drm] Initialized radeon 1.31.0 20080613
Jul 18 21:25:45 kg-home kernel: info: [drm] Setting GART location based on new memory map
Jul 18 21:25:45 kg-home kernel: info: [drm] Loading R500 Microcode
Jul 18 21:25:45 kg-home kernel: info: [drm] Num pipes: 1
Jul 18 21:25:45 kg-home kernel: info: [drm] writeback test succeeded in 1 usecs
Jul 18 21:25:45 kg-home kernel: drm0: [ITHREAD]
Better than nothing, I suppose.
2011-07-18: slice 2 - trying to start Xorg, using this xorg.conf, gives me a black screen (Xorg.0.log). Not so funny, because Xorg crashed. From /var/log/messages:
Jul 18 20:03:40 kg-home kernel: drm0: <ATI Mobility Radeon X1600> on vgapci0
Jul 18 20:03:40 kg-home kernel: info: [drm] MSI enabled 1 message(s)
Jul 18 20:03:40 kg-home kernel: info: [drm] Initialized radeon 1.31.0 20080613
Jul 18 20:03:40 kg-home kernel: info: [drm] Setting GART location based on new memory map
Jul 18 20:03:40 kg-home kernel: info: [drm] Loading R500 Microcode
Jul 18 20:03:40 kg-home kernel: info: [drm] Num pipes: 1
Jul 18 20:03:40 kg-home kernel: info: [drm] writeback test succeeded in 1 usecs
Jul 18 20:03:40 kg-home kernel: drm0: [ITHREAD]
Jul 18 20:03:40 kg-home kernel: pid 5408 (Xorg), uid 0: exited on signal 11 (core dumped)
Jul 18 20:03:40 kg-home kernel: info: [drm] Num pipes: 1
Ok, need to figure out a fix for that. I also tried with the default config file generated with X -configure, like this:
X -config /root/store/xorg.conf.new
but it also crashed.
pciconf output:
root@kg-home# pciconf -lv | grep -A4 vga
vgapci0@pci0:1:0:0:    class=0x030000 card=0x00941025 chip=0x71c51002 rev=0x00 hdr=0x00
    vendor     = 'ATI Technologies Inc. / Advanced Micro Devices, Inc.'
    device     = 'ATI MOBILITY /ATI RADEON X1600 (M56)'
    class      = display
    subclass   = VGA
That is all I have so far. I loaded Xorg and the core in gdb, and did a bt:
root@kg-home# gdb Xorg ./Xorg.core
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...(no debugging symbols found)...
Core was generated by `Xorg'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/local/lib/libpciaccess.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libpciaccess.so.0
Reading symbols from /usr/local/lib/libXfont.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libXfont.so.1
Reading symbols from /usr/local/lib/libfreetype.so.9...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libfreetype.so.9
Reading symbols from /usr/local/lib/libfontenc.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libfontenc.so.1
Reading symbols from /lib/libz.so.5...(no debugging symbols found)...done.
Loaded symbols for /lib/libz.so.5
Reading symbols from /usr/local/lib/libXau.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libXau.so.6
Reading symbols from /usr/local/lib/libpixman-1.so.9...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libpixman-1.so.9
Reading symbols from /usr/local/lib/libhal.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libhal.so.1
Reading symbols from /usr/local/lib/libdbus-1.so.3...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libdbus-1.so.3
Reading symbols from /usr/local/lib/libXdmcp.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libXdmcp.so.6
Reading symbols from /lib/libcrypto.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/libcrypto.so.6
Reading symbols from /usr/lib/librpcsvc.so.5...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/librpcsvc.so.5
Reading symbols from /lib/libm.so.5...(no debugging symbols found)...done.
Loaded symbols for /lib/libm.so.5
Reading symbols from /lib/libthr.so.3...(no debugging symbols found)...done.
Loaded symbols for /lib/libthr.so.3
Reading symbols from /lib/libc.so.7...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /usr/local/lib/xorg/modules/extensions/libextmod.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/xorg/modules/extensions/libextmod.so
Reading symbols from /usr/local/lib/xorg/modules/extensions/librecord.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/xorg/modules/extensions/librecord.so
Reading symbols from /usr/local/lib/xorg/modules/extensions/libdbe.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/xorg/modules/extensions/libdbe.so
Reading symbols from /usr/local/lib/xorg/modules/extensions/libglx.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/xorg/modules/extensions/libglx.so
Reading symbols from /usr/local/lib/xorg/modules/extensions/libdri.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/xorg/modules/extensions/libdri.so
Reading symbols from /usr/local/lib/libdrm.so.2...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libdrm.so.2
Reading symbols from /usr/local/lib/xorg/modules/extensions/libdri2.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/xorg/modules/extensions/libdri2.so
Reading symbols from /usr/local/lib/xorg/modules/drivers/radeonhd_drv.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/xorg/modules/drivers/radeonhd_drv.so
Reading symbols from /usr/local/lib/xorg/modules/libfb.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/xorg/modules/libfb.so
Reading symbols from /usr/local/lib/xorg/modules/libexa.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/xorg/modules/libexa.so
Reading symbols from /libexec/ld-elf.so.1...(no debugging symbols found)...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x2885a407 in RHDDRILeaveVT () from /usr/local/lib/xorg/modules/drivers/radeonhd_drv.so
[New Thread 28701140 (LWP 100136/initial thread)]
(gdb) bt
#0  0x2885a407 in RHDDRILeaveVT () from /usr/local/lib/xorg/modules/drivers/radeonhd_drv.so
#1  0x2882fa11 in RHDLeaveVT () from /usr/local/lib/xorg/modules/drivers/radeonhd_drv.so
#2  0x080ba754 in AbortDDX ()
#3  0x080b337d in AbortServer ()
#4  0x080b395f in FatalError ()
#5  0x080acf1e in OsInit ()
#6  <signal handler called>
#7  0x00000000 in ?? ()
#8  0x2883c50f in LVDSPower () from /usr/local/lib/xorg/modules/drivers/radeonhd_drv.so
#9  0x28820771 in rhdBIOSScratchPower () from /usr/local/lib/xorg/modules/drivers/radeonhd_drv.so
#10 0x2884d9ce in rhdRROutputCommit () from /usr/local/lib/xorg/modules/drivers/radeonhd_drv.so
#11 0x080ce965 in xf86CrtcSetModeTransform ()
#12 0x080cee21 in xf86SetDesiredModes ()
#13 0x2884d83f in RHDRandrModeInit () from /usr/local/lib/xorg/modules/drivers/radeonhd_drv.so
#14 0x288317e2 in RHDScreenInit () from /usr/local/lib/xorg/modules/drivers/radeonhd_drv.so
#15 0x08071adb in AddScreen ()
#16 0x080bb0b4 in InitOutput ()
#17 0x0806bc51 in main ()
(gdb)
Don't know if that is useful.

2011-07-17: slice 2 - based on a hint from the freebsd-mobile malining list, I csup'ed again, and built a new kernel with options NEW_PCIB. Here is the kernel config file:
tingo@kg-home$ more /sys/i386/conf/AS5672
#
# AS5672        - GENERIC kernel, plus an option: NEW_PCIB
#
include GENERIC

ident   AS5672-GENERIC

options NEW_PCIB
Now, both network interfaces are working at boot, no patches needed. Nice! dmesg output: normal, verbose.

2011-07-15: slice 2 - upgraded to FreeBSD 8.2-stable via csup, make world. dmesg output: normal, verbose. As usual, the network interfaces (wpi0 and bge0) didn't work. After implementing Alexander Motin's patch (tm6292_pcie.patch) again (the second hunk of the patch was rejected), wpi0 works again. dmesg output with pach: normal, verbose.

2010-10-08: I booted FreeBSD 8.1-release from a memory stick. dmesg output: normal, verbose. The memory stick was made like this: dd if=/home/tingo/dl/bsd/fbsd/8.1/FreeBSD-8.1-RELEASE-i386-memstick.img of=/dev/da4  bs=10240 conv=sync, where da4 is the memory stick. wpi0 and bge0 still doesn't attach - no change there.

2010-01-17: slice 2 - I implemented Alexander Motin's  patch (tm6292_pcie.patch) and rebuild the kernel. This makes wpi0 attach even with acpi enabled, and usable. Very cool!. bge0 still doesn't attach for some reason. dmesg output: normal, verbose (part 1, part 2).

2010-01-16: slice 2 - I upgraded to latest FreeBSD 8.0-stable. Network interfaces (bge0, wpi0) doe not work with acpi enabled, if I kldload wpi it will even panic the machine. dmesg output normal, verbose. With acpi disabled, network interfaces work. dmesg output with acpi disabled: normal, verbose.

2009-12-12: I installed FreeBSD 8.0-release on slice 2 from a memory stick. dmesg output: normal, verbose.

2009-07-07: I booted FreeBSD 8.0-BETA1 from a memory stick. Unfortunately fixit mode didn't work, so I didn't get a copy of the dmesg. But - the problems with the NIC's and acpi are still there. Ugh.

2009-02-19: Reinstall - I installed FreeBSD 7.1-release (i386) on slice 2 of the new hard drive (see main page for more info).

2009-01-08: slice 3 - I upgraded to FreeBSD 7.1-stable. NIC's still don't work unless I disable acpi. dmesg output: normal, verbose, with acpi disabled: normal, verbose.

2008-11-23: acpi-amilo looks interesting.

2008-10-09: for completeness, I upgraded to FreeBSD 7.1-prerelease on the internal hard drive also. dmesg output: normal, verbose, with acpi disabled: normal, verbose.
2008-10-09: still with the usb hard drive, I upgraded slice 1 to FreeBSD 7.1-prerelease. Again, acpi needs to be disabled for network interfaces to work. dmesg output: normal, acpi disabled.
2008-10-09: usb boot - I booted a usb hard drive with FreeBSD 6.4-prerelease on. It still needs acpi disabled for network interfaces (bge) to work. dmesg output.
2008-10-09: usb boot - I booted a usb harddrive with FreeBSD 7.0-stable from 2008-05-10 on it. Still needs acpi disabled for network interfaces to work. dmesg output with acpi disabled: normal.

2008-03-10: usb-boot - The answer to what part I had been missing is this: you need to update boot2 as well. That is done with bsdlabel -B da0s1 (or any other slice you want to update). After that, the machine boots fine from usb. Here is the dmesg output.

2008-03-09: upgraded the machine to FreeBSD 7.0-release. dmesg output: normal, verbose and with acpi disabled. It is still necessary to set hint.acpi.0.disabled="1" in /boot/loader.conf if I want the network interfaces (bge and wpi) to attach.

2008-03-09: usb boot - For testing, I used fdisk -B da0 to install /boot/mbr. When booted, the screen displays exactly one register dump, followed by "BTX Halted".
2008-03-09: usb boot - my way of rebuilding the boot blocks was wrong. So I followed the correct way (from the Handbook, Section 24.6.5.2):
cd /usr/src/sys/boot
make clean
make
make install

Then I installed boot0 again, and tried to boot from the usb hard drive again. Still scrolling register dumps.

2008-03-08: usb boot - I also tried extipl (sysutils/extipl) with default installation, but that didn't work either.
2008-03-08: usb boot - I tried the patch from http://people.freebsd.org/~jhb/patches/btx_real.patch (I had to get the latest revision (1.45) of btx.S before the patch would apply), and did:
cd /usr/src
patch -p6 < .../btx_real.patch
cd sys/boot/i386
make
Then I copied the files to the usb hdd (da0) with:
boot0cfg -B -b /usr/obj/usr/src/sys/boot/i386/boot0/boot0 da0
cp -v /usr/obj/usr/src/sys/boot/i386/loader/loader /boot
But it didn't work either. Still scrolling register dumps. I wonder if I do this the right way.
2008-03-08: usb boot - I tried to boot FreeBSD 7.0-release from an external (usb) drive. Unfortunately, btx still scrolls register dumps in an endless loop on screen. The FreeBSD installation on the usb drive works on another machine.

2007-11-11: upgraded the machine to FreeBSD 6.3-prerelease. dmesg output: normal, acpi_disabled. I can't remember if I did any tests at all.

2007-11-10: upgraded BIOS to v1.3239 (Release date: 01/12/07). Doesn't seem to have changed things.

2007-11-09: usb boot - I tried the patch from http://people.freebsd.org/~kib/realbtx/, to see if it helped with the usb hdd boot problem.
I did:
cd /usr/src/sys
patch < ../.../realbtx.2.patch
cd boot/i386
make
Then I copied the files to the usb hdd (da0) with:
boot0cfg -B -b /usr/obj/usr/src/sys/boot/i386/boot0/boot0 da0
mount /dev/da0s1a /mnt
cp -v /usr/obj/usr/src/sys/boot/i386/loader/loader /mnt/boot
unfortunately, it didn't help. When booting from usb hdd, the screen fills with forever scrolling text (register dumps?)

2007-07-19: upgraded the machine to latest FreeBSD 6.2-stable. No noticable changes in behavior. normal dmesg(verbose), and with acpi disabled. Network drivers (for bge0 and wpi0) only attaches when acpi is disabled, as before.

2007-03-08: I added the ec patch (ec.diff) from the freebsd-stable mailinglist and recompiled the acpi.ko kernel module. dmesg output. Output of sysctl hw.acpi.

2007-01-21: upgraded the machine to FreeBSD 6.2-stable via cvsup. No big changes. nomal desg, and with acpi disabled. Network drivers (for bge0 and wpi0) only attaches when acpi is disabled, as before.

2006-11-21: cvsup'ed to latest RELENG_6 and tested wpi. It still only works with acpi disabled: dmesg normal, verbose. dmesg with acpi enabled: normal, verbose.

2006-11-19: there is a wpi driver (for the 3945 wireless) in progress at: http://people.freebsd.org/~flz/local/wpi/. I tested it, and it works! Caveat: it only works when ACPI is disabled (like the bge driver). dmesg output: normal, verbose.

2006-11-17: usb boot - I tested FreeBSD 6.2-RC1 on an external USB hard drive. Installation was a success. Unfortunately, the machine will not boot from the external HD. It only displays what I think must be register dumps (hard to tell, it scrolls by too fast) until I turn i off.

2006-11-10: I was recently sent s couple of patches for pci. I tried those on FreeBSD 6.2-PRERELEASE, both patches applied cleanly. After making a new kernel, i rebooted. Unfortunately, bge still will not work with these patches and acpi enabled. Here are dmesgs normal, verbose.

2006-10-07: bge debugging continues. A FreeBSD developer requested some register info from pciconf, here it is, register dumps (with acpi) and register dumps (with acpi disabled).

I updated to FreeBSD 6.2-PRERELEASE, here are normal dmesg, normal dmesg (verbose), and with acpi disabled: acpi disabled dmesg, acpi disabled dmesg (verbose). bge is compiled as a module, and loaded manually.

I tested FreeBSD 6.2-beta1 (i386, of course). Here are the results:

First, with nothing disabled: normal dmesg, verbose dmesg.

Then, with acpi disabled, and routing for irq 18 forced: normal dmesg, verbose dmesg. Disabling and forced irq routing is done by setting

hint.acpi.0.disabled="1"
hw.pci4.0.INTA.irq="18"

in /boot/loader.conf

The main problem is that with acpi disabled, the machine gets too hot within less than an hour, and starts overheating. At that point, things like networking (both wired, PCCard and usb-based (ural) network options have the same problems) starts to malfunction, and will very shortly stop working at all.

Other than that, I can reliably panic 6.2-beta1 by attaching an ural(4) device to my machine, configuring it, and using it.

For comparison, here are the dmesg results from FreeBSD 6.1-stable dated 2006.08.08: normal dmesg, verbose dmesg.

info about bge0 network card: lspci -vvv, pciconf output. lspci -x, lspci -x (with acpi disabled).

Here is an article about my earlier attempts: FreeBSD on an Acer Aspire 5672 laptop.

At this point in time, Linux works better than FreeBSD on this laptop.