acpi dsdt dump utility

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
Post Reply
User avatar
BenLunt
Member
Member
Posts: 941
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

acpi dsdt dump utility

Post by BenLunt »

A fellow coder grabbed my bootable image, wrote it to a USB thumb drive, and booted it on a laptop. It made it to the point where I parse the ACPI/AML data and froze.

I asked if they would dump the DSDT table(s) for me and send them my way. Come to find out, this user does not have any OS currently installed on that laptop so all bootups must be from a USB thumb drive.

Intel currently has freely available utilities for both Windows and *nix platforms that will extract the DSDT tables. However, the disadvantage in this case is that the user doesn't have either platform installed.

I could easily write a DOS app that would find the DSDT and dump it to a file, place it on a FreeDOS formatted thumb drive (image) and ask this user to go that route.

However, I am sure that there is someone here that has already done this. Therefore, I am asking if someone has and is willing to share it. All it needs to do is find the DSDT and of course the AML that follows it and write it to a file.

With this in mind, I went debugging and testing my current implementation of my AML parser and went looking for available DSDT.DAT files, courtesy of the utilities mentioned above.

In case someone else is looking for the same, I found a few rather large/complex ones:
https://kevinlocke.name/misc/t430-acpi/
https://github.com/Lekensteyn/acpi-stuf ... levo_B7130

If anyone knows of others, will you please let me know so that I can add them to this list as well as test my code?

Thanks,
Ben
Korona
Member
Member
Posts: 1000
Joined: Thu May 17, 2007 1:27 pm
Contact:

Re: acpi dsdt dump utility

Post by Korona »

We (= active developers of LAI) just use Intel's acpidump. It's available from all Linux distros and ACPICA's website hosts Windows binaries. I would expect users to be more inclined towards using a tools from their distro's repository than an obscure tool that you need to run on FreeDOS (does FreeDOS even boot on UEFI?). You're just reinventing the wheel here.

We also make heavy use of iasl -l which gives you a AML disassembly annotated with instruction offsets. LAI has a tracing mode that outputs instruction offsets, so it's very easy to see where things break. iasl is also used to assemble the tests that our CI runs.

Regarding DSDT files: I have a collection but I don't think that we're allowed to publish it - that is IP of the BIOS vendor.
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].
User avatar
BenLunt
Member
Member
Posts: 941
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: acpi dsdt dump utility

Post by BenLunt »

Hi Korona,

I agree and use Intel's distribution as well. However, as stated before, this particular user does not have anything installed on this particular laptop, so they cannot simply download and use said utilities.

This user is the only one as of yet to have a problem with my AML parser code. I am looking for a way to get the AML code from this laptop without much effort on his/her part.

Therefore, I was just asking if anyone had written a small utility that ran in DOS or was bootable from a USB drive that would retrieve it for me. Yes, one could write a small *nix distro to the USB, but this would involve a hefty download on their part, which I don't think they are willing to do, just to get the AML code.

If I feel it to be worth the trouble, I may just put one together on a bootable FreeDOS image and ask them to go that route.

Thanks,
Ben
nullplan
Member
Member
Posts: 1766
Joined: Wed Aug 30, 2017 8:24 am

Re: acpi dsdt dump utility

Post by nullplan »

BenLunt wrote:I agree and use Intel's distribution as well. However, as stated before, this particular user does not have anything installed on this particular laptop, so they cannot simply download and use said utilities.
Linux Live distributions exist. You can download stuff onto a USB stick and boot from it, and you get a running Linux. Enough to run acpidump.
Carpe diem!
User avatar
BenLunt
Member
Member
Posts: 941
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: acpi dsdt dump utility

Post by BenLunt »

BenLunt wrote:I could easily write a DOS app that would find the DSDT and dump it to a file, place it on a FreeDOS formatted thumb drive (image) and ask this user to go that route.
I must be losing my mind. In updating some code and files, I came across this exact utility I had written so many years ago that does exactly what I asked for. (Anyone seen my Marbles?)

Anyway, it is for Legacy BIOS only, not UEFI. It should work for the current circumstances.

Sorry for the bother....

Ben
User avatar
BenLunt
Member
Member
Posts: 941
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: acpi dsdt dump utility

Post by BenLunt »

Just for your interest, if someone else is working on their AML parser code and needs some example DSDT files, I found 40+ files at https://groups.google.com/forum/#!topic ... GLBaYUIw3Y. Yes they are for android tablets, but AML is AML. :-)

Ben
User avatar
BenLunt
Member
Member
Posts: 941
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: acpi dsdt dump utility

Post by BenLunt »

Korona wrote:We (= active developers of LAI) just use Intel's acpidump. It's available from all Linux distros and ACPICA's website hosts Windows binaries. I would expect users to be more inclined towards using a tools from their distro's repository than an obscure tool that you need to run on FreeDOS (does FreeDOS even boot on UEFI?). You're just reinventing the wheel here.

We also make heavy use of iasl -l which gives you a AML disassembly annotated with instruction offsets. LAI has a tracing mode that outputs instruction offsets, so it's very easy to see where things break. iasl is also used to assemble the tests that our CI runs.

Regarding DSDT files: I have a collection but I don't think that we're allowed to publish it - that is IP of the BIOS vendor.
Korona,

Just a small observation, I think you might have a bug in the code at line 138

https://github.com/qword-os/lai/blob/ma ... xec.c#L138

You place the two operands in the same variable.

Code: Select all

       lai_exec_get_integer(state, &operands[1], &offset);
       lai_exec_get_integer(state, &operands[2], &offset);
Should it be the following instead?

Code: Select all

       lai_exec_get_integer(state, &operands[1], &offset);
       lai_exec_get_integer(state, &operands[2], &size);
Just checking. I don't know your code that well to be sure.

Ben
Korona
Member
Member
Posts: 1000
Joined: Thu May 17, 2007 1:27 pm
Contact:

Re: acpi dsdt dump utility

Post by Korona »

Thanks indeed a bug. Good catch! Thank you for pointing this out.
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].
Post Reply