From: "Pali Rohár" <pali.rohar@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Mario.Limonciello@dell.com, luto@kernel.org,
dvhart@infradead.org, hch@infradead.org,
torvalds@linux-foundation.org, andriy.shevchenko@linux.intel.com,
rjw@rjwysocki.net, linux-kernel@vger.kernel.org,
platform-driver-x86@vger.kernel.org
Subject: Re: WMI and Kernel:User interface
Date: Tue, 13 Jun 2017 19:43:22 +0200 [thread overview]
Message-ID: <201706131943.22554@pali> (raw)
In-Reply-To: <20170613165714.GB32546@kroah.com>
[-- Attachment #1: Type: Text/Plain, Size: 1919 bytes --]
Hi Greg! I will try to explain that problem with calling WMI functions.
On Tuesday 13 June 2017 18:57:14 Greg KH wrote:
> > Getting there requires work in a few areas:
> > 1) The OEM/IBV exports the methods and the MOF (in binary form)
> > that describes the objects that can be interacted with and what
> > kind of data needs to be sent.
>
> What do you mean by this?
In ACPI is stored buffer with binary MOF data. Those data contains
description WMI object system where are classes with methods and
attributes (similar to C++). Then there are stored mapping from
particular class method/attribute to WMI id.
If you want to call WMI method (which is basically ACPI method), you
need to know WMI id and call specific ACPI method with that id and other
magic.
Taking those magic values is not easy and WMI kernel drivers just
reverse engineered them from ACPI bytecode or other method.
But correct way is to parse that binary MOF data and build mapping from
classes, methods and attributes to WMI ids (needed for raw ACPI call).
Problem is that format of those binary MOF data is unknown (generated by
program mofcomp.exe available in all MS Windows systems), but finally I
was able to guess its structure and write "decompiler".
Search for email with subject "Binary MOF buffer in WMI is finally
decoded!" for more details which I sent week ago to LKML.
> > 2) Kernel needs to provide a way to userspace to get to this data
>
> Why, what can userspace do with this?
Userspace want to call WMI method "Method1" from WMI class "Class1" from
namespace "Namespace1". And wants to know signature of that Method1,
what are input arguments, what are outputs...
Those MOF data contains descriptions of arguments and also information
which ACPI method with which WMI id needs to be called to execute above
"Method1".
--
Pali Rohár
pali.rohar@gmail.com
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2017-06-13 17:43 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-09 23:16 WMI and Kernel:User interface Darren Hart
2017-05-10 5:13 ` Greg Kroah-Hartman
2017-05-10 6:11 ` Darren Hart
2017-05-10 22:02 ` Mario.Limonciello
2017-05-10 22:11 ` Darren Hart
2017-05-10 22:50 ` Andy Lutomirski
2017-05-10 23:23 ` Darren Hart
2017-05-10 23:27 ` Darren Hart
2017-06-03 19:50 ` Darren Hart
2017-06-09 6:41 ` Greg Kroah-Hartman
2017-06-10 0:46 ` Darren Hart
2017-06-10 10:36 ` Pali Rohár
2017-06-12 17:02 ` Darren Hart
2017-06-12 22:17 ` Pali Rohár
2017-06-13 1:24 ` Darren Hart
2017-06-13 7:05 ` Christoph Hellwig
2017-06-13 12:07 ` Pali Rohár
2017-06-13 15:44 ` Darren Hart
2017-06-13 16:05 ` Greg Kroah-Hartman
2017-06-13 16:24 ` Darren Hart
2017-06-13 15:38 ` Darren Hart
2017-06-13 15:50 ` Greg Kroah-Hartman
2017-06-13 15:56 ` Andy Lutomirski
2017-06-13 16:12 ` Mario.Limonciello
2017-06-13 16:57 ` Greg KH
2017-06-13 17:43 ` Pali Rohár [this message]
2017-06-13 16:39 ` Darren Hart
2017-06-13 16:22 ` Darren Hart
2017-06-13 16:52 ` Greg Kroah-Hartman
2017-06-13 17:07 ` Darren Hart
2017-06-14 4:38 ` Greg Kroah-Hartman
2017-06-19 22:10 ` Andy Lutomirski
2017-06-20 3:37 ` Darren Hart
2017-06-20 7:29 ` Pali Rohár
2017-06-13 17:16 ` Pali Rohár
2017-06-13 17:40 ` Darren Hart
2017-06-13 18:00 ` Pali Rohár
2017-06-13 18:09 ` Darren Hart
2017-06-14 0:28 ` Bernd Petrovitsch
2017-06-13 12:51 ` Pali Rohár
2017-06-13 16:07 ` Darren Hart
2017-06-19 21:24 ` Matthew Garrett
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201706131943.22554@pali \
--to=pali.rohar@gmail.com \
--cc=Mario.Limonciello@dell.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dvhart@infradead.org \
--cc=gregkh@linuxfoundation.org \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox