gnu

Using the HP Pavilion dv7-3127eg laptop with Debian GNU/Linux

HP Pavilion dv7-3127eg

Yep, so I bought a new laptop recently, my IBM/Lenovo Thinkpad T40p was slowly getting really unbearably sloooow (Celeron 1.5 GHz, 2 GB RAM max). After comparing some models I set out to buy a certain laptop in a local store, which they didn't have in stock, so I spontaneously got another model, the HP Pavilion dv7-3127eg (HP product number VY554EA).

Why this one? Well, the killer feature for me was that it has two SATA disks, hence allows me to run a RAID-1 in my laptop. This allows me to sleep better at night, knowing that the next dying disk will not necessarily lead to data loss (yes, I do still perform regular backups, of course).

Other pros: Much faster than the old notebook, this one is an AMD Turion II Dual-Core Mobile M520 at 2.3 GHz per core, it has 4 GB RAM (8 GB max), and uses an AMD RS780 / SB700 chipset which is supported by the Free-Software / Open-Source BIOS / firmware project coreboot, so this might make the laptop a good coreboot-target on the long run. I'll probably start working on that when I'm willing to open / dissect it or when the warranty expires, whichever happens first.

Anyway, I set up a page at randomprojects.org which contains lots more details about using Linux on this laptop:

http://randomprojects.org/wiki/HP_Pavilion_dv7-3127eg

Most of the hardware is supported out of the box, though I haven't yet tested everything. There may be issues with suspend-to-disk / suspend-to-RAM, sometimes it seems to hang (may be just a simple config change is needed in /etc/hibernate/disk.cfg).

Cons: Pretty big and heavy (but that's OK, I use it mostly as "semi-mobile desktop replacement"), glossy screen, loud fans (probably due to the two disks).

For reference, here's an lspci of the box:

  $ lspci -tvnn
  -[0000:00]-+-00.0  Advanced Micro Devices [AMD] RS780 Host Bridge Alternate [1022:9601]
           +-02.0-[01]--+-00.0  ATI Technologies Inc M96 [Mobility Radeon HD 4650] [1002:9480]
           |            \-00.1  ATI Technologies Inc RV710/730 [1002:aa38]
           +-04.0-[02-07]--
           +-05.0-[08]----00.0  Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) [168c:002b]
           +-06.0-[09]----00.0  Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller [10ec:8168]
           +-0a.0-[0a]--
           +-11.0  ATI Technologies Inc SB700/SB800 SATA Controller [AHCI mode] [1002:4391]
           +-12.0  ATI Technologies Inc SB700/SB800 USB OHCI0 Controller [1002:4397]
           +-12.1  ATI Technologies Inc SB700 USB OHCI1 Controller [1002:4398]
           +-12.2  ATI Technologies Inc SB700/SB800 USB EHCI Controller [1002:4396]
           +-13.0  ATI Technologies Inc SB700/SB800 USB OHCI0 Controller [1002:4397]
           +-13.1  ATI Technologies Inc SB700 USB OHCI1 Controller [1002:4398]
           +-13.2  ATI Technologies Inc SB700/SB800 USB EHCI Controller [1002:4396]
           +-14.0  ATI Technologies Inc SBx00 SMBus Controller [1002:4385]
           +-14.2  ATI Technologies Inc SBx00 Azalia (Intel HDA) [1002:4383]
           +-14.3  ATI Technologies Inc SB700/SB800 LPC host controller [1002:439d]
           +-14.4-[0b]--
           +-18.0  Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] HyperTransport Configuration [1022:1200]
           +-18.1  Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] Address Map [1022:1201]
           +-18.2  Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] DRAM Controller [1022:1202]
           +-18.3  Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] Miscellaneous Control [1022:1203]
           \-18.4  Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] Link Control [1022:1204]

Full lspci -vvvxxxxnnn, lsusb -vvv, and a much more detailed list of tested hardware components is available in the wiki.

Using Debian GNU/Linux on the IBM/Lenovo Thinkpad T40p

TuxMobil - Linux on Laptops, Notebooks, PDAs and Mobile Phones Linux On Laptops linlap.com

IBM/Lenovo Thinkpad T40p

I recently got a new (well, refurbished) laptop as a replacement for my old Toshiba A80-117 laptop which has more or less died. It's an IBM/Lenovo T40p laptop (model 2373-CG6), with an Intel Pentim M at 1.5 GHz. I chose this laptop for multiple reasons:

  • Robustness (which is supposedly one of the main advantages of Thinkpads).
  • Relatively cheap, as it's an older refurbished model (I paid less than 280 Euros).
  • Resolution of 1400x1050 (the usual 1024x768 of similar models is definately not enough for my purposes).
  • It can use up to 2 GB of DDR RAM (many similar models have a chipset-limitation of 1 GB). I swiftly replaced the shipped 512 MB of RAM with the 2 GB from my old laptop. The hardware maintainance manual has very useful instructions on opening the laptop, btw.
  • Gigabit Ethernet.
  • Non-glossy screen (very important!).
  • Pretty long battery life (even though it's refurbished), I get more that 2 hours or so.

Downsides and missing hardware features (nothing too important, though):

  • No HDAPS unfortunately, which would have been fancy.
  • No support for burning DVDs, only CDs (but that's possible through an upgrade, I think).
  • Only two USB ports, more of them would have been nice.
  • No Firewire, but that's not really critical for me.

Pretty much all of the hardware works flawlessly out of the box with a recent distro/kernel, see below for details.

Installation

Not needed, I simply popped out the 40 GB drive from the T40p and inserted my 160 GB (PATA) drive from my old laptop and that was it. Pretty much everything worked out of the box (see below), even though this is a totally different manufacturer, model, chipset, graphics card, wireless card, and so on. The only exception being (of course) my small Windows partition on that disk, which is now unusable as the drive is on different hardware and Microsoft doesn't like me to do that. Free Software: 1, Microsoft: 0.

Audio

Works out of the box using the snd_intel8x0 driver. The hardware is onboard audio in the southbridge (82801DB / ICH4) and uses the Analog Devices AD1981B codec.

Bluetooth

Works out of the box using the bluetooth and hci_usb driver. The laptop's Bluetooth device is USB-attached internally and shows up in lsusb as:

  $ lsusb
  Bus 003 Device 004: ID 1668:0441 Actiontec Electronics, Inc. [hex] IBM Integrated Bluetooth II

The device is not enabled per default though (which is a good thing), you can enable it like this:

  $ echo enable > /proc/acpi/ibm/bluetooth

Disabling is equally simple:

  $ echo disable > /proc/acpi/ibm/bluetooth

After that, you can use hcitool / hciconfig etc. as usual, and/or enable more related stuff with /etc/init.d/bluetooth restart.

Modem

Untested, I don't need it.

IrDA

Untested so far.

Sensors

Works out of the box.

  $ sensors
  acpitz-virtual-0
  Adapter: Virtual device
  temp1:       +51.0°C  (crit = +93.0°C)                  

  thinkpad-isa-0000
  Adapter: ISA adapter
  fan1:       3698 RPM
  temp1:       +51.0°C                                    
  temp2:       +42.0°C                                    
  temp3:       +32.0°C                                    
  temp4:       +49.0°C                                    
  temp5:       +33.0°C                                    
  ERROR: Can't get value of subfeature temp6_input: Can't read
  temp6:        +0.0°C                                    
  temp7:       +28.0°C                                    
  ERROR: Can't get value of subfeature temp8_input: Can't read
  temp8:        +0.0°C                                    

HPET

The Intel ICH4-M southbridge in this laptop supports High Performance Event Timers (HPET) which allows for more power savings and thus improved battery life.

  $ dmesg | grep -i hpet
  pci 0000:00:1f.0: Force enabled HPET at 0xfed00000
  hpet clockevent registered
  HPET: 3 timers in total, 0 timers will be used for per-cpu timer
  hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
  hpet0: 3 comparators, 64-bit 14.318180 MHz counter

You can check with powertop that the number of wakeups-from-idle is drastically reduced (from 70 to less than 10) when adding hpet=force to the kernel command line.

Network card

Works out of the box using the e1000 driver.

  $ modprobe e1000
  Intel(R) PRO/1000 Network Driver - version 7.3.20-k2-NAPI
  Copyright (c) 1999-2006 Intel Corporation.
  ACPI: PCI Interrupt 0000:02:01.0[A] -> Link [LNKA] -> GSI 11 (level, low) -> IRQ 11
  e1000: 0000:02:01.0: e1000_probe: (PCI:33MHz:32-bit) 00:11:22:33:44:55
  e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection

Touchpad

Works out of the box, both in X as well as in the console using gpm.

TrackPoint

Works out of the box, both in X as well as in the console using gpm.

Suspend-to-disk and suspend-to-RAM

Both work out of the box (on 2.6.26 or 2.6.29 kernels), or at least it used to; I think I'm seeing some hangs upon resume nowadays (Capslock LED is blinking, schreen is blank. I'll investigate.). I'm using the hibernate Debian package. You can explicitly force the usage of either method in /etc/hibernate/hibernate.conf by uncommenting the respective lines.

# TryMethod suspend2.conf
TryMethod disk.conf
# TryMethod ram.conf

Wireless

Works out of the box using the ath5k driver. I tested WEP as well as WPA.

CPU frequency scaling

Works out of the box using the acpi_cpufreq driver.

$ cpufreq-info
analyzing CPU 0:
  driver: acpi-cpufreq
  CPUs which need to switch frequency at the same time: 0
  hardware limits: 600 MHz - 1.50 GHz
  available frequency steps: 1.50 GHz, 1.40 GHz, 1.20 GHz, 1000 MHz, 800 MHz, 600 MHz
  available cpufreq governors: userspace, powersave, ondemand, conservative, performance
  current policy: frequency should be within 800 MHz and 1.50 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency is 800 MHz (asserted by call to hardware).
  cpufreq stats: 1.50 GHz:69.76%, 1.40 GHz:0.11%, 1.20 GHz:0.13%, 1000 MHz:0.16%, 800 MHz:29.83%, 600 MHz:0.00%  (4010)

Use cpufreq-set -g performance if you need full CPU power, cpufreq-set -g powersave otherwise.

PC Speaker

Works fine out of the box, tested with beep.

CDRW/DVD

Works out of the box. You can play DVDs or CD-ROMs, and burn CDs (but not DVDs):

  $ wodim foo.iso
  [...]
  Device type    : Removable CD-ROM
  Version        : 0
  Response Format: 2
  Capabilities   :
  Vendor_info    : 'MATSHITA'
  Identification : 'UJDA745 DVD/CDRW'
  Revision       : '1.02'
  Device seems to be: Generic mmc2 DVD-ROM.
  Using generic SCSI-3/mmc   CD-R/CD-RW driver (mmc_cdr).
  Driver flags   : MMC-3 SWABAUDIO BURNFREE
  Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R96R

Ejecting a CD-ROM/DVD using the eject command line tool also works fine.

Graphics card

Works out of the box using the radeon driver.

  $ xrandr
  Screen 0: minimum 320 x 200, current 1400 x 1050, maximum 1400 x 2048
  VGA-0 disconnected (normal left inverted right x axis y axis)
  DVI-0 disconnected (normal left inverted right x axis y axis)
  LVDS connected 1400x1050+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
     1400x1050      50.0*+
     1280x800       60.0  
     1280x768       60.0  
     1024x768       60.0  
     800x600        60.3  
     640x480        59.9  
  S-video disconnected (normal left inverted right x axis y axis)

DRI works out of the box with the (mainline, open-source) driver:

  $ glxinfo | grep direct
  direct rendering: Yes

If you attach an external monitor or projector, you can enable it using xrandr as usual:

  $ xrandr --output VGA-0 --auto

You can also use a dual-head setup by adding this to your "Screen" section in /etc/X11/xorg.conf:

  SubSection "Display"
    # Virtual 2048 2048
    Virtual 1400 2048
  EndSubSection

After restarting the X server, you can play with xrandr and move the external screen (VGA-0) "below" the laptop's LCD screen (LVDS) for a simple dual-head setup. The GUI tools arandr or grandr are probably a bit simpler to use than plain command line xrandr.

The maximum size for the "Virtual" line is 2048x2048 if you want to keep DRI enabled (you can use higher values if you don't care about DRI).

S-Video

Untested so far.

Parallel port

Yes, this model still has an actual parallel port, which is nice as I can use it for random JTAG stuff (e.g. OpenOCD) with several cheapo parallel port JTAG adapters I own.

JTAG adapter for parallel port

PCMCIA

This laptop has a type II/III PCMCIA slot which works out of the box using the pcmcia and yenta_socket drivers. You can probe/handle PCMCIA cards using the pccardctl tool:

  $ pccardctl status
  Socket 0:
    no card
  Socket 1:
    no card

USB

Works fine, of course. Luckily it's USB 2.0 (not USB 1.1) so I can successfully do high-speed stuff, e.g. watching DVB-T using kaffeine. The only small problem is that there are only two USB ports, more would have been better.

Disk drive

Works fine, of course, it's just a normal PATA drive. You can check if DMA gets properly enabled with hdparm /dev/hda | grep dma.

ThinkLight

Works out of the box (Fn + PgUp). This is a tiny, but useful light embedded in the screen, which is helpful if you're working in dark rooms or in trains during the night etc.

Special keys

What works out of the box: brightness control buttons, audio volume control + mute buttons, thinklight button.

TODO: Access IBM, F3, F4, F5, F7, F12, left/right special keys, Fn+Space.

LEDs

All of them seem to work fine, including the Bluetooth on/off and Wireless on/off LEDs, as well as the suspend LED.

Detailed system information

lspci -tvnn

-[0000:00]-+-00.0  Intel Corporation 82855PM Processor to I/O Controller [8086:3340]
           +-01.0-[0000:01]----00.0  ATI Technologies Inc Radeon RV250 [Mobility FireGL 9000] [1002:4c66]
           +-1d.0  Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 [8086:24c2]
           +-1d.1  Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 [8086:24c4]
           +-1d.2  Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 [8086:24c7]
           +-1d.7  Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller [8086:24cd]
           +-1e.0-[0000:02-08]--+-00.0  Texas Instruments PCI1520 PC card Cardbus Controller [104c:ac55]
           |                    +-00.1  Texas Instruments PCI1520 PC card Cardbus Controller [104c:ac55]
           |                    +-01.0  Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) [8086:101e]
           |                    \-02.0  Atheros Communications Inc. AR5212 802.11abg NIC [168c:1014]
           +-1f.0  Intel Corporation 82801DBM (ICH4-M) LPC Interface Bridge [8086:24cc]
           +-1f.1  Intel Corporation 82801DBM (ICH4-M) IDE Controller [8086:24ca]
           +-1f.3  Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller [8086:24c3]
           +-1f.5  Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller [8086:24c5]
           \-1f.6  Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller [8086:24c6]

cat /proc/cpuinfo

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 9
model name      : Intel(R) Pentium(R) M processor 1500MHz
stepping        : 5
cpu MHz         : 1500.000
cache size      : 1024 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr mce cx8 sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 tm pbe up bts est tm2
bogomips        : 2997.72
clflush size    : 64
power management:

All in all it's a really nice piece of hardware, and it works without much hassle with recent distros/kernels.

Using Debian GNU/Linux on the Lenovo IdeaPad S9e netbook

TuxMobil - Linux on Laptops, Notebooks, PDAs and Mobile Phones Linux On Laptops

Lenovo Ideapad S9e netbook

I recently got my hands on a Lenovo IdeaPad S9e netbook for a short amount of time (I don't own it), so I did a few tests with Debian unstable (more or less Lenny right now) and a Linux 2.6.28 kernel on it, see results below.

The machine type is 4187-42G, and it features an Intel Atom N270 CPU (with HyperThreading) at 1.6 GHz, 1 GB of DDR2 RAM, an 80 GB SATA drive, an 8.9" WSVGA 1024x600 (glossy) screen, VGA port, LAN, wifi, bluetooth, 2xUSB, SD card slot, PCI ExpressCard slot, built-in microphone, and a webcam.

BIOS

You can enter the BIOS by pressing F2, the boot menu by pressing F12 during boot. Booting from USB works fine on this netbook. There's a Splashtop installation on the netbook (called "Lenovo Quickstart" here) which you can disable in the BIOS.

Installation

There's no CD-ROM drive, so the simplest way is to use a USB thumb drive for installation. Here's how you can prepare one containing a Lenny installer (assuming your USB thumb drive is /dev/sda):

  $ wget http://cdimage.debian.org/debian-cd/5.0.1/i386/iso-cd/debian-501-i386-netinst.iso
  $ wget http://ftp.nl.debian.org/debian/dists/lenny/main/installer-i386/current/images/hd-media/boot.img.gz
  $ gunzip boot.img.gz
  $ dd if=boot.img of=/dev/sda1
  $ mount -t vfat /dev/sda1 /mnt
  $ cp debian-500-i386-netinst.iso /mnt
  $ umount /mnt

If the above USB thumb drive doesn't boot correctly (which it did not in my case: GRUB error 17) it's probably because of a messed-up MBR. This is how you can fix it:

  $ apt-get install mbr
  $ install-mbr /dev/sda

 Lenovo Ideapad S9e Debian installation

Then insert the USB thumb drive in the Lenovo IdeaPad S9e, choose USB boot in the BIOS, and start the installer. Most of the process works as usual, the only small difference is that you might want to load the "parted" installer module in order to resize the Windows-partition on the disk (if you want to keep it) to make space for Linux. The second (fat32) partition seems to keep a restore image and/or the Splashtop stuff, not sure.

Audio

Works out of the box using the snd_hda_intel driver. The hardware is onboard audio in the southbridge (82801G / ICH7) and uses the Realtek ALC269 codec. If some programs don't have working audio, try modprobe snd-pcm-oss.

Built-in microphone

Untested so far.

Bluetooth

Works out of the box using the bluetooth and btusb driver. The laptop's Bluetooth device is USB-attached internally and shows up in lsusb as:

  $ lsusb
  Bus 003 Device 002: ID 0a5c:2150 Broadcom Corp.
  $ dmesg
  usb 3-2: Product: BCM2046 Bluetooth Device

After modprobe btusb you can use hcitool / hciconfig etc. as usual, and/or enable more related stuff with /etc/init.d/bluetooth start.

Sensors

The lm-sensors script detects the lm75, eeprom, i2c-dev, and i2c_i801 modules. The following is the 'sensors' output:

  $ sensors
  acpitz-virtual-0
  Adapter: Virtual device
  temp1:       +36.0 °C  (crit = +95.0 °C)    

The hard drive temperature can be viewed with:

  $ hddtemp /dev/sda
  /dev/sda: FUJITSU MHZ2080BH G1: 44 °C

HPET

The Intel ICH7 southbridge in this laptop supports High Performance Event Timers (HPET) which allows for more power savings and thus improved battery life.

  $ dmesg | grep -i hpet
  ACPI: HPET 3F6E1E41, 0038 (r1 INTEL  CALISTGA  6040000 LOHR       5A)
  ACPI: HPET id: 0x8086a201 base: 0xfed00000
  hpet clockevent registered
  HPET: 3 timers in total, 0 timers will be used for per-cpu timer
  hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
  hpet0: 3 comparators, 64-bit 14.318180 MHz counter

You can check the wakeups-per-second with powertop.

SD card slot

Works out of the box. It seems to be attached via USB internally (usb-storage driver).

  $ lsusb
  Bus 001 Device 004: ID 0bda:0158 Realtek Semiconductor Corp. Mass Stroage Device

PCI ExpressCard slot

Untested so far.

ACPI

Works fine, see comments for "acpitool" output.

Network card

Works out of the box using the tg3 driver.

  $ modprobe tg3
  tg3.c:v3.94 (August 14, 2008)
  tg3 0000:02:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
  tg3 0000:02:00.0: setting latency timer to 64
  eth0: Tigon3 [partno(BCM95906) rev c002 PHY(5906)] (PCI Express) 10/100Base-TX Ethernet 00:11:22:33:44:55
  eth0: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0] WireSpeed[0] TSOcap[0]
  eth0: dma_rwctrl[76180000] dma_mask[64-bit]

Touchpad

Works out of the box, both in X as well as in the console using gpm.

  $ dmesg
  Synaptics Touchpad, model: 1, fw: 7.2, id: 0x1c0b1, caps: 0xd04731/0xa40000

Suspend-to-disk and suspend-to-RAM

I'm using the hibernate Debian package. You can explicitly force the usage of either method in /etc/hibernate/hibernate.conf by uncommenting the respective lines.

  TryMethod disk.conf
  # TryMethod ram.conf

Suspend does not yet work out of the box, however, as the machine is unknown:

  $ s2ram -n
  Machine unknown
  This machine can be identified by:
      sys_vendor   = "LENOVO                          "
      sys_product  = "418742G         "
      sys_version  = "Lenovo                  "
      bios_version = "14CN51WW  "
  See http://suspend.sf.net/s2ram-support.html for details.

After a few test I found that s2ram -f -a 3 works fine (tested from console only so far). Now this needs to be integrated upstream and in the Debian package (I'll file a bug report). Update: Submitted bug #520848, and an email to the upstream mailing list.

Wireless

There doesn't seem to be a mainline driver for the Broadcom BCM4312 wifi card in the laptop, yet:

  $ lspci -nn
  05:00.0 Network controller [0280]: Broadcom Corporation BCM4312 802.11b/g [14e4:4315] (rev 01)

Neither the b43 nor the b43legacy drivers work as of 2.6.28. For now, one of two possible options is to build a (partly non-free) driver provided by Broadcom from source (option 2 would be to use ndiswrapper, I guess, but that's untested):

  $ wget http://people.debian.org/~adamm/kernel/linux-kbuild-2.6.28_2.6.28-0.1_i386.deb
  $ dpkg -i linux-kbuild-2.6.28_2.6.28-0.1_i386.deb (currently needed in unstable due to bug #518115)
  $ apt-get install build-essential linux-headers-2.6.28-1-686
  $ mkdir temp; cd temp
  $ wget http://www.broadcom.com/docs/linux_sta/hybrid-portsrc-x86_32-v5_10_79_10.tar.gz
  $ tar xfvz hybrid-portsrc-x86_32-v5_10_79_10.tar.gz
  $ make -C /lib/modules/`uname -r`/build M=`pwd` clean
  $ make -C /lib/modules/`uname -r`/build M=`pwd` modules

If that worked, you can load the driver via:

  $ rmmod bcm43xx; rmmod b43; rmmod b43legacy (you could also permanently blacklist these modules)
  $ modprobe ieee80211_crypt_tkip
  $ insmod ./wl.ko
  $ dmesg
  wl: module license '' taints kernel.
  wl 0000:05:00.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18
  wl 0000:05:00.0: setting latency timer to 64
  eth1: Broadcom BCM4315 802.11 Wireless Controller 5.10.79.10

You can now run iwconfig, iwlist, etc. from the command line, or use some GUIs such as kwifimanager.

In order to disable wireless, run:

  $ rmmod wl

So far, I only tested WEP (but not WPA).

CPU frequency scaling

Works out of the box using the acpi_cpufreq driver. Use cpufreq-set -c 0 -g performance if you need full CPU power, cpufreq-set -c 0 -g powersave otherwise. Use -c 1 to do the same with the other CPU/core.

PC speaker

Works fine out of the box using the pcspkr module, tested with beep.

Graphics card

Works out of the box using the intel X.org driver.

  $ xrandr
  Screen 0: minimum 320 x 200, current 1024 x 600, maximum 1024 x 1024
  VGA disconnected (normal left inverted right x axis y axis)
  LVDS connected 1024x600+0+0 (normal left inverted right x axis y axis) 195mm x 113mm
     1024x600      60.0*+
     800x600        60.3  
     640x480        59.9  
  TV disconnected (normal left inverted right x axis y axis)

DRI works out of the box with the (mainline, open-source) driver:

  $ glxinfo | grep direct
  direct rendering: Yes

If you attach an external monitor or projector, you can enable it using xrandr as usual:

  $ xrandr --output VGA --auto

You can also use a dual-head setup by adding this to your "Screen" section in /etc/X11/xorg.conf:

  SubSection "Display"
    Virtual 2048 2048
  EndSubSection

After restarting the X server, you can play with xrandr and move the external screen (VGA) "below" the laptop's LCD screen (LVDS) for a simple dual-head setup. The GUI tools arandr or grandr are probably a bit simpler to use than plain command line xrandr.

USB

Works fine, of course. The only small problem is that there are only two USB ports, more would have been better.

Disk drive

Works fine, it's an 80 GB SATA drive.

Webcam

Works out of the box using the uvcvideo driver.

  $ lsusb
  Bus 001 Device 005: ID 5986:0141 Acer, Inc
  $ modprobe uvcvideo
  uvcvideo: Found UVC 1.00 device Lenovo EasyCamera (5986:0141)
  input: Lenovo EasyCamera as /devices/pci0000:00/0000:00:1d.7/usb1/1-3/1-3:1.0/input/input9
  usb 1-3: New USB device found, idVendor=5986, idProduct=0141
  usb 1-3: New USB device strings: Mfr=3, Product=1, SerialNumber=0
  usb 1-3: Product: Lenovo EasyCamera
  usb 1-3: Manufacturer: BISON Corporation

You can use luvcvideo for webcam viewing.

Battery

Lasts for ca. 3.5 hours, probably less if the system is under high load.

Special keys

Fn+CursorUp / Fn+CursorDown (brightness), Fn+ESC (enable/disable webcam), Fn+F1 (sleep mode), Fn+F2 (enable/disable TFT backlight), Fn+F6 (enable/disable thouchpad), Fn+F7 (Num lock), Fn+F8 (scroll lock), and Fn+F11 (F12 key) all work fine.

Fn+F3, Fn+F5, Fn+F9, Fn+F10, and all other special keys are untested.

LEDs

The power, disk activity, CAPS lock, Num lock, and battery charging LEDs all work fine out of the box.

lspci -tvnn

  -[0000:00]-+-00.0  Intel Corporation Mobile 945GME Express Memory Controller Hub [8086:27ac]
           +-02.0  Intel Corporation Mobile 945GME Express Integrated Graphics Controller [8086:27ae]
           +-02.1  Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller [8086:27a6]
           +-1b.0  Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller [8086:27d8]
           +-1c.0-[0000:02]----00.0  Broadcom Corporation NetLink BCM5906M Fast Ethernet PCI Express [14e4:1713]
           +-1c.1-[0000:03-04]--
           +-1c.2-[0000:05]----00.0  Broadcom Corporation BCM4312 802.11b/g [14e4:4315]
           +-1d.0  Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 [8086:27c8]
           +-1d.1  Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 [8086:27c9]
           +-1d.2  Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 [8086:27ca]
           +-1d.3  Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 [8086:27cb]
           +-1d.7  Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller [8086:27cc]
           +-1e.0-[0000:06]--
           +-1f.0  Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge [8086:27b9]
           +-1f.1  Intel Corporation 82801G (ICH7 Family) IDE Controller [8086:27df]
           +-1f.2  Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Controller [8086:27c4]
           \-1f.3  Intel Corporation 82801G (ICH7 Family) SMBus Controller [8086:27da]

cat /proc/cpuinfo

See comments.

Resources

All in all it's a really nice hardware, and it works (more or less) flawlessly without much hassle with recent distros/kernels.

Update 2009-03-22: Updated various sections, added more info. Added resources section.

Building an ARM cross-toolchain with binutils, gcc, newlib, and gdb from source

Update: Please don't use this script, a fixed and updated version is now maintained in the summon-arm-toolchain git repo. Direct download: summon-arm-toolchain.

I've been planning to write about building custom ARM toolchains for a while (I used stuff from gnuarm.com in the past, but I switched to the lastest and greatest upstream versions at some point). Among other things, recent upstream versions now have ARM Cortex support.

First you will need a few base utilities and libs (this list may not be complete):

  $ apt-get install flex bison libgmp3-dev libmpfr-dev libncurses5-dev libmpc-dev autoconf texinfo build-essential

Then you can use my tiny build-arm-toolchain script, which will download, build, and install the whole toolchain:

  $ cat build-arm-toolchain
  #!/bin/sh
  # Written by Uwe Hermann <uwe@hermann-uwe.de>, released as public domain.
  [...]

Update: Please don't use this script, a fixed and updated version is now maintained in the summon-arm-toolchain git repo. Direct download: summon-arm-toolchain.

The final toolchain is located in /tmp/arm-cortex-toolchain per default, and is ca. 170 MB in size. I explicitly created the build script in such a way that it minimizes the amount of disk space used during the build (ca. 1.2 GB or so, compared to more than 3 GB in the "naive" approach).

Using the "-j 2" option for make (see script) you can speed up the build quite a bit on multi-core machines (ca. 30 minutes vs. 60 minutes on an AMD X2 dual-core box). Also, you can change the script to build for other target variants if you want to (arm-elf or arm-none-eabi, for example).

Checkout the blog entry How to build arm gnu gcc toolchain for Mac OS X by Piotr Esden-Tempski for similar instructions for Mac OS X users.

Oh, and while I'm at it — does anybody have any idea why there are no pre-built toolchains for embedded (microcontroller) ARM targets in Debian? There are some toolchains for other microcontroller architectures (avr, m68hc1x, h8300, z80) but not too much other stuff. Is there some specific reason for the missing ARM toolchains (other than "nobody cared enough yet")?

I have heard about Emdebian, but from a quick look that seems to be more intended for toolchains with Linux/libc, not for microcontroller firmware (i.e. no MMU, no Linux, no libc etc.), but maybe I'm wrong?

Update: Please don't use this script, a fixed and updated version is now maintained in the summon-arm-toolchain git repo. Direct download: summon-arm-toolchain.

Testing stuff with QEMU - Part 3: Debian GNU/kFreeBSD

Debian GNU/kFreeBSD screenshot 1

Note: This article is part of my Testing stuff with QEMU series.

From the Debian GNU/kFreeBSD port page:

Debian GNU/kFreeBSD is a port that consists of GNU userland using the GNU C library on top of FreeBSD's kernel, coupled with the regular Debian package set.

Q: Why would anybody want to do that?
A: Why not? [1]

So, after we have talked about that, let's start:

  1. Install QEMU:
    apt-get install qemu
  2. Download the latest Debian GNU/kFreeBSD installer ISO image (either for i386 or amd64):
    wget http://glibc-bsd.alioth.debian.org/install-cd/kfreebsd-i386/20070313/debian-20070313-kfreebsd-i386-install.iso
  3. Create a QEMU image which will hold the Debian GNU/kFreeBSD (i386) installation:
    qemu-img create -f qcow2 qemu_kfreebsd_i386.img 5G
  4. Boot directly from the ISO image and install Debian into the QEMU image:
    qemu -boot d -cdrom debian-20070313-kfreebsd-i386-install.iso -hda qemu_kfreebsd_i386.img
  5. The FreeBSD installer will now start. For more detailed instructions see the Installing Debian GNU/kFreeBSD manual.
    First you can choose between an "Express" or "Custom" install (I used "Express").
  6. Next you end up in the partitioning tool. Type "a" to use the entire (QEMU) disk for the installation (the disk is called "ad0", not "hda" as on Linux). Type "q" to quit the partitioning tool.
  7. You are now asked which boot manager to use. For QEMU you should use "BootMgr", the default FreeBSD boot manager. If you install on real hardware you can also use GRUB; in that case choose "None" here (see the manual for more information), but note that the installer does not install or configure GRUB for you! You should do that beforehand!
  8. Next up: The disklabel editor. Here you'll create a partition ("slice" in FreeBSD-speak) for the root filesystem and a swap partition.
    Press "c" to create a new slice (will be called "ad0s1"), enter "4GB", choose "FS" (filesystem), and enter "/" for the root filesystem. Per default the UFS2 file system will be used. To create the swap partition, press "c" again, enter "1023MB", and select "swap". The new slice is called "ad0s1b". Press "q" to quit.
  9. Choose "minimal" when asked which distribution to install.
  10. Installation media dialog: select "CD/DVD" and "acd0" (for QEMU's ATAPI/IDE CD-ROM drive).
  11. The installation will now begin, and after a while you're asked to switch to console 3 using ALT-F3. Do it.
  12. You'll have to answer a bunch of questions: geographic area + city you're in (for timezone), whether you want to participate in the Debian popularity contest, whether module-init-tools should load additional drivers (no, so press ENTER three times). The installation will soon be finished.

At the end you must select "No" as you're told to do, then reboot via "Exit Install". You can then shutdown QEMU.

  1. Restart QEMU with the newly installed Debian GNU/kFreeBSD:
    qemu -hda qemu_kfreebsd_i386.img
    Debian GNU/kFreeBSD screenshot 2
  2. Press enter at the FreeBSD boot manager prompt, then login as root (there's no password).
  3. First things first: Set up a root password:
    passwd
  4. Now let's fix networking, update the system and install a bunch of packages:
    nano /etc/network/interfaces
    Yes, there's no vi, not even a symlink to nano! Uncomment the two "ed0" lines ("ed0" is the equivalent to "eth0" on Linux, I guess).
    /etc/init.d/networking restart
    apt-get update && apt-get dist-upgrade
    apt-get install vim xorg icewm xterm
  5. You can fix your console keymap using the kbdcontrol package (just select your keymap from the menu):
    apt-get install kbdcontrol
  6. Finally, let's fix X11 and start it. But first we create a new user, as we don't want to run X11 as root:
    adduser uwe
    vi /etc/X11/xorg.conf
    The mouse device is "/dev/psm0", the protocol "PS/2", and the graphics driver should be "vesa":

      Section "InputDevice"
          Option "Device" "/dev/psm0"
          Option "Protocol" "PS/2"
      [...]
      Section "Device"
          Driver "vesa"
        
  7. That's about it. Login as "uwe" (or whatever your username is) and start X11:
    startx

Wasn't all that hard, eh? Now, if you've got some spare time, head over to the Debian GNU/kFreeBSD wiki page and help improving this port ;-) You should probably start with reading the PORTING guide.

Both kfrebsd-i386 and kfreebsd-amd64 seem to be reasonably stable already (and more than 70% of the whole Debian archive builds fine on these architectures, see kfreebsd-i386_stats and kfreebsd-amd64_stats). I'll quite likely install kfreebsd-amd64 on one of my boxes soonish and start using it, maybe I'll even find some time to fix/patch/port some packages...

[1] More elaborate answer(s) and reasons are available in the Debian wiki.

Syndicate content