OSDev.org

The Place to Start for Operating System Developers
It is currently Sun Apr 28, 2024 12:01 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Seemingly invalid ACPI value - How is This Interpreted?
PostPosted: Sun Aug 20, 2023 5:50 pm 
Offline

Joined: Sat Jun 18, 2022 11:38 pm
Posts: 17
So I've been attempting to parse AML tables, and am making pretty good progress - but there seems to be one outlier in the values given so far. My version of QEMU appears to be running ACPI v1.0, but this specification does not appear to differ between ACPI revisions.

As per ACPI spec 10b: https://uefi.org/sites/default/files/resources/ACPI_1_Errata_B.pdf, the following structure is to be maintained:
Quote:
DefOpRegion := OpRegionOp NameString RegionSpace RegionOffset RegionLen
OpRegionOp := ExtOpPrefix 0x80
ExtOpPrefix := 0x5B


And by extension, we can derive that the structure of a DefOpRegion should start with:
Quote:
0x5B 0x80 NameString RegionSpace RegionOffset RegionLen


Here are the 10 bytes around the byte I'm trying to understand, with the odd byte >highlighted< :
Code:
0x4 0x5C 0x0 0x5B 0x80 >0x44< 0x42 0x47 0x5F 0x1

(0x4 is irrelevant, 0x5C 0x0 is the NULL NAME identifier from a ScopeOp containing this code)

So the 0x5B 0x80 is present, but the next byte is 0x44 - which doesn't seem to fit the NameString definition required next:
Quote:
NameString := <RootChar NamePath> | <PrefixPath NamePath>
RootChar := ‘\’
PrefixPath := Nothing | <‘^’ PrefixPath>


...so the next char should either be '\\' or '^', which means 'D' really shouldn't be there. Hopefully this is enough information to be complete, but I'm not quite understanding how I'm supposed to parse this 0x44 byte. Any help would be much appreciated, as I'm relatively new to AML parsing!

Edit with further testing:
I now have encountered another problem - the same thing happens on real hardware with a DefName, this time with 0x45 ('E'). It sort of looks like sometimes NameString is actually a NameSeg? Testing it more right now.


Last edited by minater247 on Sun Aug 20, 2023 6:29 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Seemingly invalid ACPI value - How is This Interpreted?
PostPosted: Sun Aug 20, 2023 6:26 pm 
Offline
Member
Member
User avatar

Joined: Fri Feb 17, 2017 4:01 pm
Posts: 642
Location: Ukraine, Bachmut
just a quick observation - PrefixPath can be nothing, which implies, NameString doesn't necessarily need to start either with \ or ^.

_________________
ANT - NT-like OS for x64 and arm64.
efify - UEFI for a couple of boards (mips and arm). suspended due to lost of all the target park boards (russians destroyed our town).


Top
 Profile  
 
 Post subject: Re: Seemingly invalid ACPI value - How is This Interpreted?
PostPosted: Sun Aug 20, 2023 6:31 pm 
Offline

Joined: Sat Jun 18, 2022 11:38 pm
Posts: 17
I hadn't quite interpreted the manual that way - but that makes complete sense, and correlates with the edit I just made to the first post! I guess it just starts with the next portion. Thank you so much for the help!


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 13 guests


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