[File] Magdir for ACPI Machine Language file; *.aml

Jörg Jenderek joerg.jen.der.ek at gmx.net
Thu Apr 16 22:27:13 UTC 2020


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

some days ago i looked inside my qemu directory. There i found a file
with name extension aml which is not recognized by file command. So i
look for more such files on my systems. When running file command
version 5.38 on such documents these examples are described as "data".

According to websites file-extensions.org and fileinfo.com such files
are ACPI Machine Language files. So i use that description in
definition. Some information is found on ACPI page on Wikipedia. That
is expressed by URL line like:
 # en.wikipedia.org/wiki/Advanced_Configuration_and_Power_Interface
According to the mentioned Advanced Configuration and Power Interface
Specification Revision 6.3 the file format is described. So i add a
reference URL comment line like
 # uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf

My few real examples are Differentiated System Description Tables,
which are characterized at the beginning by characteristic upcased
text DSDT. That is used as first test line like
 0	string		DSDT
 >0	use		acpi-table
 0	name		acpi-table

Because the described file format is also used for other ACPI tables
like SLIC and SSDT i encapsulate displaying part inside sub routine
acpi-table.
Unfortunately this is still not unique enough. To skip ASCII text
starting with phrase DSDT look for valid "low" revision like by test
line like
 >8	ubyte		<17	ACPI Machine Language file

The size of such ACPI tables is stored as 4 byte integer at offset
4. So in theory the upper limit limit is 4 GiB, but in reality only
lower sizes like 21469 appear. Because ACPI tables are part of PC
BIOS it can be assumed that ACPI tables size are lower than 16 MiB
limit for example. That maybe can used as alternative or second test
by line like
 >4	ulelong		<0x01000000
Afterwards show 4 byte table signature like DSDT, a user defined
mime type and file name extension by lines
 >>0	string		x	'%.4s'
 !:mime	application/x-intel-aml
 !:ext	aml

The stored size or length of the entire AML files including the
header is also shown by line like:
 >>4	ulelong		x	\b, %u bytes

According to specification revision byte at offset 8 has a meaning
for the AML interpreter. Values less than two will cause the
interpreter to use 32-bit integers and math. Values of two and
greater will cause the interpreter to use full 64-bit integers and
math. For my DSDT examples i only found value 1 and 2, but for
example asf!.aml found in test suite acpitests-unix-20200326 value
is 16. So show that information by line
 >>8	ubyte		x	\b, revision %u

My examples were created by iasl(1) ACPI tool found on acpica.org web
site. On Linux systems such tables from BIOS can be generated by
command	like:
	cat /sys/firmware/acpi/tables/DSDT MyDSDT.aml
This tool use the Vendor ID INTL and the revision number of the ASL
Compiler is here also used as timestamp like 20100528 in example
DSDT-suse15-vb.aml. That information if available is shown by lines
like
 >>28	string		>\0	\b, created by %.4s
 >>>32	ulelong		x	%x
But for similar files like SLIC.bin i also found vendor ID MSFT
with non time-stamped revision number and sometimes there is no
creator id like in facs.aml.

If available show manufacture model ID like VBOXBIOS (VirtualBox),
BXDSDT (qemu), the revision of table (some times interpreted as
time stamp like 20090511 in example grammar.aml) and OEM ID like
INTEL, VBOX (VirtualBox), BXDSDT (qemu), MEDION, etc. by lines like:
 >>16	string		>\0	%.8s
 >>>24	ulelong		x	%x
 >>10	ubyte		>040	by %c
 >>>11		ubyte	>040	\b%c
 >>>>12		ubyte	>040	\b%c
 >>>>>13	ubyte	>040	\b%c
 >>>>>>14	ubyte	>040	\b%c
 >>>>>>>15	ubyte	>040	\b%c

After applying the above mentioned modifications by appended DSDT.txt
then all inspected ACPI Machine Language file examples are now
described correctly and i get an output like:

asf!.aml:              ACPI Machine Language file 'ASF!'
		       TEMPLATE 1 by INTEL, revision 16,
		       114 bytes, created by INTL 20190703
DSDT-suse15-vb.aml:    ACPI Machine Language file 'DSDT'
		       VBOXBIOS 2 by VBOX, revision 2,
		       8997 bytes, created by INTL 20100528
