Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1665055

Re: WMI and Kernel:User interface

From Pali Rohár <pali.rohar@gmail.com>
Newsgroups linux.kernel
Subject Re: WMI and Kernel:User interface
Date 2017-06-13 19:50 +0200
Message-ID <tRY6Z-2tP-7@gated-at.bofh.it> (permalink)
References <tFmA9-5P-1@gated-at.bofh.it> <tRWHT-1JS-11@gated-at.bofh.it> <tRXkC-1WS-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: WMI and Kernel:User interface Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-09 08:50 +0200
  Re: WMI and Kernel:User interface Darren Hart <dvhart@infradead.org> - 2017-06-10 02:50 +0200
    Re: WMI and Kernel:User interface Pali Rohár <pali.rohar@gmail.com> - 2017-06-10 12:40 +0200
      Re: WMI and Kernel:User interface Darren Hart <dvhart@infradead.org> - 2017-06-12 19:10 +0200
        Re: WMI and Kernel:User interface Pali Rohár <pali.rohar@gmail.com> - 2017-06-13 00:20 +0200
          Re: WMI and Kernel:User interface Darren Hart <dvhart@infradead.org> - 2017-06-13 03:30 +0200
            Re: WMI and Kernel:User interface Christoph Hellwig <hch@infradead.org> - 2017-06-13 09:10 +0200
              Re: WMI and Kernel:User interface Pali Rohár <pali.rohar@gmail.com> - 2017-06-13 14:10 +0200
                Re: WMI and Kernel:User interface Darren Hart <dvhart@infradead.org> - 2017-06-13 17:50 +0200
                Re: WMI and Kernel:User interface Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-13 18:10 +0200
                Re: WMI and Kernel:User interface Darren Hart <dvhart@infradead.org> - 2017-06-13 18:30 +0200
              Re: WMI and Kernel:User interface Darren Hart <dvhart@infradead.org> - 2017-06-13 17:40 +0200
                Re: WMI and Kernel:User interface Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-13 18:00 +0200
                Re: WMI and Kernel:User interface Andy Lutomirski <luto@kernel.org> - 2017-06-13 18:00 +0200
                RE: WMI and Kernel:User interface <Mario.Limonciello@dell.com> - 2017-06-13 18:20 +0200
                Re: WMI and Kernel:User interface Greg KH <gregkh@linuxfoundation.org> - 2017-06-13 19:00 +0200
                Re: WMI and Kernel:User interface Pali Rohár <pali.rohar@gmail.com> - 2017-06-13 19:50 +0200
                Re: WMI and Kernel:User interface Darren Hart <dvhart@infradead.org> - 2017-06-13 18:50 +0200
                Re: WMI and Kernel:User interface Darren Hart <dvhart@infradead.org> - 2017-06-13 18:30 +0200
                Re: WMI and Kernel:User interface Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-13 19:00 +0200
                Re: WMI and Kernel:User interface Darren Hart <dvhart@infradead.org> - 2017-06-13 19:10 +0200
                Re: WMI and Kernel:User interface Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-14 06:40 +0200
                Re: WMI and Kernel:User interface Pali Rohár <pali.rohar@gmail.com> - 2017-06-13 19:20 +0200
                Re: WMI and Kernel:User interface Darren Hart <dvhart@infradead.org> - 2017-06-13 19:50 +0200
                Re: WMI and Kernel:User interface Darren Hart <dvhart@infradead.org> - 2017-06-13 20:10 +0200
                Re: WMI and Kernel:User interface Pali Rohár <pali.rohar@gmail.com> - 2017-06-13 20:10 +0200
                Re: WMI and Kernel:User interface Bernd Petrovitsch <bernd@petrovitsch.priv.at> - 2017-06-14 02:30 +0200
            Re: WMI and Kernel:User interface Pali Rohár <pali.rohar@gmail.com> - 2017-06-13 15:00 +0200
              Re: WMI and Kernel:User interface Darren Hart <dvhart@infradead.org> - 2017-06-13 18:10 +0200

csiph-web