OpenBSD Journal

Help for your mobile computing lifetime

Contributed by jose on from the get-up-and-get-down dept.

G.O.A.T. writes: "Move to -CURRENT to stretch that battery out and enjoy easy transitions between networks. Many thanks to deraadt@ and tedu@ for adding some nice features that make life easier on us untethered mobile users. I am moving to test on 3 generations of IBM Thinkpads and you'd do well to join me.

I wanted to tell people about two neat new teaks in -current that affect laptop users. Tedu did most of the first, while I did the second. These are not yet fully documented, I am hoping to make time for that soon..."

"Laptop cpu speed control works on some laptops. If you have support for this you will see:

# sysctl hw
hw.machine = i386
hw.model = Intel(R) Pentium(R) M processor 1600MHz ("GenuineIntel" 686-class)
hw.ncpu = 1
hw.byteorder = 1234
hw.physmem = 535801856
hw.usermem = 535277568
hw.pagesize = 4096
hw.disknames = wd0,cd0
hw.diskcount = 2
hw.cpuspeed = 1600
<----- speed in MHz
 hw.setperf = 100                   <----- rough % of maximum speed
The latter two lines show up. Right now it is running at 100% speed of speed, which is 1600MHz. OK, let's fiddle:
# sysctl -w hw.setperf=0
hw.setperf: 100 -> 0
# sysctl hw | tail -2
hw.cpuspeed = 600
hw.setperf = 0
Now it is running at 600MHz. That can save quite a bit of battery.

I could have given a value other than 0, but since 600MHz is the slowest it can go to... understand?

Of course, only some laptops support this, and different variants of slowdown technology too. Transmeta machines have one way of slowing down, Celerons another, and Pentium M's another way. And then it varies based on how the motherboard is setup. On some laptops we cannot yet do it because it is too esoteric. Work on this will continue.

Another new feature is in dhclient(1). Of course you are normally at home on your own regular net, but from time time you travel onto another net and do:

	# dhclient wi0
And voila, you are now on the new net. But if you move to yet another net, you normally had to hunt the running dhclient down and kill it; before starting a new one. Not anymore. Running dhclient processes now notice if anyone fiddling with the interface (ie. changing an address). So to move to another network that has dhcp as well, simply do:
	# dhclient wi0
When this happens, the old one will cleanup and terminate. Even nicer, since dhclient now terminates nicely, it will always try to properly save and restore your resolv.conf file.

Finally, the /etc/netstart script has undergone some cleanup. If you find yourself back home, where your network is static, just type

	# sh /etc/netstart
The currently running dhclient will notice the tap on it's back, and terminate --- thereby restoring your resolv.conf. And everything will be restored to your home configuration. And of course, the netstart script now runs quietly.


(Comments are closed)

  1. By James Nobis () quel #### quelrod #### net on

    This is built into acpi on most systems, my laptop is running fbsd due to irq problems without acpi support (plus typing apm and getting battery life is nice.) Any word on when acpi work will start on openbsd? (acpi is in netbsd-current presently)

    1. By Peter Hessler () on

      acpi is really invasive, and is also i386 only. The cpu stepping feature is for all arch's. Noone has written acpi code for OpenBSD, which is why it isn't in yet.

      1. By Brad () brad at comstyle dot com on mailto:brad at comstyle dot com

        Well technically that's not true, amd64. One or two developers have looked at bringing over the ACPI code from NetBSD but as you said it's very invasive so it would take quite some time and A LOT of testing.

  2. By Chris Humphries () on

    nice little changes :)

  3. By Anonymous Coward () on

  4. By Anonymous Coward () on

    Anyone who knows if this works for pentium III mobile processors? I can't test at the moment, but will do so in a week or two...

    cpu0: Intel Pentium III (Coppermine) ("GenuineIntel" 686-class) 852 MHz

    1. By markus () markus@ on mailto:markus@

      i have code for this.

      drop me a line if you want to test.

      1. By Agent () hot_water_bottle@hotmail on mailto:hot_water_bottle@hotmail

        hi! I'm installing openBSD on my PIII-600 coppermine mobile machine, but battery life is terrible as it is. please send your code to hot_water_bottle@hotmail

  5. By Anonymous Coward () on

    Is there support for / coming for the modern AMD processors' power management? My mobile Athlon XP laptop thanks you in advance ;)

  6. By mra () on

    I can't wait to get this going on my picturebook.

    Nice work guys!


Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]