Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Aug 2004 16:11:55 -0700
From:      "Kevin Oberman" <oberman@es.net>
To:        Gary Kline <kline@tao.thought.org>
Cc:        FreeBSD Mobile Mailing List <freebsd-mobile@FreeBSD.ORG>
Subject:   Re: xbatt or other indicators for the Thinkpad 600E? 
Message-ID:  <20040829231155.A4C385D04@ptavv.es.net>
In-Reply-To: Your message of "Sun, 29 Aug 2004 13:03:19 PDT." <20040829200319.GB81746@thought.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multipart MIME message.

--==_Exmh_-2865111550
Content-Type: text/plain; charset=us-ascii

> Date: Sun, 29 Aug 2004 13:03:19 -0700
> From: Gary Kline <kline@tao.thought.org>
> 
> On Sun, Aug 29, 2004 at 12:45:38PM -0700, Kevin Oberman wrote:
> > > Date: Sat, 28 Aug 2004 17:30:53 -0700
> > > From: Gary Kline <kline@tao.thought.org>
> > > Sender: owner-freebsd-mobile@freebsd.org
> > > 
> > > 
> > > 	So far, it looks as tho my battery runs more than two  hours on
> > > 	my old TP.  But I'd like to have a gauge of some kind.  When I
> > > 	try to install any of the battery apps I error out with
> > > 	"/dev/apm" notfound.  Ihave "^device   apm" compiled into the
> > > 	kernel.  RH Linux finds the power-off device on one of the
> > > 	1998 Kayaks.  Didn't IBM have this on their hardware about the
> > > 	same time?  
> > 
> > Is apm enabled? You need to have both apm_enable and apmd_enable set to
> > "YES" in your rc.conf.
> > 
> > The battery gauges I use are the Gnome battery applet and the gkrellm
> > battery gauge and both work fine on my 600E.
> 
> 
> 	I have apm_enable=YES; will set the daemon=yes and reboot.
> 	Does this create /dev/apm?  I'm not clear on how the new
> 	/dev work on V5.

In V5, /dev is no longer simply a directory on a normal FFS file system
containing some rather odd entries that describe device access. This has
been replaced by devfs, a special file system for devices which is
mounted on the normal file system, usually at root (/).

Instead of creating static entries with mknod, devfs creates entries
"on the fly" from call made by the device driver. Devices are not
created until the driver actually probes and finds the device and are
destroyed when the device is removed (for removable devices). This was
needed to support USB, Firewire and similar devices which are dynamically
added and removed from the system.

I might also mention that you need to use /etc/devfs.conf to customize
thing like device protections and symlinks (such as /dev/dvd). devfs is
primarily for setting up devices for jails, but it is also the best way
to handle simpler customizations. I will attach my /etc/devfs.conf file
as a rather trivial example.

Note that you need the lines:
apm_enable="YES"
apmd_enable="YES"
in /etc/rc.conf. The quotation marks are required!

Also, is APM being probed at boot time? You should see something like:
apm0: <APM BIOS> on motherboard
apm0: found APM BIOS v1.2, connected at v1.2
very early in the boot. I don't build APM into the kernel but add:
apm_load="YES"
to /boot/loader.conf, but it should be fine in the kernel.

Make sure that ACPI is disabled and apm enabled in /boot/device.hints.
hint.apm.0.disabled="0"
hint.acpi.0.disabled="1"
hint.apm.0.flags="0x20"

If ACPI starts up, APM won't. These hints entries take care of both
issues. 
-- 
R. Kevin Oberman, Network Engineer
Energy Sciences Network (ESnet)
Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab)
E-mail: oberman@es.net			Phone: +1 510 486-8634


--==_Exmh_-2865111550
Content-Type: text/plain ; name="devfs.conf"; charset=us-ascii
Content-Description: devfs.conf
Content-Disposition: attachment; filename="devfs.conf"

#  Copyright (c) 2003 The FreeBSD Project
#  All rights reserved.
#
#  Redistribution and use in source and binary forms, with or without
#  modification, are permitted provided that the following conditions
#  are met:
#  1. Redistributions of source code must retain the above copyright
#     notice, this list of conditions and the following disclaimer.
#  2. Redistributions in binary form must reproduce the above copyright
#     notice, this list of conditions and the following disclaimer in the
#     documentation and/or other materials provided with the distribution.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
#  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
#  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
#  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
#  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
#  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
#  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
#  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
#  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
#  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
#  SUCH DAMAGE.
#
#  $FreeBSD: src/etc/devfs.conf,v 1.2 2004/06/06 11:46:27 schweikh Exp $

# These are examples of how to configure devices using /etc/rc.d/devfs.
# The first parameter is always the action to take, the second is always the
# existing device created by devfs, and the last is what you want to change.
# The name of the action is only significant to the first unique character.
#
# Examples:

# Historically X depended on this, but version 4.3.0 doesn't seem to anymore
#link	ttyv0	vga

# Commonly used by many ports
link	cd0	cdrom
link	cd0	dvd
link    ttyd0	pilot
perm	cd0	0666
perm	acd0	0666
perm	pass0	0666
perm	ttyd0	0666

# Allow a user in the wheel group to query the smb0 device
perm	smb0	0660

# Allow members of group operator to cat things to the speaker
own	speaker	root:operator
perm	speaker	0666


--==_Exmh_-2865111550--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040829231155.A4C385D04>