audk/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib...

135 lines
6.0 KiB
Plaintext
Raw Normal View History

ShellPkg: Add acpiview tool to dump ACPI tables This program is provided to allow examination of ACPI table contents from the UEFI Shell. This can help with investigations, especially at that stage where the tables are not enabling an OS to boot. The program is not exhaustive, and only encapsulates detailed knowledge of a limited number of table types. Default behaviour is to display the content of all tables installed. 'Known' table types will be parsed and displayed with descriptions and field values. Where appropriate a degree of consistency checking is done and errors may be reported in the output. Other table types will be displayed as an array of Hexadecimal bytes. To facilitate debugging, the -s and -d options can be used to generate a binary file image of a table that can be copied elsewhere for investigation using tools such as those provided by acpica.org. This is especially relevant for AML type tables like DSDT and SSDT. The inspiration for this is the existing smbiosview Debug1 Shell command. Many tables are not explicitly handled, in part because no examples are available for our testing. The program is designed to be extended to new tables with minimal effort, and contributions are invited. Change-Id: Ifa23dc80ab8ab042c56e88424847e796a8122a7c Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2018-04-20 10:08:22 +02:00
// /**
//
// Copyright (c) 2016 - 2019, ARM Limited. All rights reserved.<BR>
ShellPkg: Add acpiview tool to dump ACPI tables This program is provided to allow examination of ACPI table contents from the UEFI Shell. This can help with investigations, especially at that stage where the tables are not enabling an OS to boot. The program is not exhaustive, and only encapsulates detailed knowledge of a limited number of table types. Default behaviour is to display the content of all tables installed. 'Known' table types will be parsed and displayed with descriptions and field values. Where appropriate a degree of consistency checking is done and errors may be reported in the output. Other table types will be displayed as an array of Hexadecimal bytes. To facilitate debugging, the -s and -d options can be used to generate a binary file image of a table that can be copied elsewhere for investigation using tools such as those provided by acpica.org. This is especially relevant for AML type tables like DSDT and SSDT. The inspiration for this is the existing smbiosview Debug1 Shell command. Many tables are not explicitly handled, in part because no examples are available for our testing. The program is designed to be extended to new tables with minimal effort, and contributions are invited. Change-Id: Ifa23dc80ab8ab042c56e88424847e796a8122a7c Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2018-04-20 10:08:22 +02:00
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
// which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php
//
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
// Module Name:
//
// UefiShellAcpiViewCommandLib.uni
//
// Abstract:
//
// String definitions for UEFI Shell acpiview command
//
//
// */
/=#
#langdef en-US "english"
#string STR_GEN_PROBLEM #language en-US "%H%s%N: Unknown flag - '%H%s%N'\r\n"
#string STR_GEN_NO_VALUE #language en-US "%H%s%N: Missing argument for flag - '%H%s%N'\r\n"
#string STR_GEN_TOO_MANY #language en-US "%H%s%N: Too many arguments.\r\n"
#string STR_GEN_MISSING_OPTION #language en-US "%H%s%N: Missing option '%H%s%N' required by flag - '%H%s%N'\r\n"
#string STR_GEN_READONLY_MEDIA #language en-US "%H%s%N: Unable to write to the current directory, check if media is writable.\r\n"
#string STR_GET_HELP_ACPIVIEW #language en-US ""
".TH acpiview 0 "Display ACPI information."\r\n"
".SH NAME\r\n"
"Display ACPI Table information.\r\n"
".SH SYNOPSIS\r\n"
" \r\n"
"ACPIVIEW [[-?] | [[-l] | [-s AcpiTable [-d]]] [-c] [-v] [-h Highlight]]\r\n"
" \r\n"
".SH OPTIONS\r\n"
" \r\n"
" -l - Display list of installed ACPI Tables.\r\n"
" -s - Display only the specified AcpiTable type.\r\n"
" AcpiTable : The required ACPI Table type.\r\n"
" -d - Generate a binary file dump of the specified AcpiTable.\r\n"
" -c - Consistency checking (enabled by default).\r\n"
" -v - Display verbose data (enabled by default).\r\n"
" -h - Enable/Disable Colour Highlighting.\r\n"
" Highlight : TRUE/ON enables highlighting;\r\n"
" FALSE/OFF (default) disables highlighting.\r\n"
" -? - Show help.\r\n"
" \r\n"
".SH DESCRIPTION\r\n"
" \r\n"
" This program is provided to allow examination of ACPI table values from the\r\n"
" UEFI Shell. This can help with investigations, especially at that stage where\r\n"
" the tables are not enabling an OS to boot.\r\n"
" The program is not exhaustive, and only encapsulates detailed knowledge of a\r\n"
" limited number of table types.\r\n"
" \r\n"
" Default behaviour is to display the content of all tables installed.\r\n"
" 'Known' table types (listed in NOTES below) will be parsed and displayed\r\n"
" with descriptions and field values. Where appropriate a degree of consistency\r\n"
" checking is done and errors may be reported in the output.\r\n"
" Other table types will be displayed as an array of Hexadecimal bytes.\r\n"
" \r\n"
" To facilitate debugging, the -s and -d options can be used to generate a\r\n"
" binary file image of a table that can be copied elsewhere for investigation\r\n"
" using tools such as those provided by acpica.org. This is especially relevant\r\n"
" for AML type tables like DSDT and SSDT.\r\n"
" \r\n"
"NOTES:\r\n"
" 1. The AcpiTable parameter can match any installed table type.\r\n"
" Tables without specific handling will be displayed as a raw hex dump (or\r\n"
" dumped to a file if -d is used).\r\n"
" 2. -s option supports to display the specified AcpiTable type that is present\r\n"
" in the system. For normal type AcpiTable, it would display the data of the\r\n"
" AcpiTable and AcpiTable header. The following type may contain header type\r\n"
" other than AcpiTable header. The actual header can refer to the ACPI spec 6.2\r\n"
" Extra A. Particular types:\r\n"
ShellPkg: Add acpiview tool to dump ACPI tables This program is provided to allow examination of ACPI table contents from the UEFI Shell. This can help with investigations, especially at that stage where the tables are not enabling an OS to boot. The program is not exhaustive, and only encapsulates detailed knowledge of a limited number of table types. Default behaviour is to display the content of all tables installed. 'Known' table types will be parsed and displayed with descriptions and field values. Where appropriate a degree of consistency checking is done and errors may be reported in the output. Other table types will be displayed as an array of Hexadecimal bytes. To facilitate debugging, the -s and -d options can be used to generate a binary file image of a table that can be copied elsewhere for investigation using tools such as those provided by acpica.org. This is especially relevant for AML type tables like DSDT and SSDT. The inspiration for this is the existing smbiosview Debug1 Shell command. Many tables are not explicitly handled, in part because no examples are available for our testing. The program is designed to be extended to new tables with minimal effort, and contributions are invited. Change-Id: Ifa23dc80ab8ab042c56e88424847e796a8122a7c Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2018-04-20 10:08:22 +02:00
" APIC - Multiple APIC Description Table (MADT)\r\n"
" BGRT - Boot Graphics Resource Table\r\n"
" DBG2 - Debug Port Table 2\r\n"
" DSDT - Differentiated System Description Table\r\n"
ShellPkg: Add acpiview tool to dump ACPI tables This program is provided to allow examination of ACPI table contents from the UEFI Shell. This can help with investigations, especially at that stage where the tables are not enabling an OS to boot. The program is not exhaustive, and only encapsulates detailed knowledge of a limited number of table types. Default behaviour is to display the content of all tables installed. 'Known' table types will be parsed and displayed with descriptions and field values. Where appropriate a degree of consistency checking is done and errors may be reported in the output. Other table types will be displayed as an array of Hexadecimal bytes. To facilitate debugging, the -s and -d options can be used to generate a binary file image of a table that can be copied elsewhere for investigation using tools such as those provided by acpica.org. This is especially relevant for AML type tables like DSDT and SSDT. The inspiration for this is the existing smbiosview Debug1 Shell command. Many tables are not explicitly handled, in part because no examples are available for our testing. The program is designed to be extended to new tables with minimal effort, and contributions are invited. Change-Id: Ifa23dc80ab8ab042c56e88424847e796a8122a7c Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2018-04-20 10:08:22 +02:00
" FACP - Fixed ACPI Description Table (FADT)\r\n"
" GTDT - Generic Timer Description Table\r\n"
" IORT - IO Remapping Table\r\n"
" MCFG - Memory Mapped Config Space Base Address Description Table\r\n"
" PPTT - Processor Properties Topology Table\r\n"
ShellPkg: Add acpiview tool to dump ACPI tables This program is provided to allow examination of ACPI table contents from the UEFI Shell. This can help with investigations, especially at that stage where the tables are not enabling an OS to boot. The program is not exhaustive, and only encapsulates detailed knowledge of a limited number of table types. Default behaviour is to display the content of all tables installed. 'Known' table types will be parsed and displayed with descriptions and field values. Where appropriate a degree of consistency checking is done and errors may be reported in the output. Other table types will be displayed as an array of Hexadecimal bytes. To facilitate debugging, the -s and -d options can be used to generate a binary file image of a table that can be copied elsewhere for investigation using tools such as those provided by acpica.org. This is especially relevant for AML type tables like DSDT and SSDT. The inspiration for this is the existing smbiosview Debug1 Shell command. Many tables are not explicitly handled, in part because no examples are available for our testing. The program is designed to be extended to new tables with minimal effort, and contributions are invited. Change-Id: Ifa23dc80ab8ab042c56e88424847e796a8122a7c Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2018-04-20 10:08:22 +02:00
" RSDP - Root System Description Pointer\r\n"
" SLIT - System Locality Information Table\r\n"
" SPCR - Serial Port Console Redirection Table\r\n"
" SRAT - System Resource Affinity Table\r\n"
" SSDT - Secondary SystemDescription Table\r\n"
ShellPkg: Add acpiview tool to dump ACPI tables This program is provided to allow examination of ACPI table contents from the UEFI Shell. This can help with investigations, especially at that stage where the tables are not enabling an OS to boot. The program is not exhaustive, and only encapsulates detailed knowledge of a limited number of table types. Default behaviour is to display the content of all tables installed. 'Known' table types will be parsed and displayed with descriptions and field values. Where appropriate a degree of consistency checking is done and errors may be reported in the output. Other table types will be displayed as an array of Hexadecimal bytes. To facilitate debugging, the -s and -d options can be used to generate a binary file image of a table that can be copied elsewhere for investigation using tools such as those provided by acpica.org. This is especially relevant for AML type tables like DSDT and SSDT. The inspiration for this is the existing smbiosview Debug1 Shell command. Many tables are not explicitly handled, in part because no examples are available for our testing. The program is designed to be extended to new tables with minimal effort, and contributions are invited. Change-Id: Ifa23dc80ab8ab042c56e88424847e796a8122a7c Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2018-04-20 10:08:22 +02:00
" XSDT - Extended System Description Table\r\n"
" \r\n"
".SH STANDARDS\r\n"
" \r\n"
" Table details correspond to those in 'Advanced Configuration and Power\r\n"
" Interface Specification' Version 6.2 Errata A, [September 2017]\r\n"
" (http://www.uefi.org/sites/default/files/resources/ACPI%206_2_A_Sept29.pdf)\r\n"
" \r\n"
" NOTE: The nature of the ACPI standard means that almost all tables in 6.1 will\r\n"
" be 'backwards compatible' with prior version of the specification in\r\n"
" terms of structure, so formatted output should be correct. The main\r\n"
" exception will be that previously 'reserved' fields will be reported\r\n"
" with new names, where they have been added in later versions of the\r\n"
" specification.\r\n"
" \r\n"
".SH EXAMPLES\r\n"
" \r\n"
" \r\n"
"EXAMPLES:\r\n"
" * To display a list of the installed table types:\r\n"
" fs0:\> acpiview -l\r\n"
" \r\n"
" * To parse and display a specific table type:\r\n"
" fs0:\> acpiview -s GTDT\r\n"
" \r\n"
" * To save a binary dump of the contents of a table to a file\r\n"
" in the current working directory:\r\n"
" fs0:\> acpiview -s DSDT -d\r\n"
" \r\n"
" * To display contents of all ACPI tables:\r\n"
" fs0:\> acpiview\r\n"
" \r\n"
".SH RETURNVALUES\r\n"
" \r\n"
"RETURN VALUES:\r\n"
" SHELL_SUCCESS Data was displayed as requested.\r\n"
" SHELL_INVALID_PARAMETER ACPI Table parsing failed.\r\n"
" \r\n"