public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* ACPI+Userspace
@ 2005-06-13 23:37 Jeremy Moles
  2005-06-19 18:05 ` ACPI+Userspace Jeremy Moles
  0 siblings, 1 reply; 4+ messages in thread
From: Jeremy Moles @ 2005-06-13 23:37 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Hello all--quick question.

As bad as it may seem, I was wondering if it is possible to generate
ACPI events in userspace? That is: propogate any arbitrary "string" up
through the ACPI subsystem, eventually getting dumped
to /proc/acpi/event which, in our case, is being watched and acted on by
the userspace util ACPID.

The obvious answer is: "Call /etc/acpi/hander with your string!"--which
is always an option--but I'd like to know if it's possible simply to use
for testing/debugging. I could write a driver supporting ioctls to pass
stuff via acpi_bus_generate_event (I think?), but that's wayyy too much
work for what I'm wanting this for. I'm sure there are reasons this
isn't a good idea, and I'd be glad to hear those too (to increase my
understanding of ACPI!).

Anyway--thanks ahead of time. Weee.



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ACPI+Userspace
  2005-06-13 23:37 ACPI+Userspace Jeremy Moles
@ 2005-06-19 18:05 ` Jeremy Moles
  2005-06-19 18:08   ` ACPI+Userspace Jeremy Moles
  0 siblings, 1 reply; 4+ messages in thread
From: Jeremy Moles @ 2005-06-19 18:05 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Well, spent some time Friday night and went ahead and did it. README
included, along with some stuff in the source which may/may not be
correct. :/ In particular, the sscanf may be hackish... I do mostly C++
and python code, so I'm not that good C string stuff. All comments are
welcome.

P.S. The Makefile has "make in" and "make out" targets. Any OS that lets
you type "make out" at a commandline--and then do something
interesting--is just fine by me. :)

On Mon, 2005-06-13 at 19:37 -0400, Jeremy Moles wrote:
> Hello all--quick question.
> 
> As bad as it may seem, I was wondering if it is possible to generate
> ACPI events in userspace? That is: propogate any arbitrary "string" up
> through the ACPI subsystem, eventually getting dumped
> to /proc/acpi/event which, in our case, is being watched and acted on by
> the userspace util ACPID.
> 
> The obvious answer is: "Call /etc/acpi/hander with your string!"--which
> is always an option--but I'd like to know if it's possible simply to use
> for testing/debugging. I could write a driver supporting ioctls to pass
> stuff via acpi_bus_generate_event (I think?), but that's wayyy too much
> work for what I'm wanting this for. I'm sure there are reasons this
> isn't a good idea, and I'd be glad to hear those too (to increase my
> understanding of ACPI!).
> 
> Anyway--thanks ahead of time. Weee.
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
> a projector? How fast can you ride your desk chair down the office luge track?
> If you want to score the big prize, get to know the little guy.  
> Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
> _______________________________________________
> Acpi-devel mailing list
> Acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/acpi-devel



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ACPI+Userspace
  2005-06-19 18:05 ` ACPI+Userspace Jeremy Moles
@ 2005-06-19 18:08   ` Jeremy Moles
  2005-06-19 18:19     ` ACPI+Userspace Jeremy Moles
  0 siblings, 1 reply; 4+ messages in thread
From: Jeremy Moles @ 2005-06-19 18:08 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

[-- Attachment #1: Type: text/plain, Size: 2626 bytes --]

Here's the package.

On Sun, 2005-06-19 at 14:05 -0400, Jeremy Moles wrote:
> Well, spent some time Friday night and went ahead and did it. README
> included, along with some stuff in the source which may/may not be
> correct. :/ In particular, the sscanf may be hackish... I do mostly C++
> and python code, so I'm not that good C string stuff. All comments are
> welcome.
> 
> P.S. The Makefile has "make in" and "make out" targets. Any OS that lets
> you type "make out" at a commandline--and then do something
> interesting--is just fine by me. :)
> 
> On Mon, 2005-06-13 at 19:37 -0400, Jeremy Moles wrote:
> > Hello all--quick question.
> > 
> > As bad as it may seem, I was wondering if it is possible to generate
> > ACPI events in userspace? That is: propogate any arbitrary "string" up
> > through the ACPI subsystem, eventually getting dumped
> > to /proc/acpi/event which, in our case, is being watched and acted on by
> > the userspace util ACPID.
> > 
> > The obvious answer is: "Call /etc/acpi/hander with your string!"--which
> > is always an option--but I'd like to know if it's possible simply to use
> > for testing/debugging. I could write a driver supporting ioctls to pass
> > stuff via acpi_bus_generate_event (I think?), but that's wayyy too much
> > work for what I'm wanting this for. I'm sure there are reasons this
> > isn't a good idea, and I'd be glad to hear those too (to increase my
> > understanding of ACPI!).
> > 
> > Anyway--thanks ahead of time. Weee.
> > 
> > 
> > 
> > -------------------------------------------------------
> > This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
> > a projector? How fast can you ride your desk chair down the office luge track?
> > If you want to score the big prize, get to know the little guy.  
> > Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
> > _______________________________________________
> > Acpi-devel mailing list
> > Acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> > https://lists.sourceforge.net/lists/listinfo/acpi-devel
> 
> 
> 
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> Acpi-devel mailing list
> Acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/acpi-devel

