NetBSD on Thinkpad x40

Updated: Tue Aug 21 14:09:23 CEST 2007

On this page you'll find various notes related to running NetBSD on the IBM/Lenovo Thinkpad x40 laptop computer.

My kernel panics when closing the lid!

Probably the first thing you'll notice after installing NetBSD on your x40 is that the kernel drops to the debugger when closing the lid. This is due to a firmware bug. Here's a step-by-step instruction on how to fix it:

1. Install sysutils/acpi-iasl from pkgsrc

cd /usr/pkgsrc/sysutils/acpi-iasl
make install

2. Decompile your DSDT

acpidump -o x40.dsdt
acpi-iasl -d x40.dsdt

3. Patch x40.dsl

Locate the following lines in the newly created file x40.dsl:

...
               Method (VLOC, 1, NotSerialized)
                {
                    BreakPoint
                    If (LEqual (Arg0, \_SB.LID._LID ()))
...

Remove the line that reads BreakPoint.

4. Compile new DSDT

acpi-iasl -tc x40.dsl

The above command will generate a file called x40.hex. Put this in your kernel configuration directory.

5. Rebuild your kernel

Add the following options to your kernel configuration:

options ACPI_DSDT_OVERRIDE
options ACPI_DSDT_FILE="\"/usr/src/sys/arch/i386/conf/x40.hex\""

Recompile, install and reboot. Your dmesg should now say:

ACPI (tbget-0390): Table [DSDT] replaced by host OS [20060217]

Verify that the lid function works:

acpilid0: lid closed.
acpilid0: lid opened.