DSDT-tables-acpi.aml:  ACPI Machine Language file 'DSDT'
		       MEDIONAG 0 by MEDION, revision 1,
		       21469 bytes, created by INTL 20051117
grammar.aml:           ACPI Machine Language file 'DSDT'
		       GRMTEST 20090511 by Intel, revision 1,
		       43758 bytes, created by INTL 20200110
q35-acpi-dsdt.aml:     ACPI Machine Language file 'DSDT'
		       BXDSDT 2 by BXPC, revision 1,
		       7344 bytes, created by INTL 20100528
DSDT.text:             ASCII text, with CRLF line terminators
SLIC.bin:              ACPI Machine Language file 'SLIC'
		       MEDIONAG 6222004 by MEDION, revision 1,
		       374 bytes, created by MSFT 97
SSDT3.bin:             ACPI Machine Language file 'SSDT'
		       Cpu1Tst 3000 by PmRef, revision 2,
		       160 bytes, created by INTL 20051117
facs.aml:              ACPI Machine Language file 'FACS'
		       revision 0,
		       64 bytes

Because file format is used mainly inside BIOS of PC it can go to
Magdir/intel. Or because by such tables the Computer abilities are
described magic lines maybe belong to Magdir/hardware.

I hope my lines for Magdir can be applied in future version of file
utility.

With best wishes
Jörg Jenderek
- --
Jörg Jenderek






-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iF0EARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCXpjbowAKCRCv8rHJQhrU
1s0mAJ4unlLbaKxWVr5nQRxrSAtvZ8wWTQCeNr5z60tBBBXUfx+2GtQbYhEr8s8=
=NfP0
-----END PGP SIGNATURE-----
-------------- next part --------------
# From: 	Joerg Jenderek
# URL:		https://en.wikipedia.org/wiki/Advanced_Configuration_and_Power_Interface
# Reference:	https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf
# Note:		generated for example by `cat /sys/firmware/acpi/tables/DSDT MyDSDT.aml`
0	string		DSDT
>0	use		acpi-table
# not tested or other file format
0	string		APIC
>0	use		acpi-table
#0	string		ASF!
#>0	use		acpi-table
0	string		FACP
>0	use		acpi-table
#0	string		FACS
#>0	use		acpi-table
0	string		MCFG
>0	use		acpi-table
0	string		SLIC
>0	use		acpi-table
0	string		SSDT
>0	use		acpi-table
0	name		acpi-table
# skip ASCII text starting with DSDT by looking for valid "low" revision
>8	ubyte		<17	ACPI Machine Language file
# assume that ACPI tables size are lower than 16 MiB
#>4	ulelong		<0x01000000
# DSDT for Differentiated System Description Table
>>0	string		x	'%.4s'
#!:mime	application/octet-stream
!:mime	application/x-intel-aml
!:ext	aml
# the manufacture model ID like: VBOXBIOS BXDSDT
>>16	string		>\0	%.8s
# OEM revision of DSDT for supplied OEM Table ID like: 0 1 2 20090511
>>>24	ulelong		x	%x
# OEM ID like: INTEL VBOX (VirtualBox) BXDSDT (qemu) MEDION or \030\001\0\0 for s3pt.aml
>>10	ubyte		>040	by %c
>>>11		ubyte	>040	\b%c
>>>>12		ubyte	>040	\b%c
>>>>>13		ubyte	>040	\b%c
>>>>>>14	ubyte	>040	\b%c
>>>>>>>15	ubyte	>040	\b%c
# This field also sets the global integer width for the AML interpreter.
# Values less than two will cause the interpreter to use 32-bit.
# Values of two and greater will cause the interpreter to use full 64-bit.
# 16 for asf!.aml, 67 fo rsdp.aml
>>8	ubyte		x	\b, revision %u
# length, in bytes, of the entire DSDT (including the header)
>>4	ulelong		x	\b, %u bytes
# entire table must sum to zero
#>>9	ubyte		x	\b, checksum 0x%x
# vendor ID for the ASL Compiler like: INTL MSFT ...
>>28	string		>\0	\b, created by %.4s
# revision number of the ASL Compiler like: 20051117 20140724 20190703 20200110 ...
>>>32	ulelong		x	%x

-------------- next part --------------
A non-text attachment was scrubbed...
Name: DSDT.txt.sig
Type: application/octet-stream
Size: 95 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20200417/0fd2a2b6/attachment.obj>


More information about the File mailing list