Skip to content

Add ability to disable comments containing binary text in disassembler #970

Open

Description

@JL2210

I'm parsing the output of iasl -d to extract the binary MOF data from it (the data provided by the Linux kernel for my platform is inaccurate, for some reason), and I do this by searching the file for 0x. Unfortunately, in rare occurrences, the comments after the actual data can contain 0x, and I don't see a way to disable this.

Example:

ssdt1.dsl:            /* 0150 */  0xFD, 0x30, 0x78, 0xCA, 0xDA, 0xDA, 0x03, 0xCF,  // .0x.....

I think it's here that does it? https://github.com/acpica/acpica/blob/a431656d480b795a6bf2083de4deed1ff71e2c2e/source/components/utilities/utbuffer.c#L261-L299

And this is probably where it's called from https://github.com/acpica/acpica/blob/a431656d480b795a6bf2083de4deed1ff71e2c2e/source/components/disassembler/dmwalk.c#L564-L567

Activity

  1. SaketADumbre commented on Aug 29, 2024

    @SaketADumbre
    Contributor

    I can take a look at this next week after the long weekend here in the US (extra long weekend for me since I am taking the day off tomorrow) and if needed get more info on or push a commit with a fix for this, thanks!

  2. JL2210 commented on Aug 29, 2024

    @JL2210
    Author

    I think I've mostly figured it out, just not too sure where exactly to put the flag/what to name the variable that it sets. I'll make a PR once I get it working and go from there.

  3. SaketADumbre commented on Aug 29, 2024

    @SaketADumbre
    Contributor

    Sounds good, thanks a lot!

  4. JL2210 commented on Aug 29, 2024

    @JL2210
    Author

    You can still implement this if you want, but I just realized I no longer have a need for it. Turns out the tool I was using to decompress the BMOF does work, but the tool to turn the decompressed BMOF into text-based MOF doesn't...

  5. Wer-Wolf commented on Aug 30, 2024

    @Wer-Wolf
    Contributor

    Do you use the bmfdec utilities? How do you extract the binary MOF data?

  6. Wer-Wolf commented on Aug 30, 2024

    @Wer-Wolf
    Contributor

    Also, can you send me:

    • the output of acpidump
    • the content of the kernel-supplied bmof data

    I am the maintainer of the WMI subsystem, so i might be able to help you.

  7. JL2210 commented on Aug 30, 2024

    @JL2210
    Author

    Thanks! At first I was using bmfdec, then I switched to a modified fork of it that works on the asl dump from RWEverything (for Windows). After that I went back to Linux to see if I could get the same info, and copied the kernel-supplied bmof data from /sys/devices/platform/PNP0C14:xyz/wmi_bus/wmi_bus-PNP0C14:xyz/05901221-D566-11D1-B2F0-00A0C9062910-xyz/bmof

    I think I ended up figuring it out, but I'll post these anyway:

    acpidump hex dump

    The BMOF data stored in that is mostly in the DSDT, but some is in SSDT2 as well.

    This is the bmof data from the kernel (or at least the one I'm interested in):
    bmof09.zip

    What I was confused by is that the output of bmfparse lists the methods starting at zero while their IDs actually start at 13:

      Method 0:
        Name=Return_OverclockingReport
        Qualifier 0:
          Name=WmiMethodId
          Flavors:
            ToInstance=FALSE
            ToSubclass=FALSE
            DisableOverride=FALSE
            Amended=FALSE
          Type=Numeric
          Value=13
    ...
    
      [WmiMethodId(13), Implemented, read, write, Description("Return Overclocking Report.")] void Return_OverclockingReport([out] uint32 argr);
    

    And maybe a little bit of misreading the windows code that interfaces with WMI, heh. It does end up referencing the methods' names, after about 4 layers of 1d/2d lookup tables.

    Now I just have to add something to alienware-wmi to allow interfacing with these from userspace. Unfortunately there's not a dumb driver like acpi_call to do this as a stop-gap.

  8. Wer-Wolf commented on Aug 30, 2024

    @Wer-Wolf
    Contributor

    Maybe you want to use bmf2mof? The other utility does next to no postprocessing.

  9. JL2210 commented on Aug 30, 2024

    @JL2210
    Author

    Yep, that puts it in a human-readable format. I thought I needed IDs 0-12 but it turns out I was looking in the wrong place

  10. Wer-Wolf commented on Aug 30, 2024

    @Wer-Wolf
    Contributor

    Regarding a dump driver lile acpi_call: i am currently working on something similar, but it will take some time since i have to reverse-engineer some details of the ACPI-WMI interface.

  11. SaketADumbre commented on Sep 13, 2024

    @SaketADumbre
    Contributor

    Hey @Wer-Wolf thanks a lot for taking a look at this and nice to have you as the maintainer of the ACPI WMI subsystem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions