[86] in linux-announce channel archive
NEW APM BIOS support release (ALPHA 0.4)
daemon@ATHENA.MIT.EDU (Lars Wirzenius)
Thu Jan 19 13:32:42 1995
Date: Thu, 19 Jan 1995 18:29:59 +0200
From: Lars Wirzenius <wirzeniu@cc.helsinki.fi>
To: linux-activists@niksula.hut.fi, linux-announce@vger.rutgers.edu
X-Mn-Key: announce
Newsgroups: comp.os.linux.announce
From: Stephen.Rothwell@pd.necisa.oz.au
Subject: NEW APM BIOS support release (ALPHA 0.4)
Reply-To: Stephen.Rothwell@pd.necisa.oz.au
Organization: NEC Information Systems Australia, Canberra
Keywords: Advanced Power Management BIOS APM laptops
Approved: linux-announce@tc.cornell.edu (Lars Wirzenius)
Followup-to: comp.os.linux.development.system
Hi all,
This is to announce a new version of my APM BIOS driver for Linux.
This is still Alpha code and is currently release 0.4.
The code isavailable ont tsx-11.mit.edu in the directory
pub/linux/packages/laptops/apm.
The relevant files are README.apm_bios and apm_bios.0.4.tar.gz.
I have included the README file below, so you don't need to fetch that.
Please try this stuff out if you can and send me bug/good reports as
I am trying to convince Linus that this stuff should go into the
official kernel and he wants it tested. :-)
Cheers,
Stephen
P.S.  For those not on the "bleeding edge", I have a version of the
kernel patch that should work for Linux 1.1.73 (the included patch
is for 1.1.78).
--
Stephen Rothwell                    Stephen.Rothwell@pd.necisa.oz.au
NEC Information Systems Australia   Phone: +61-6-2508747
Software Development Centre         Fax:   +61-6-2508746
Canberra, Australia
--------------------------README.apm_bios------------------------------
	APM BIOS Driver for Linux
	by Stephen Rothwell       Stephen.Rothwell@pd.necisa.oz.au
This driver interfaces to an Advanced Power Management (APM) BIOS on
a system (usually a laptop) to allow the control of power management
and the reporting of PM events under Linux.
Currently the driver works with Linux versions 1.1.78, but
there should be no problems with using them with newer patch levels
of the kernel.
INSTALLATION:
There are a set of kernel patches to be applied called kernel.patch.
Use
	patch -p0 <kernel.patch	(from /usr/src)
or
	patch -p1 <kernel.patch (from /usr/src/linux)
There are also some new files to install:
	apm_bios.h belongs in include/linux/apm_bios.h
	apm_bios.c belongs in drivers/char/apm_bios.c
Copy these to the appropriate directories in /usr/src/linux.
Then do
	make config;make depend;make
in /usr/src/linux.
There is a very simple apm daemon: apmd.c.
DETAILS:
The driver itself just prints some debugging information at startup
and then polls the APM BIOS every second to get events.  It then
passes these evnts onto any other drivers that have registered and
also to a user process if it has the apm_bios device open.  If there
is no user process with the device open, and the driver gets a SUSPEND
event, it tells the APM BIOS to suspend the system and then when the
BIOS returns, resets the system time.  If it gets a RESUME event, it
just reset the system time.  Any other event just gets logged (using
printk).  This logging can be disabled in the driver.
The major number for the device is dynamically allocated.  You can use
	cat /proc/devices
to find it.  Then you must use
	mknod /dev/apm_bios c <major> 0
to create the device.  This device may be read to get notification of
APM events.  Each event is returned as an unsigned short (currently in
Intel order - least significant byte first).  Select and O_NONBLOCK
also both work.
There are currently only two ioctls.  These allow a user process to
put the machine into suspend or standby mode.
Only one process can have the device open, and only root can open the
device.
------------------------------------------------------------------------
--
Send submissions for comp.os.linux.announce to: linux-announce@news.ornl.gov
PLEASE remember Keywords: and a short description of the software.