Subject: Re: iBook Powermanagement status query
To: Cherry G. Mathew <cherry.g.mathew@gmail.com>
From: Michael Lorenz <macallan@netbsd.org>
List: port-macppc
Date: 03/07/2006 11:21:17
--Signature_Tue__7_Mar_2006_11_21_17_-0500_eSVe6O.A_hShdfll
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Hello,

> > I'd suggest this - look at macppc/dev/apm.c and fill in the
> > APM_IOC_STANDBY and APM_IOC_SUSPEND cases in apmioctl(), look what
> > i386 does there - basically it runs the powerhooks, then tells the
> > APM BIOS

> Yes, that looks more do-able.... I was looking at the ACPI code.....
> its a very complicated set of APIs.

Yeah, I'm not really sure if not having ACPI is a drawback or a benefit
;)
Anyway, the Darwin source code is full of examples how to power down
various subsystems, there's a whole bunch of flag registers in uni_n for
just that.=20

> > to go into standby or suspend. Lots of macppc-specific drivers don't
> > support powerhooks yet, that's where the real work lurks.
> > With the ioctl()s in place you can just use zzz or apm to call them.

> Great, thanks! I could at least report what I see, and it could be a
> start.

That's the plan ;)
This way you can at least play with the API, run powerhooks at will and
so on.

We'll have to do a lot of things by hand which the APM BIOS does
automagically on i386, like figuring out when the machine has been idle
long enough to enter standby and so on. Since I have more or less the
same problem with the SPARCbook we should probably talk to the ACPI
folks first and make sure nobody duplicates anything needlessly.

Right now I'm slowly adding powerhooks to some SCSI and SBus drivers and
pondering how exactly to emulate a suspend. Too bad we don't have
generic suspend-to-disk.

have fun
Michael

--Signature_Tue__7_Mar_2006_11_21_17_-0500_eSVe6O.A_hShdfll
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (NetBSD)

iQEVAwUBRA2y/cpnzkX8Yg2nAQKSAAf9Eq9cMUX2DaEzs4Vo7Nt2UiClFlnLc5my
U4DoaJvgy6Rq2jiFGWVUemKDESNStZxmin+1XTP3NoAEYW46yb25i8uPByM4gMfz
nu9csscA8aeCXUAP2LEPtGGmEaSW03Uiuu5XXoNrB+6cWWf6cxyDYzUE2HhgTnT+
VUFj1SQBJhJjGqyfhfhgLOPZS89VjzCkEYxBuHNxzTixRPLYHDibbyL2a4UbSsbi
6k8eQGHPHJfZvIcZcullkfJtStWIFJlunwpRkuuTCixyIdm7mnf2BDEHPZChpRau
mUnUnnUqTNFw25sPt9jQruFO15ARq5mcnAtyQARQ8T9f0bsWXCjwiQ==
=IcCU
-----END PGP SIGNATURE-----

--Signature_Tue__7_Mar_2006_11_21_17_-0500_eSVe6O.A_hShdfll--