OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Oct 22, 2020 5:33 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: acpi dsdt dump utility
PostPosted: Wed Jul 29, 2020 7:14 pm 
Offline
Member
Member
User avatar

Joined: Sat Nov 22, 2014 6:33 pm
Posts: 717
Location: USA
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


Top
 Profile  
 
 Post subject: Re: acpi dsdt dump utility
PostPosted: Wed Jul 29, 2020 11:06 pm 
Offline
Member
Member

Joined: Thu May 17, 2007 1:27 pm
Posts: 747
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].


Top
 Profile  
 
 Post subject: Re: acpi dsdt dump utility
PostPosted: Thu Jul 30, 2020 8:50 pm 
Offline
Member
Member
User avatar

Joined: Sat Nov 22, 2014 6:33 pm
Posts: 717
Location: USA
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


Top
 Profile  
 
 Post subject: Re: acpi dsdt dump utility
PostPosted: Fri Jul 31, 2020 12:02 am 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 667
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.

_________________
Thou hast outraged, not insulted me, sir; but for that I ask thee not to beware of Starbuck; thou wouldst but laugh; but let Ahab beware of Ahab; beware of thyself, old man.


Top
 Profile  
 
 Post subject: Re: acpi dsdt dump utility
PostPosted: Sat Aug 01, 2020 7:21 pm 
Offline
Member
Member
User avatar

Joined: Sat Nov 22, 2014 6:33 pm
Posts: 717
Location: USA
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


Top
 Profile  
 
 Post subject: Re: acpi dsdt dump utility
PostPosted: Sat Aug 08, 2020 1:43 pm 
Offline
Member
Member
User avatar

Joined: Sat Nov 22, 2014 6:33 pm
Posts: 717
Location: USA
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


Top
 Profile  
 
 Post subject: Re: acpi dsdt dump utility
PostPosted: Sat Aug 08, 2020 3:11 pm 
Offline
Member
Member
User avatar

Joined: Sat Nov 22, 2014 6:33 pm
Posts: 717
Location: USA
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:
       lai_exec_get_integer(state, &operands[1], &offset);
       lai_exec_get_integer(state, &operands[2], &offset);

Should it be the following instead?

Code:
       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


Top
 Profile  
 
 Post subject: Re: acpi dsdt dump utility
PostPosted: Tue Aug 11, 2020 1:22 pm 
Offline
Member
Member

Joined: Thu May 17, 2007 1:27 pm
Posts: 747
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].


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group