Forcing off the eeePC's LCD backlight in NetBSD

Published: April 17, 2009
Tags: netbsd server unix vbetool eeepc

My NetBSD-powered eeePC 701 webserver is still working just fine. The only downtime I've had since I set it up was when I once accidentally partially unplugged its power supply while trying to squeeze one extra plug into the same powerboard. I managed to get it out enough that the eeePC switched over to battery power but not so much that it was obvious at a glance, so I didn't realise what I'd done until the battery discharged and I stopped being able to check my email. I intend to write a power management script to stop this from happening again. The output of apm on the eeePC is fairly informative:

Battery charge state: high
Battery remaining: 100 percent
A/C adapter state: connected
Power management enabled
Number of batteries: 1

A script that parsed this output ever minute or so and checked for changes in "A/C adapter state" could recognise when the power supply has come unplugged or when there has been a blackout and take appropriate action - probably emailing me a warning and also playing an audible notification through the in-built speakers. The same script could probably also force a graceful shutdown when "Battery remaining" gets to 10%. Once I've written this I'll publish it here.

One thing that I've always been a little displeased about is that I haven't been sure whether or not the screen's LCD backlight was going out when I closed the lid. This typically requires the OS to be able to talk to the BIOS about the video card and non-mainstream OSes like NetBSD can't always do this when the BIOS details have stupidly been kept secret by their manufacturer. On some laptops this is easy to check for - on my ThinkPad T42 the switch that gets depressed when you close the lid is clearly visible and you can poke it with your fingernail or a pen to test that the screen really does go out. However, this switch for the eeePC seems to be completely internal so the best you can do is get the lid 95% closed and try to peer in through the resulting gap to see what is happening. As you can imagine, it doesn't work too well. Anyway, I really wanted the backlight to be off while the lid was closed if possible, since the backlight counts for a surprisingly substantial amount of the power consumed by a laptop, and one of the motivations for switching to the eeePC was to lower the power costs of all my hosting activities.

This recent blog post by Matthew Sporleder, who is also running NetBSD on a 701, explains how he managed to forcibly switch off the backlight but his solution involves having X.org installed (and running!). This seems sort of like overkill for me since I don't ever plan to use X for anything else on the device. However, a comment on the entry by "jmcneil" suggested that vbetool might be of some help. So I installed that and sure enough running vbetool dpms off forces the backlight off even when the screen is open. Replacing "off" with "on" obviously gets it back on again. This seems like an ideal solution. The only problem I can see is that if I'm ever forced to work on the eeePC using its own screen and keyboard instead of remotely using ssh (for example when I've made a stupid change to my network configuration and I can't get in via ssh) I don't know how to get the screen back on (aside from very carefully logging in and running the vbetool command while blind!). None of the function buttons along the top of the keyboard for adjusting the screen brightness or toggling between the inbuilt screen and an internal monitor seem to wake it up. Still, this is likely to be such a rarely occurring problem that I think the power savings more than justify the inconvenience.

Feeds
Archives
Top tags