Subject: Re: acpi in 1.6.1
To: Matthias Scheler <tron@zhadum.de>
From: Peter L. Peres <plp@actcom.co.il>
List: port-i386
Date: 01/02/2005 20:25:42
On Sat, 1 Jan 2005, Matthias Scheler wrote:

> In article <Pine.LNX.4.60.0412312312520.12282@cyc.cyc.ubzr.bet>,
> 	"Peter L. Peres" <plp@actcom.co.il> writes:
>> I conclude that acpi never worked in 1.6.1 and I need to upgrade.
>> Correct ?
>
> Yes. ACPI is only available in NetBSD 2.0 and newer.
>
> Hmm... the manual page says it is available in NetBSD 1.6 and newer but
> it never worked there. Any objections to correct the manual page?

Uhh, now you're telling me. I was trying to arrange for a short press on 
the power button to start a regular shutdown. It is set to power down 
hard after 4 seconds pressing in the BIOS. ACPI sort of compiles and 
works (the button generates an event) but that is a far cry from apm 
control. F.ex. it is impossible to shutdown the power (it works with apm 
but apm and acpi cannot work together). I will try to make changes to 
the button action so it calls a user mode program on event and try to 
make the machine shutdown hard (using more poken and peeken of dangerous 
locations cf. ACPI manual, using my new syscall - although this is not 
what I wrote it for). I cannot upgrade for now, I must finish what 
I am doing with 1.6.1

I managed to implement my IO space read/write using a lkm and a new 
syscall that I made (using the provided MOD_SYSCALL example in sys/lkm, 
which I expanded and adapted). The code is still rough but if there is 
interest I will post it. It should be portable since excepting for the 
I386_IO_SPACE symbol and the IO address space limitation on i386 there 
is nothing machine-dependent in it. I used the byte-order macros used in 
syscallargs.h so that part is covered.

imho many more things should be moved to lkms or have a lkm 
implementation as an alternative.

I have not set the permissions yet (anyone can run the syscall ... but 
this is not a problem as it's a single user machine and I use the 
syscall for debugging - I will use the process pointer in the syscall to 
restrict access to the superuser). Anyway it works.

thanks,
Peter