Running FreeBSD on IBM Thinkpad 570

This page gives advices about running FreeBSD 5 and 6 on IBM ThinkPad 570. This machine is a rather old model (mine made 11/99), manufacturing was stopped 07/2000. It is a one-spindle notebook, 1.8kg nominal weight, very thin (1"), FDD and CD are in the Ultrabay. Screen is 13.3" TFT. CPU is Pentium 300-366 MHz or Celeron 366-400 depending on model (I have 2644-1AU with PII 333 MHz and 2644-3AU with PII 366 MHz), motherboard is based on classic Intel 440BX chipset. Video adapter is NeoMagic 2200, with 2.5MB of video RAM. Sound: Crystal 4297 chip; machine has microphone in, line in and speaker out connectors. Lucent WinModem is built-in. One USB 1.1 port is provided, second is available in the Ultrabase. I have never tested infrared port under Windows or FreeBSD. All hardware is fully supported by FreeBSD and X.Org, but sometimes needs some tweaking.

CardBus cards did not work

CardBus cards failed to initialize when inserted (this happened under 5.4 as well). Symptoms are console messages like this:
cbb alloc res fail
cardbus0: Can't get memory for IO ports
cbb alloc res fail
rl0: couldn't map ports/memory
This is very annoying and I was booting without ACPI to get CardBus cards (namely, TrendNet Fast Ethernet with RealTek 8139 chip) working. Unfortunately, booting without ACPI disables all support for power management and in general is considered to be evil. Digging forums I have discovered a hint from Warner Losh that ACPI subsystem fails to allocate proper address or port for inserted device and an advice to set address/port manually. Little experimenting and the problem was solved. Add the following line to /etc/sysctl.conf:
hw.cbb.start_32_io=0x4000
If this still does not help, try changing 0x4000 to other values, such as 0x2000, 0x8000 etc. If you get messages about memory, not I/O ports, try changing hw.cbb.start_memory. Use command
sysctl hw.cbb
to display defaults. Reboot after changing /etc/sysctl.conf or set sysctl values by hand while experimenting.

BootEasy (FreeBSD boot manager) beeps when selecting FreeBSD partition

This problem is not ThinkPad 570-specific. I had rather messy installation at first: Windows 98 primary partition, Windows XP secondary partition with one logical drive, FreeBSD 4.9 partition and FreeBSD 5.4 partition. It worked. Recently (when 6.0 came out) I decided to do everything from scratch, so I have deleted FreeBSD partitions and created a new one. Installation from bootable CDROM went fine, and after rebooting I had a boot manager menu with two choices:
F1 Windows
F2 FreeBSD
but when I have pressed F2 it just beeped and nothing was happening! I was rather frustrated and did several reinstalls with the same effect. Then I started to search Internet and has found a solution in OpenBSD forums. The explanation was that "boot manager was installed in CHS mode and therefore cannot access cylinders over 1023" (my new FreeBSD partition started just at cylinder 1023). I don't quite understand the magic behind this, but advice from this forum worked: reboot with installation CD, select "Repair mode with live CD", and execute:
boot0cfg -B -b /boot/boot0 -o packet /dev/ad0
According man page for boot0cfg:
packet
Use the disk packet (BIOS INT 0x13 extensions) interface, as opposed to the legacy (CHS) interface, when doing disk I/O. This allows booting above cylinder 1023, but requires specific BIOS support. The default is `nopacket'.
I suspect this "packet 0x13 extensions" is simply an LBA, just named differently.

ACPI and APM (Advanced Power Management)

FreeBSD 4.9 worked fine on this machine in APM mode (suspend and hibernation worked without a hitch), but starting with FreeBSD 5.x ACPI became too important to be ignored. Unfortunately, it did not work correctly for suspend/resume, and even rebooting hangs and does not actually reboots machine. The simplest workaround in 5.x was to use command
acpiconf -s3
to put machine into suspend mode. FreeBSD 6 claimed to have lots of improvements in ACPI, so I am experimenting now; results will appear later (so far no obvious improvements).

Sound card

Sound driver module is called csa_snd. It is not loaded automatically. It could be loaded from /boot/loader.conf:
snd_csa_load="YES"
but I don't recommend that. Modules loaded this way cannot be unloaded later. Loading/unloading is used to cure playback problems like that:
pcm0:play:0: play interrupt timeout, channel dead
Sound usually dies after suspend/resume; unloading/loading module fixes that.

Lucent WinModem

Support for Lucent WinModem exists only in the form of binary Linux driver (object module), which is linked with necessary files to form native FreeBSD kernel module. This module is not a part of the kernel for obvious reasons; it is available as port or package (comms/ltmdm). After installing of package, add the following line to /boot/loader.conf:
ltmdm_load="YES"

Kernel config

Nothing special here, but nevertheless I quote here my kernel config file:
machine		i386
cpu		I686_CPU
ident		ROMNEY

options 	SCHED_4BSD		# 4BSD scheduler
options 	PREEMPTION		# Enable kernel thread preemption
options 	INET			# InterNETworking
options 	INET6			# IPv6 communications protocols
options 	FFS			# Berkeley Fast Filesystem
options 	SOFTUPDATES		# Enable FFS soft updates support
options 	UFS_DIRHASH		# Improve performance on big directories
options 	MD_ROOT			# MD is a potential root device
options 	NFSCLIENT		# Network Filesystem Client
options 	NFSSERVER		# Network Filesystem Server
options 	MSDOSFS			# MSDOS Filesystem
options 	CD9660			# ISO 9660 Filesystem
options 	PROCFS			# Process filesystem (requires PSEUDOFS)
options 	PSEUDOFS		# Pseudo-filesystem framework
options 	GEOM_GPT		# GUID Partition Tables.
options 	COMPAT_43		# Compatible with BSD 4.3 [KEEP THIS!]
options 	COMPAT_FREEBSD4		# Compatible with FreeBSD4
options 	COMPAT_FREEBSD5		# Compatible with FreeBSD5
options 	SCSI_DELAY=5000		# Delay (in ms) before probing SCSI
options 	KTRACE			# ktrace(1) support
options 	SYSVSHM			# SYSV-style shared memory
options 	SYSVMSG			# SYSV-style message queues
options 	SYSVSEM			# SYSV-style semaphores
options 	_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
options 	KBD_INSTALL_CDEV	# install a CDEV entry in /dev
options 	ADAPTIVE_GIANT		# Giant mutex is adaptive.

device		apic		# I/O APIC
device		pci             # PCI bus

device		fdc             # Floppy

device		ata             # ATA controller
device		atadisk		# ATA disk drives
device		atapicd		# ATAPI CDROM drives
options 	ATA_STATIC_ID	# Static device numbering

# USB devices look as SCSI ones
device		scbus		# SCSI bus (required for SCSI)
device		ch		# SCSI media changers
device		da		# Direct Access (disks)
device		sa		# Sequential Access (tape etc)
device		cd		# CD
device		pass		# Passthrough device (direct SCSI access)

device		atkbdc		# AT keyboard controller
device		atkbd		# AT keyboard
device		psm		# PS/2 mouse

device		vga		# VGA video card driver
device		splash		# Splash screen and screen saver support
device		sc

device		pmtimer         # Power Management timer

device		cbb		# cardbus (yenta) bridge
device		pccard		# PC Card (16-bit) bus
device		cardbus		# CardBus (32-bit) bus

device		sio		# 8250, 16[45]50 based serial ports

device		ppc
device		ppbus		# Parallel port bus (required)
device		lpt		# Printer
device		ppi		# Parallel port interface device

device		loop		# Network loopback
device		random		# Entropy device
device		ether		# Ethernet support
device		sl		# Kernel SLIP
device		ppp		# Kernel PPP
device		tun		# Packet tunnel.
device		pty		# Pseudo-ttys (telnet etc)
device		md		# Memory "disks"
device		gif		# IPv6 and IPv4 tunneling
device		faith		# IPv6-to-IPv4 relaying (translation)

device		bpf		# Berkeley packet filter

device		uhci		# UHCI PCI->USB interface
device		ohci		# OHCI PCI->USB interface
device		usb		# USB Bus (required)
device		ugen		# Generic
device		uhid		# "Human Interface Devices"
device		ukbd		# Keyboard
device		ulpt		# Printer
device		umass		# Disks/Mass storage - Requires scbus and da
device		ums		# Mouse
device		uscanner	# Scanners

X.Org configuration file

Here is my /etc/X11/xorg.conf configuration file. Proper display mode is 1024x768, 8, 16 and 24 bit modes are supported; I chose 16 bit mode to have extra video memory for acceleration and to speed picture rendering up (24 bit mode is rather slow).
Section "Module"
    Load        "dbe"
    SubSection  "extmod"
      Option    "omit xfree86-dga"
    EndSubSection
    Load        "type1"
    Load        "freetype"
EndSection

Section "Files"
    RgbPath	"/usr/X11R6/lib/X11/rgb"
    FontPath   "/usr/X11R6/lib/X11/fonts/local/:unscaled"
    FontPath   "/usr/X11R6/lib/X11/fonts/cyrillic/misc/:unscaled"
    FontPath   "/usr/X11R6/lib/X11/fonts/cyrillic/100dpi/:unscaled"
    FontPath   "/usr/X11R6/lib/X11/fonts/cyrillic/:unscaled"
    FontPath   "/usr/X11R6/lib/X11/fonts/misc/:unscaled"
    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
    FontPath   "/usr/X11R6/lib/X11/fonts/Type1/"
    FontPath   "/usr/X11R6/lib/X11/fonts/TTF/"  
    FontPath   "/usr/X11R6/lib/X11/fonts/bitstream-vera/"
EndSection

Section "ServerFlags"
    Option	"Dont Zoom"
EndSection

Section "InputDevice"
    Identifier	"Keyboard1"
    Driver	"kbd"
    Option 	"AutoRepeat"    "250 34"
    Option 	"XkbRules"	"xorg"
    Option 	"XkbModel"	"thinkpad"
    Option 	"XkbLayout"	"us,ru"
    Option 	"XkbOptions"	"grp:caps_toggle,grp_led:caps"
EndSection

Section "InputDevice"
    Identifier	"Mouse1"
    Driver	"mouse"
    Option 	"Protocol"    "PS/2"
    Option 	"Device"      "/dev/psm0"
EndSection

Section "Monitor"
    Identifier  "TP570"
    HorizSync   31.5 - 57.0
    VertRefresh 50-90
EndSection

Section "Device"
    Identifier	"NM2200"
    VendorName	"Neomagic"
    BoardName	"ThinkPad 570"
    Driver     "neomagic"
EndSection

Section "Screen"
    Identifier  "Screen 1"
    Device      "NM2200"
    Monitor     "TP570"
    DefaultDepth 16
    Subsection "Display"
        Depth       8
        Modes       "1024x768"
        ViewPort    0 0
    EndSubsection
    Subsection "Display"
        Depth       16
        Modes       "1024x768"
        ViewPort    0 0
    EndSubsection
    Subsection "Display"
        Depth       24
        Modes       "1024x768"
        ViewPort    0 0
    EndSubsection
EndSection

Section "ServerLayout"
    Identifier  "Simple Layout"
    Screen "Screen 1"
    InputDevice "Mouse1" "CorePointer"
    InputDevice "Keyboard1" "CoreKeyboard"
EndSection
Few notes: switching between English and Russian keyboards is enabled; English layout is a default one; GLX extension is disabled (CPU is too slow for software rendering). Autorepeat is set to maximum possible for standard IBM PC keyboard. Scaling of bitmap fonts is prohibited.

Further reading

FreeBSD on a Thinkpad X23
The FreeBSD Diary -- IBM ThinkPad T41
FreeBSD on the IBM ThinkPad X40
IBM ThinkPad 570/E: Software and drivers

Copyright (C) 2005 Sergey Ayukov. No part of this text can be reproduced without permission.


return to essays | return to homepage | send comment