All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali.rohar@gmail.com>
To: Darren Hart <dvhart@infradead.org>,
	Mario.Limonciello@dell.com, Rafael Wysocki <rjw@rjwysocki.net>,
	Andy Lutomirski <luto@amacapital.net>,
	andriy.shevchenko@linux.intel.com
Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Binary MOF buffer in WMI is finally decoded!
Date: Sun, 4 Jun 2017 18:09:21 +0200	[thread overview]
Message-ID: <201706041809.21573@pali> (raw)

[-- Attachment #1: Type: Text/Plain, Size: 1657 bytes --]

Hi!

As already mentioned in RFC: WMI Enhancements thread [1], I looked at 
binary MOF buffer used by WMI which is included in ACPI DSDT table.

That binary MOF buffer contains description of WMI methods and 
structures used by ACPI-WMI. It also contains mapping from human 
readable function names to ACPI-WMI magical numbers used for calling WMI 
methods via ACPI.

Basically in that binary MOF buffer is description of structures used as 
input and output arguments for WMI methods/function calls.

Until now, there were not information nor any parser of those binary MOF 
files (.bmf file). There is some Microsoft proprietary tool which can 
compile text MOF file to binary and vice versa.

I was able to decode that binary MOF format and wrote simple bmfparse 
tool. It is available in git repository [2]. Currently parsing of 
function parameters is not implemented yet.

Binary MOF format is compressed by prehistoric DS-01 algorithm 
(modification of LZ-77) which was used as compression algorithm for 
FAT-16. Maybe you remember DMSDOS or DoubleSpace... After decompression, 
the whole format is so shitty, probably half of data are just lengths of 
sub structures and sub-sub-... structures.

I hope this bmfparse program would help in writing new wmi drivers for 
Linux or inspection of available WMI methods.

Probably we could implement parser of BMOF in kernel and allow 
validation of function parameters or usage of human readable names of 
WMI methods?

[1] - https://www.spinics.net/lists/platform-driver-x86/msg11574.html
[2] - https://github.com/pali/bmfdec

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

             reply	other threads:[~2017-06-04 16:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-04 16:09 Pali Rohár [this message]
2017-06-05 22:08 ` Binary MOF buffer in WMI is finally decoded! Pali Rohár
2017-06-16 12:53   ` Pali Rohár

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=201706041809.21573@pali \
    --to=pali.rohar@gmail.com \
    --cc=Mario.Limonciello@dell.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=dvhart@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.