Iasl: acpi source Language Optimizing Compiler and Disassembler



Download 357.69 Kb.
Page3/8
Date conversion29.04.2016
Size357.69 Kb.
1   2   3   4   5   6   7   8

2Compiler/Disassembler Overview


The iASL compiler/disassembler consists of several distinct subsystems, as described below:

  • An integrated C-like preprocessor

  • An ASL-to-AML compiler that translates ASL code (ACPI Source Language) to AML byte code (ACPI Machine Language).

  • An ACPI Data Table compiler that translates Data Table definitions to binary ACPI tables. An ACPI Data Table is any ACPI table that contains only data, not AML byte code. Examples include the FADT, MADT, SRAT, etc.

  • An AML-to-ASL disassembler that translates compiled AML byte code back to the (nearly) original ASL source code. This disassembler is used on tables like the DSDT and SSDT.

  • An ACPI Data Table disassembler that formats binary ACPI data tables into a readable format. The output of this disassembler can be compiled with the ACPI data table compiler.

  • An ACPI table template generator that will emit examples of all known ACPI tables, in a format similar to the output of the data table disassembler. The output files from the template generator are intended to be used as the basis or starting point for the development of actual ACPI tables.

2.1Supported Execution Environments


iASL runs on multiple platforms as a 32-bit or 64-bit application.

Portable code – requires only ANSI C and a compiler generation package such as Bison/Flex or Yacc/Lex.

Error and warning messages are compatible with Microsoft Visual C++, allowing for integration of the compiler into the development environment to simplify project building and debug.

The iASL source code is distributed with the compiler binaries under the ACPICA source license.


2.2ASL Compiler

2.2.1Input Files


Existing ACPI ASL source files are fully supported. Enhanced compiler error checking will often uncover unknown problems in these files.

All ACPI 5.0 ASL additions and new ACPI tables are supported. The compiler fully supports ACPI 5.0.


2.2.2Output File Options


  • Preprocessed source code file

  • AML binary output file

  • AML code in C source code form for inclusion into a BIOS project

  • AML code in x86 assembly code form for inclusion into a BIOS project

  • AML Hex Table output file in either C, ASL, or x86 assembly code as a table initialization statement.

  • Listing file with source file line number, source statements, and intermixed generated AML code. Include files named in the original source ASL file are expanded within the listing file

  • Namespace output file — shows the ACPI namespace that corresponds to the input ASL file (and all include files.)

  • Debug parse trace output file — gives a trace of the parser and namespace during the compile. Used to debug problems in the compiler, or to help add new compiler features.

2.3AML Disassembler


The AML Disassembler has the capability of reverse translating any binary AML table back to nearly the original ASL code. These are typically DSDTs and SSDTs. It can also disassemble and format all other known non-AML data tables.

2.3.1Input Files


The AML Disassembler accepts binary ACPI tables that contain valid AML code. These tables are the DSDT and any SSDTs.

These files may be obtained via the acpidump/acpixtract utilities, or some other host-specific tools.


2.3.2Output


The output is disassembled (or de-compiled) ASL code. The file extension used for these output files is .DSL, meaning “disassembled ASL”. As opposed to original ASL source code files which typically have the extension .ASL.

2.4Data Table Compiler


The Data Table compiler is used to compile the “non-ASL/AML” ACPI tables such as the FADT, MADT, SRAT, etc. These tables are not compiled to AML byte code, but are compiled to simple binary data, usually with the standard ACPI table header (signature, length, checksum, etc.)

The intent of the Data Table Compiler is to simplify the generation of the many non-ASL ACPI data tables and to make the generation process less error-prone. The Data Table Compiler knows the required format for each recognized ACPI table, as well as the exact size and allowable values for each field within the tables.


2.4.1Input Files


The Data Table compiler accepts as input files that are in the same or simplified format as the files emitted by the data table disassembler. An existing ACPI binary data table may be disassembled, modified, and then recompiled.

Also, the ACPI table template generator may be used to generate template ACPI data tables that can in turn be used for the basis for additional table development. This would be the preferred starting point for ACPI table development, since the ACPI table templates contain a valid example of each table header, table section, and table sub-table as applicable.


2.4.2Output


  • Binary output file

  • Hex Table output file in either C, ASL, or x86 assembly code as a table initialization statement for inclusion into a BIOS project.

2.5Data Table Disassembler


This second part of the disassembler package will extract all data from a binary ACPI “data table” and format it into human readable form. The format of this output is compatible with the Data Table Compiler, meaning that such ACPI tables may be easily disassembled, modified, and recompiled.

2.5.1Input Files


The Data Table Disassembler accepts binary ACPI tables that do not contain AML code. These tables include the FADT, MADT, SRAT, etc.

2.5.2Output


The output is a disassembled and formatted ACPI table in human-readable format. The file extension used for these files is also .DSL, for consistency with the AML disassembler.

2.6Template Generator


The iASL Template Generator can be used to create ACPI tables from templates that are stored within the iASL image. These templates can be used as a starting point for the development of any ACPI table known to the compiler.
1   2   3   4   5   6   7   8


The database is protected by copyright ©essaydocs.org 2016
send message

    Main page