[-- Attachment #2: acpievgen.tbz2 --]
[-- Type: application/x-bzip, Size: 2725 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ACPI+Userspace
  2005-06-19 18:08   ` ACPI+Userspace Jeremy Moles
@ 2005-06-19 18:19     ` Jeremy Moles
  0 siblings, 0 replies; 4+ messages in thread
From: Jeremy Moles @ 2005-06-19 18:19 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Last thing (not trying to spam), here's a simple usage summation:

1. make
2. make install
3. modprobe acpievgen
3. echo "devicename BUSID 1 2" > /proc/acpi/evgen

The event comes back up through the event interface to be parsed by
whatever. The echo doesn't have to be exactly an ACPI event string, but
the arguments get assigned positionally, delimited by spaces.

On Sun, 2005-06-19 at 14:08 -0400, Jeremy Moles wrote:
> Here's the package.
> 
> On Sun, 2005-06-19 at 14:05 -0400, Jeremy Moles wrote:
> > Well, spent some time Friday night and went ahead and did it. README
> > included, along with some stuff in the source which may/may not be
> > correct. :/ In particular, the sscanf may be hackish... I do mostly C++
> > and python code, so I'm not that good C string stuff. All comments are
> > welcome.
> > 
> > P.S. The Makefile has "make in" and "make out" targets. Any OS that lets
> > you type "make out" at a commandline--and then do something
> > interesting--is just fine by me. :)
> > 
> > On Mon, 2005-06-13 at 19:37 -0400, Jeremy Moles wrote:
> > > Hello all--quick question.
> > > 
> > > As bad as it may seem, I was wondering if it is possible to generate
> > > ACPI events in userspace? That is: propogate any arbitrary "string" up
> > > through the ACPI subsystem, eventually getting dumped
> > > to /proc/acpi/event which, in our case, is being watched and acted on by
> > > the userspace util ACPID.
> > > 
> > > The obvious answer is: "Call /etc/acpi/hander with your string!"--which
> > > is always an option--but I'd like to know if it's possible simply to use
> > > for testing/debugging. I could write a driver supporting ioctls to pass
> > > stuff via acpi_bus_generate_event (I think?), but that's wayyy too much
> > > work for what I'm wanting this for. I'm sure there are reasons this
> > > isn't a good idea, and I'd be glad to hear those too (to increase my
> > > understanding of ACPI!).
> > > 
> > > Anyway--thanks ahead of time. Weee.
> > > 
> > > 
> > > 
> > > -------------------------------------------------------
> > > This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
> > > a projector? How fast can you ride your desk chair down the office luge track?
> > > If you want to score the big prize, get to know the little guy.  
> > > Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
> > > _______________________________________________
> > > Acpi-devel mailing list
> > > Acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> > > https://lists.sourceforge.net/lists/listinfo/acpi-devel
> > 
> > 
> > 
> > -------------------------------------------------------
> > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> > from IBM. Find simple to follow Roadmaps, straightforward articles,
> > informative Webcasts and more! Get everything you need to get up to
> > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> > _______________________________________________
> > Acpi-devel mailing list
> > Acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> > https://lists.sourceforge.net/lists/listinfo/acpi-devel



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-06-19 18:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-13 23:37 ACPI+Userspace Jeremy Moles
2005-06-19 18:05 ` ACPI+Userspace Jeremy Moles
2005-06-19 18:08   ` ACPI+Userspace Jeremy Moles
2005-06-19 18:19     ` ACPI+Userspace Jeremy Moles

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox