UEFI Shell Debugging (AN51): Difference between revisions

From conga-wiki
mNo edit summary
mNo edit summary
 
(16 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{| class="wikitable"
{| class="wikitable"
|Affected Products
! style="background-color: #555555; color: #FFFFFF;" | Affected Products
|All Products Featuring UEFI
|All Products Featuring UEFI
|}
|}


== Preface ==
==Preface==
This application note describes helpful UEFI Shell commands for system debugging and diagnosis. The UEFI Shell can be executed on all congatec x86 products with UEFI boot firmware.  
This application note describes helpful UEFI Shell commands for system debugging and diagnosis. The UEFI Shell can be executed on all congatec x86 products with UEFI boot firmware.  


=== Terminology ===
== Terminology ==
{| class="wikitable"
{| class="wikitable"
|Term
! style="background-color: #555555; color: #FFFFFF;" |Term
|Description
! style="background-color: #555555; color: #FFFFFF;" |Description  
|-
|-
|NVRAM
|NVRAM
|Non-volatile RAM
|Non-volatile RAM
|-
|-
|SMBIOS
| SMBIOS
|System Management BIOS
|System Management BIOS
|-
|-
|UEFI
|UEFI
|Unified Extensible Firmware Interface  
|Unified Extensible Firmware Interface
|}
|}


== Introduction ==
== Introduction==
Like MS-DOS on legacy PCs, the UEFI Shell provides an API, a command prompt, and a rich set of commands. However, the UEFI firmware is not compatible with the old MS-DOS operating system.  
Like MS-DOS on legacy PCs, the UEFI Shell provides an API, a command prompt, and a rich set of commands. However, the UEFI firmware is not compatible with the old MS-DOS operating system.  


The UEFI Shell can be used for testing, debugging, and diagnosing systems. The shell can run as a built-in UEFI Shell or on a bootable USB flash drive compiled with UEFI Shell. The congatec embedded BIOS does not support the built-in UEFI Shell because of security reasons. Having a built-in shell may allow users to bypass security mechanisms that are contained within the BIOS.
The UEFI Shell can be used for testing, debugging, and diagnosing systems. The shell can run as a built-in UEFI Shell or on a bootable USB flash drive compiled with UEFI Shell. The congatec embedded BIOS does not support the built-in UEFI Shell because of security reasons. Having a built-in shell may allow users to bypass security mechanisms that are contained within the BIOS.


To start the UEFI Shell on congatec x86 products, you need to create a bootable USB flash drive with compiled UEFI Shell. The procedure to create such a boot USB flash drive is explained in the application note “AN31_Creating_a_UEFI_Stick”. You can download this document from:
To start the UEFI Shell on congatec x86 products, you need to create a bootable USB flash drive with compiled UEFI Shell. The procedure to create such a boot USB flash drive is explained in the application note titled [[How to create a bootable USB stick with a UEFI shell (AN31)]].
 
<nowiki>https://www.congatec.com/us/support/application-notes/article/an31-how-to-create-a-bootable-usb-stick-with-an-uefi-shell/</nowiki>


This application note explains commonly used UEFI Shell commands during system development and production.  
This application note explains commonly used UEFI Shell commands during system development and production.  


For additional information about the UEFI Shell, refer to the UEFI Shell specification. The document can be downloaded from <nowiki>https://www.uefi.org/specifications</nowiki>.
For additional information about the UEFI Shell, refer to the UEFI Shell specification. The document can be downloaded from [https://www.uefi.org/specifications <nowiki>https://www.uefi.org/specifications</nowiki>]


== Common UEFI Shell Commands ==
==Common UEFI Shell Commands ==
This section describes some commonly used UEFI Shell commands for shell navigation, file management, system debugging and testing.  
This section describes some commonly used UEFI Shell commands for shell navigation, file management, system debugging and testing.  


The commands can be used at the UEFI Shell prompt Shell> or at the file system prompt, typically FS0:\>.  
The commands can be used at the UEFI Shell prompt <code>Shell></code> or at the file system prompt, typically <code>FS0:\></code>  


=== Basic Commands ===
===Basic Commands ===
The following commands can be used for shell navigation or file management.
The following commands can be used for shell navigation or file management.


==== help ====
====help====
The '''help -b''' command lists all the UEFI Shell commands.  
The <code>help -b</code> command lists all the UEFI Shell commands.  


The '''-b''' parameter displays the output one screen at a time.
The <code>-b</code> parameter displays the output one screen at a time.


The '''-verbose''' parameter displays the details of each UEFI Shell command. It also shows an example of how to use the command. For example, the command:  
The <code>-verbose</code> parameter displays the details of each UEFI Shell command. It also shows an example of how to use the command. For example, the command:  


'''help -b -verbose pci'''
<code>help -b -verbose pci</code>


will parse and pause on each screen, giving verbose description of the '''pci''' command.   
will parse and pause on each screen, giving verbose description of the <code>pci</code> command.   


==== cls ====
====cls ====
The '''cls''' command can be used to clear the screen and optionally change the background and foreground color of the display.  
The <code>cls</code> command can be used to clear the screen and optionally change the background and foreground color of the display.  


To clear the screen without changing the background or foreground color, type:
To clear the screen without changing the background or foreground color, type:


'''cls'''
<code>cls</code>


To clear the screen and change the background color to blue and the foreground color to yellow, type:
To clear the screen and change the background color to blue and the foreground color to yellow, type:


'''cls 1 6'''
<code>cls 1 6</code>


where 1 is the blue background color and 6 is the yellow foreground color.
where 1 is the blue background color and 6 is the yellow foreground color.


==== exit ====
====exit====
The '''exit''' command is used to exit the UEFI Shell. If other boot options are available after exiting the shell, the system will boot from another loader. Otherwise, BIOS setup will be launched.
The <code>exit</code> command is used to exit the UEFI Shell. If other boot options are available after exiting the shell, the system will boot from another loader. Otherwise, BIOS setup will be launched.


==== mode ====
====mode====
The '''mode''' command can change the number of characters per line and the number of lines that can be displayed.  
The <code>mode</code> command can change the number of characters per line and the number of lines that can be displayed.  


You can check the assigned mode for your display by typing the command:  
You can check the assigned mode for your display by typing the command:  


'''mode'''
<code>mode</code>


Typical modes supported by an HD display are:
Typical modes supported by an HD display are:
 
{| class="wikitable"
Col       80        Row     25
|+
 
|Col 80
Col       80        Row     50
|Row 25
 
|-
Col       100       Row     31
|Col 80
 
|Row 50
Col       240      Row     56
|-
|Col 100
|Row 31
|-
|Col 240
|Row 56
|}


For example, to change the display mode to 100 characters per line and 31 lines, use:
For example, to change the display mode to 100 characters per line and 31 lines, use:


'''mode 100 31'''
<code>mode 100 31</code>


==== Output Redirection ====
==== Output Redirection====
The output of UEFI Shell commands can be redirected to a file. This is especially important during system debugging. The stored file can be analyzed later or shared with others for easy collaboration. Output redirection works with all UEFI Shell commands.  
The output of UEFI Shell commands can be redirected to a file. This is especially important during system debugging. The stored file can be analyzed later or shared with others for easy collaboration. Output redirection works with all UEFI Shell commands.  


The command below for example, redirects the help text for the pci command to a UCS‑2 encoded file pcihelp.txt.
The command below, for example, redirects the help text for the pci command to a UCS‑2 encoded file <code>pcihelp.txt</code>


'''help pci > pcihelp.txt'''
<code>help pci > pcihelp.txt</code>


Although there are several special character combinations for the output redirection operation, the “>” character in the example above is commonly used for output redirection.
Although there are several special character combinations for the output redirection operation, the “>” character in the example above is commonly used for output redirection.


==== type / edit ====
====type / edit====
The '''type''' and '''edit''' commands send the content of a file to the standard output device. While the type command allows you to only view the text file (without modification), the edit command allows you to view and modify the text file.  
The <code>type</code> and <code>edit</code> commands send the content of a file to the standard output device. While the type command allows you to only view the text file (without modification), the edit command allows you to view and modify the text file.  


For example, the type command below will display the content of the pcihelp.txt file on the screen:
For example, the type command below will display the content of the <code>pcihelp.txt</code> file on the screen:


'''type pcihelp.txt'''
<code>type pcihelp.txt</code>


In contrast, the edit command below will open the pcihelp.txt file in full-screen text editor mode with full modification capability.
Inversely, the edit command below will open the <code>pcihelp.txt</code> file in full-screen text editor mode with full modification capability.


'''edit pcihelp.txt'''
<code>edit pcihelp.txt</code>


The editor supports UCS-2 and ASCI encoded text files. In the editor, you can use the arrow keys as well as page up and page down keys to move the cursor around. The editor does not have a menu and must be controlled with the function (Fx) keys.  
The editor supports UCS-2 and ASCI encoded text files. In the editor, you can use the arrow keys as well as page up and page down keys to move the cursor around. The editor does not have a menu and must be controlled with the function (Fx) keys.  
Line 115: Line 120:
The table below shows the supported keys with their associated functions.
The table below shows the supported keys with their associated functions.
{| class="wikitable"
{| class="wikitable"
|F1
! style="background-color: #555555; color: #FFFFFF;" |F1
|Go to line
| Go to line
|F5
 
|Search and replace a string
! style="background-color: #555555; color: #FFFFFF;" |F5
|Search and replace a string  
|-
|-
|F2
! style="background-color: #555555; color: #FFFFFF;" |F2
|Save file
|Save file
|F6
! style="background-color: #555555; color: #FFFFFF;" |F6
|Delete line
|Delete line
|-
|-
|F3
! style="background-color: #555555; color: #FFFFFF;" |F3
|Save a modified file
|Save a modified file
|F7
! style="background-color: #555555; color: #FFFFFF;" |F7
|Insert previously deleted line
|Insert previously deleted line
|-
|-
|F4
! style="background-color: #555555; color: #FFFFFF;" |F4
|Search a string
|Search a string
|F8
! style="background-color: #555555; color: #FFFFFF;" |F8
|Open a new file
|Open a new file  
|}
|}


==== hexedit ====
====hexedit ====
With '''hexedit''' command, you can view and modify binary files in UEFI Shell. You can also use it for block devices and memory regions.
With <code>hexedit</code> command, you can view and modify binary files in UEFI Shell. You can also use it for block devices and memory regions.


For example, to open the binary file dump.bin in a full screen hex editor, type:
For example, to open the binary file <code>dump.bin</code> in a full screen hex editor, type:


'''hexedit dump.bin'''
<code>hexedit dump.bin</code>


To open block device fs0 for editing, starting from block 0 with size of 1 block, type:
To open block device fs0 for editing, starting from block 0 with size of 1 block, type:


'''hexedit -d fs0 0 1'''
<code>hexedit -d fs0 0 1</code>


To open the memory region for editing, starting from address 0x8CC80B98 with size of 100 bytes, type:  
To open the memory region for editing, starting from address <code>0x8CC80B98</code> with size of 100 bytes, type:  


'''hexedit -m 8CC80B98 100'''
<code>hexedit -m 8CC80B98 100</code>


In the editor, you can use the arrow keys as well as the page up and page down keys to move the cursor around. The editor does not have a menu and must be controlled with the function (Fx) keys.  
In the editor, you can use the arrow keys as well as the page up and page down keys to move the cursor around. The editor does not have a menu and must be controlled with the function (Fx) keys.  
Line 155: Line 161:
The table below shows the supported keys with their associated functions.
The table below shows the supported keys with their associated functions.
{| class="wikitable"
{| class="wikitable"
|F1
! style="background-color: #555555; color: #FFFFFF;" |F1
|Go to offset
| Go to offset
|F6
! style="background-color: #555555; color: #FFFFFF;" |F6
|Delete block
|Delete block
|-
|-
|F2
! style="background-color: #555555; color: #FFFFFF;" | F2
|Save buffer/file
|Save buffer/file
|F7
! style="background-color: #555555; color: #FFFFFF;" |F7
|Insert previously deleted block
|Insert previously deleted block  
|-
|-
|F3
! style="background-color: #555555; color: #FFFFFF;" |F3
|Save a modified buffer/file
|Save a modified buffer/file
|F8
! style="background-color: #555555; color: #FFFFFF;" |F8
|Open a new file
|Open a new file  
|-
|-
|F4
! style="background-color: #555555; color: #FFFFFF;" | F4
|Mark block start
|Mark block start
|F9
! style="background-color: #555555; color: #FFFFFF;" |F9
|Open a new block device
|Open a new block device
|-
|-
|F5
! style="background-color: #555555; color: #FFFFFF;" |F5
|Mark block end
|Mark block end
|F10
! style="background-color: #555555; color: #FFFFFF;" |F10
|Open a new memory region
|Open a new memory region
|}
|}
<span style="color: red;">'''Caution:''' '''''Ensure adequate care is taken when editing block devices and memory at runtime. Failure to do so may cause loss of data or system crash.'''''</span>


====ver====
The '''ver''' command displays the UEFI Firmware and the UEFI Shell versions. With '''-s''' parameter, the command displays only the UEFI Shell version.


For example, '''ver -s''' displays '''2.2'''. This is the current version of the UEFI Shell as at the date of this document.
<span style="color: red;">'''Caution:'''</span>
 
<span style="color: red;">'''''Ensure adequate care is taken when editing block devices and memory at runtime. Failure to do so may cause loss of data or system crash.'''''</span>


====ver====
The <code>ver</code> command displays the UEFI Firmware and the UEFI Shell versions. With <code>-s</code> parameter, the command displays only the UEFI Shell version.


For example, <code>ver -s</code> displays <code>2.2</code>. This is the current version of the UEFI Shell as at the date of this document.
===Debugging Commands ===
===Debugging Commands ===
The following commands can be used in the UEFI Shell to diagnose and debug the system.
The following commands can be used in the UEFI Shell to diagnose and debug the system.


====bcfg====
====bcfg====
The bcfg command can be used to display and modify the boot option variables stored in the UEFI firmware NVRAM.
The <code>bcfg</code> command can be used to display and modify the boot option variables stored in the UEFI firmware NVRAM.
 
With different bcfg command options, you can add, remove, or reorder boot option variables.


'''Note: ''You must change the setup node “Boot Priority Selection” to “UEFI Standard” in order to support modification of boot variable ordering at runtime.'''''
With different <code>bcfg</code> command options, you can add, remove, or reorder boot option variables.




The most common bcfg command options are listed below:
'''Note:'''


* '''bcfg boot dump'''
'''''You must change the setup node “Boot Priority Selection” to “UEFI Standard” in order to support modification of boot variable ordering at runtime.'''''  


Displays all boot options


*'''bcfg boot add 2 OEMOS.efi “OEM OS“'''
The most common <code>bcfg</code> command options are listed below:


Adds the boot loader OEMOS.efi in the root directory, as new boot option #2
*<code>bcfg boot dump</code> - displays all boot options


*'''bcfg boot mv 1 0'''
*<code>bcfg boot add 2 OEMOS.efi “OEM OS“</code> - adds the boot loader <code>OEMOS.efi</code> in the root directory, as new boot option #2


Moves boot option #1 to #0  
*<code>bcfg boot mv 1 0</code> - moves boot option #1 to #0


*'''bcfg boot mv 1 0'''
*<code>bcfg boot mv 1 0</code> - removes boot option #0


Removes boot option #0
The syntax for the boot option variables is <code>Bootxxxx</code>(where xxxx is a four-digit number)


The syntax for the boot option variables is '''Bootxxxx''' (where xxxx is a four-digit number)
====dmem / mem====
Both <code>dmem</code> and <code>mem</code> commands display the content of system memory or memory‑mapped device.


====dmem / mem ====
The <code>mem</code> command is a built-in alias for the <code>dmem</code> command.
Both '''dmem''' and '''mem''' commands display the content of system memory or memory‑mapped device.  


The mem command is a built-in alias for the dmem command.
<u>Syntax:</u>


Syntax:
<code>dmem [-b] [address] [size]</code>
 
'''dmem [-b] [address] [size]'''


The address and size must be typed in hex values. For example, to display 100 bytes of system memory, starting from address 0x90000000, type:
The address and size must be typed in hex values. For example, to display 100 bytes of system memory, starting from address 0x90000000, type:


'''dmem 90000000 100'''
<code>dmem 90000000 100</code>


If the size is not specified, the default size of 512 bytes is displayed.  
If the size is not specified, the default size of 512 bytes is displayed.


The '''dmem''' command without a parameter displays the contents of the EFI System Table. To redirect the contents of the UEFI System Table to a file UST.txt, type:
The <code>dmem</code>command without a parameter displays the contents of the EFI System Table. To redirect the contents of the UEFI System Table to a file <code>UST.txt</code>, type:


'''dmem > UST.txt'''
<code>dmem > UST.txt</code>


====dmpstore====
====dmpstore====
The dmpstore command is used to display and manage UEFI variables. The main debugging purpose of this command is to dump certain variables in the UEFI Shell.  
The <code>dmpstore</code> command is used to display and manage UEFI variables. The main debugging purpose of this command is to dump certain variables in the UEFI Shell.  


Some examples of the dmpstore command are listed below:
Some examples of the <code>dmpstore</code> command are listed below:


*Dump all variables to a file DumpVar.txt. The file can be analyzed on a host PC using a text editor.
*Dump all variables to a file <code>DumpVar.txt</code> The file can be analyzed on a host PC using a text editor.


'''dmpstore > DumpVar.txt'''
<code>dmpstore > DumpVar.txt</code>


*Dump the EFIGlobalVariable “BootOrder“. The output helps to understand boot priority handling of the UEFI firmware.
* Dump the <code>EFIGlobalVariable “BootOrder“</code> The output helps to understand boot priority handling of the UEFI firmware.


'''dmpstore BootOrder'''
<code>dmpstore BootOrder</code>


* Dump the EFIGlobalVariable “BootCurrent“. The output helps to understand boot priority handling of the UEFI firmware.
*Dump the <code>EFIGlobalVariable “BootCurrent“</code> The output helps to understand boot priority handling of the UEFI firmware.


'''dmpstore BootCurrent'''
<code>dmpstore BootCurrent</code>


*Dump the Secure Boot Platform Key variable one screen at a time.
* Dump the Secure Boot Platform Key variable one screen at a time.


'''dmpstore *PK* -b'''
<code>dmpstore *PK* -b</code> 


*Dump the Secure Boot Key Exchange Key variable one screen at a time.
*Dump the Secure Boot Key Exchange Key variable one screen at a time.


'''dmpstore *KEK* -b'''
<code>dmpstore *KEK* -b</code>


* Dump the Secure Boot db and dbx variables one screen at a time.
*Dump the Secure Boot <code>db</code> and <code>dbx</code> variables one screen at a time.


'''dmpstore *DB* -b'''
<code>dmpstore *DB* -b</code>


'''Note: ''The asterisk (*) can be used as a placeholder for the variable name. All variables that match the naming convention will be dumped.'''''


==== memmap====
'''Note:'''
The '''memmap''' command displays the memory map maintained by the UEFI environment. The UEFI firmware keeps track of all the physical memory in the system and how it is being used.


For the description of how the Memory Attribute Descriptors are used, refer to the UEFI specification.  
'''''The asterisk (*) can be used as a placeholder for the variable name. All variables that match the naming convention will be dumped.'''''


<u>Examples:</u>
====memmap====
The <code>memmap</code>command displays the memory map maintained by the UEFI environment. The UEFI firmware keeps track of all the physical memory in the system and how it is being used.


To display the memory map one page at a time, type:
For the description of how the Memory Attribute Descriptors are used, refer to the UEFI specification.   


'''memmap -b'''
<u>Examples:</u>
 
 
To dump the memory map to a file MemoryMap.txt, type:


'''memmap > MemoryMap.txt'''
* <code>memmap -b</code> display the memory map one page at a time
* <code>memmap > MemoryMap.txt</code> - dump the memory map to a file <code>MemoryMap.txt</code>


====mm====
====mm ====
The '''mm''' command can be used to display or modify memory, memory mapped IO, PCI(e) configuration space and legacy IO.  
The <code>mm</code>command can be used to display or modify memory, memory mapped IO, PCI(e) configuration space and legacy IO.


Syntax
<u>Syntax:</u>


'''mm address [value] [-w 1|2|4|8] [-MEM | -MMIO | -IO | -PCIE] [-n]'''
<code>mm address [value] [-w 1|2|4|8] [-MEM | -MMIO | -IO | -PCIE] [-n]</code>


The parameters and options are described below:
The parameters and options are described below:


*'''address'''
*<code>address</code>


This parameter is mandatory and must be in hexadecimal format. It specifies the start address of the memory area or the IO register to be modified or read from.
This parameter is mandatory and must be in hexadecimal format. It specifies the start address of the memory area or the IO register to be modified or read from.


*'''value'''
*<code>value</code>


If value is specified, the mm command writes the value to the address location without user interaction. This parameter must be in hexadecimal format.  
If value is specified, the <code>mm</code> command writes the value to the address location without user interaction. This parameter must be in hexadecimal format.  


*'''-w'''
*<code>-w</code>


The -w option defines the access width in bytes. Default width is 1 byte.
The <code>-w</code> option defines the access width in bytes. Default width is 1 byte.


*'''-n'''
*<code>-n</code>


The -n option switches the command to non-interactive mode and displays the value of the specified address. This value cannot be overridden. Without -n option, the user can edit the value of the specified memory or IO location.  
The <code>-n</code> option switches the command to non-interactive mode and displays the value of the specified address. This value cannot be overridden. Without <code>-n</code> option, the user can edit the value of the specified memory or IO location.


*'''-MEM, -MMIO, -IO, -PCIE'''
*-<code>MEM</code>, <code>-MMIO</code>, <code>-IO</code>, <code>-PCIE</code>


These parameter options define the address type. If none of these types is specified, -MEM is assumed.
These parameter options define the address type. If none of these types is specified, -<code>MEM</code> is assumed.


<u>Examples:</u>


Examples
Some examples of the <code>mm</code> command are listed below:  
 
Some examples of the mm command are listed below:


* Read one byte of memory in interactive mode
*Read one byte of memory in interactive mode


'''mm 0x40000000'''
<code>mm 0x40000000</code>


Output: MEM 0x0000000040000000 : 0xC2 > _
Output: <code>MEM 0x0000000040000000 : 0xC2 > _</code>


In the interactive mode, you can override the current value or press the Enter key to read the next byte of data.
In the interactive mode, you can override the current value or press the Enter key to read the next byte of data.
Line 329: Line 328:
*Read four bytes of memory in non-interactive mode
*Read four bytes of memory in non-interactive mode


'''mm 0x40000000 -w 4 -n'''
<code>mm 0x40000000 -w 4 -n</code>


Output: MEM 0x0000000040000000 : 0x1E4E3EC2
Output: <code>MEM 0x0000000040000000 : 0x1E4E3EC2</code>


*Write two bytes of memory (writes are always non-interactive)
*Write two bytes of memory (writes are always non-interactive)


'''mm 0x40000000 0x1234 -w 2'''
<code>mm 0x40000000 0x1234 -w 2</code>


*Read one byte of IO port 80h (BIOS POST code port) in interactive mode
*Read one byte of IO port 80h (BIOS POST code port) in interactive mode


'''mm 0x80 -IO'''
<code>mm 0x80 -IO</code>


Output: MEM 0x0000000000000080 : 0x78 > _
Output: MEM 0x0000000000000080 : 0x78 > _
Line 347: Line 346:
*Read the Vendor and Device ID in PCI Express configuration space
*Read the Vendor and Device ID in PCI Express configuration space


'''mm 0x0000000200000 -w 4 –PCIE -n'''
<code>mm 0x0000000200000 -w 4 –PCIE -n</code>


Output: PCIE 0x0000000000200000 : 0x3E9B8086
<code>PCIE 0x0000000000200000 : 0x3E9B8086</code>


You do not need Interactive mode for Vendor and Device ID because these registers are read only.
You do not need Interactive mode for Vendor and Device ID because these registers are read only.


In addition to the -PCIE address type, the mm command also supports a -PCI address type. The PCI address type supports only 256 bytes of config space, whereas PCIE address type supports 4k bytes. Therefore, their address format is slightly different.  
In addition to the <code>-PCIE</code> address type, the <code>mm</code> command also supports a <code>-PCI</code> address type. The PCI address type supports only 256 bytes of config space, whereas PCIE address type supports 4k bytes. Therefore, their address format is slightly different.  
 
The <code>-PCIE</code> format has 3-digit register while the <code>-PCI</code> format has 2-digit register. The formats are:
 
<code>-PCIE: ssssbbddff'''rrr'''</code>


The -PCIE format has 3-digit register while the -PCI format has 2-digit register. The formats are:  
<code>-PCI: ssssbbddff'''rr'''</code>


-'''PCIE:''' ssssbbddff'''rrr'''
where


-'''PCI:''' ssssbbddff'''rr'''
* <code>ssss</code> = Segment
* <code>bb</code> = Bus
* <code>dd</code> = Device
* <code>ff</code> = Function
* <code>rr</code> or <code>rrr</code> = Register


where ssss = Segment, bb = Bus, dd = Device, ff = Function and rr or rrr = Register.


'''Note:'''


'''Note: ''With the -PCIE address type, you can read or modify the PCI config space by setting the uppermost digit of the register in -PCIE format to 0.'''''
'''''With the''''' <code>-PCIE</code> '''''address type, you can read or modify the PCI config space by setting the uppermost digit of the register in''''' <code>-PCIE</code> '''''format to 0.'''''


====pci====
====pci====
The '''pci''' command displays the complete PCI device list. It can also display the configuration space of a PCI or PCIe device.  
The <code>pci</code>command displays the complete PCI device list. It can also display the configuration space of a PCI or PCIe device.  


To display the PCI device list one screen at a time, type:
To display the PCI device list one screen at a time, type:


'''pci -b'''
<code>pci -b</code>
 
To redirect the output of the pci command to a file <code>pcitree.txt</code> type:


To redirect the output of the pci command to a file pcitree.txt, type:  
<code>pci > pcitree.txt</code>
When you type the pci command without a Bus Device Function (BDF) parameter, it lists the PCI device tree. When you type it with the BDF parameters, the command reads the config space of the selected device. For example:


'''pci > pcitree.txt'''
When you type the <code>pci</code> command without a Bus Device Function (BDF) parameter, it lists the PCI device tree. When you type it with the BDF parameters, the command reads the config space of the selected device. For example:


When you type the pci command without a Bus Device Function (BDF) parameter, it lists the PCI device tree. When you type it with the BDF parameters, the command reads the config space of the selected device. For example:
<code>pci 0 1F 6</code>


'''pci 0 1F 6'''
The above command reads the 256 bytes configuration registers of the PCI function at bus 0, device 1Fh and function 6. The BDF numbers must be hexadecimal numbers. 


The above command reads the 256 bytes configuration registers of the PCI function at bus 0, device 1Fh and function 6. The BDF numbers must be hexadecimal numbers.  
The config space of a PCI device is only 256 bytes and can be displayed on one screen. For PCI Express devices with a 4k config space, use the <code>-b</code> parameter to pause the output after one page on the screen. For example:


The config space of a PCI device is only 256 bytes and can be displayed on one screen. For PCI Express devices with a 4k config space, use the '''-b''' parameter to pause the output after one page on the screen. For example:
<code>pci 0 2 0 -b</code>


'''pci 0 2 0 -b'''
Use the <code>i</code>parameter to display interpreted (verbose) information for the configuration space registers. For example:


Use the '''-i''' parameter to display interpreted (verbose) information for the configuration space registers. For example:
<code>pci 0 17 0 -i</code>


'''pci 0 17 0 -i'''


'''Note:'''


'''''Note: The pci command only displays the PCI and PCI Express configuration space registers. To modify these registers, use the mm command.'''''
'''''The''''' <code>pci</code> '''''command only displays the PCI and PCI Express configuration space registers. To modify these registers, use the''''' <code>mm</code> '''''command.'''''


====reset ====
====reset====
The reset command is used to reset the system. The command has three parameter options:
The <code>reset</code> command is used to reset the system. The command has three parameter options:  


*-s for shutdown (transition to SoftOff (S5), no reboot)
*<code>-s</code> for shutdown (transition to SoftOff (S5), no reboot)  


*-w for warm boot (system reset without power cycle)
*<code>-w</code> for warm boot (system reset without power cycle)  


*-c for cold boot (system reboot with power off/on cycle)
*<code>-c</code> for cold boot (system reboot with power off/on cycle)


If no parameter is used, the '''reset''' command will perform a cold reboot by default. With '''-fwui''' parameter, the UEFI firmware will launch its user interface (BIOS setup) on the next boot.
If no parameter is used, the <code>reset</code>command will perform a cold reboot by default. With <code>-fwui</code>parameter, the UEFI firmware will launch its user interface (BIOS setup) on the next boot.


<u>Examples</u>:
<u>Examples</u>:


'''reset -s'''
* To perform a system shutdown:


Performs a system shutdown
<code>reset -s</code>


'''reset -c'''
* To perform a cold reset of the system:


Performs a cold reset of the system
<code>reset -c</code>


'''reset -w -fwui'''
* To perform a warm reset of the system and enter BIOS setup on the next boot:


Performs a warm reset of the system and enters BIOS setup on next boot
<code>reset -w -fwui</code>


==== sermode====
====sermode====
The '''sermode''' command displays or sets baud rate, parity attribute, data bits and stop bits of a serial port. If no attributes are specified, then the current settings for all serial ports are displayed.  
The <code>sermode</code>command displays or sets baud rate, parity attribute, data bits and stop bits of a serial port. If no attributes are specified, then the current settings for all serial ports are displayed.  


For example, to display the settings of all serial ports, type:
For example, to display the settings of all serial ports, type:


'''sermode'''    
<code>sermode</code>


The output of the command on our test system is shown below:
The output of the command on our test system is shown below:


150(88414B18) – (115200, N, 8, 1)
<code>150(88414B18) – (115200, N, 8, 1)</code>


151(88414118) – (115200, N, 8, 1)
<code>151(88414118) – (115200, N, 8, 1)</code>


The system has two serial ports with device handle 150 and 151 enabled. Both serial ports have 115200 baud rate, no parity, 8 data and 1 stop bit.
The system has two serial ports with device handle 150 and 151 enabled. Both serial ports have 115200 baud rate, no parity, 8 data and 1 stop bit.
Line 436: Line 446:
To change the settings for the second serial port to 9600 baud rate and even parity, type:
To change the settings for the second serial port to 9600 baud rate and even parity, type:


'''sermode 151 9600 e 8 1'''
<code>sermode 151 9600 e 8 1</code>


A confirmation message “'''Mode set on handle 151 successfully'''” displays'''.'''  
A confirmation message <code>Mode set on handle 151 successfully</code> displays'''.'''  


Use the sermode command to verify the new settings:
Use the <code>sermode</code> command to verify the new settings:


'''sermode'''
<code>sermode</code>


This displays the following:
This displays the following:


150(88414B18) – (115200, N, 8, 1)
<code>150(88414B18) – (115200, N, 8, 1)</code>


151(88414118) – (9600, E, 8, 1)
<code>151(88414118) – (9600, E, 8, 1)</code>


For a list of all supported baud rate, parity, data and stop bit attribute settings, type:  
For a list of all supported baud rate, parity, data and stop bit attribute settings, type:  


'''help sermode -b'''
<code>help sermode -b</code>


====setvar====
====setvar====
Similar to the '''dmpstore''' command, the '''setvar''' command can be used to display, create, delete or modify a UEFI variable. Unlike the '''dmpstore''' command, which can only load a variable from a file, the '''setvar''' command can directly modify a variable.
Similar to the <code>dmpstore</code>command, the <code>setvar</code>command can be used to display, create, delete or modify a UEFI variable. Unlike the <code>dmpstore</code>command, which can only load a variable from a file, the <code>setvar</code>command can directly modify a variable.


Some examples of the setvar command are listed below:
Some examples of the setvar command are listed below:


* Display the EfiGlobalVariable “BootCurrent” (similar to '''dmpstore''' '''BootOrder''').
*Display the <code>EfiGlobalVariable “BootCurrent”</code> (similar to <code>dmpstore BootOrder</code>).


'''setvar BootOrder''' 
<code>setvar BootOrder</code>


*Write a new value to the EfiGlobalVariable “BootCurrent”. With '''dmpstore''' command, this action is not possible.
*Write a new value to the <code>EfiGlobalVariable “BootCurrent”</code> With <code>dmpstore</code>command, this action is not possible.


'''setvar BootOrder =0x00030002'''
<code>setvar BootOrder =0x00030002</code>


In addition to the “0x” indicator for a hexadecimal number, you can also use the “H” notation for a hexadecimal byte array. For example:
In addition to the “0x” indicator for a hexadecimal number, you can also use the “H” notation for a hexadecimal byte array. For example:


'''setvar''' '''BootOrder = H02000300'''
<code>setvar BootOrder = H02000300</code>


(Both commands will write the same value to the BootCurrent variable)
(Both commands will write the same value to the BootCurrent variable)


*Display only the variable named “testvar1” associated with the given GUID value.
*Display only the variable named "testvar1" associated with the given GUID value.
<code>setvar testvar1 -guid 12345678-1111-2222-3333-1234567890AB</code>
 
To access a variable that is not EFI­_GLOBAL_VARIABLE, you must use the <code>‑guid</code> option.  


'''setvar''' '''testvar1 -guid 12345678-1111-2222-3333-1234567890AB'''
*Delete the variable named “testvar1” associated with the given GUID value.


To access a variable that is not EFI­_GLOBAL_VARIABLE, you must use the ‑guid option.
<code>setvar testvar1 -guid 12345678-1111-2222-3333-1234567890AB =</code>


*Delete the variable named “testvar1” associated with the given GUID value.


'''setvar''' '''testvar1 -guid 12345678-1111-2222-3333-1234567890AB ='''  
'''Note:'''


'''Note: ''Having the equal sign “=” at the end of the setvar command (without data assigned) will delete the variable “testvar1”.'''''   
'''''Having the equal sign “=” at the end of the''''' <code>setvar</code> '''''command (without data assigned) will delete the variable “testvar1”.'''''   


====smbiosview====
====smbiosview====
The '''smbiosview''' command displays the SMBIOS information. When you type the command without parameter or with parameter '''-a''', it displays the information for all SMBIOS structures. For example:
The <code>smbiosview</code>command displays the SMBIOS information. When you type the command without parameter or with parameter <code>-a</code>, it displays the information for all SMBIOS structures.
 
For example:


'''smbiosview or smbiosview -a'''
<code>smbiosview or smbiosview -a</code>


The -t parameter allows you to select and display a specific SMBIOS structure type.  
The -t parameter allows you to select and display a specific SMBIOS structure type.  
Line 494: Line 508:
To get an overview of all supported SMBIOS types, type:
To get an overview of all supported SMBIOS types, type:


'''help smbiosview -b'''
<code>help smbiosview -b</code>


To save all SMBIOS structures to a file smbiosdata.txt, type:  
To save all SMBIOS structures to a file <code>smbiosdata.txt</code> type:  


'''smbiosview -a > smbiosdata.txt'''
<code>smbiosview -a > smbiosdata.txt</code>


To display SMBIOS structure 1 (system information), type:  
To display SMBIOS structure 1 (system information), type:  


'''smbiosview -t 1 -b'''
<code>smbiosview -t 1 -b</code>
 
[[Category:Application Notes]]

Latest revision as of 16:46, 22 November 2024

Affected Products All Products Featuring UEFI

Preface

This application note describes helpful UEFI Shell commands for system debugging and diagnosis. The UEFI Shell can be executed on all congatec x86 products with UEFI boot firmware.

Terminology

Term Description
NVRAM Non-volatile RAM
SMBIOS System Management BIOS
UEFI Unified Extensible Firmware Interface

Introduction

Like MS-DOS on legacy PCs, the UEFI Shell provides an API, a command prompt, and a rich set of commands. However, the UEFI firmware is not compatible with the old MS-DOS operating system.

The UEFI Shell can be used for testing, debugging, and diagnosing systems. The shell can run as a built-in UEFI Shell or on a bootable USB flash drive compiled with UEFI Shell. The congatec embedded BIOS does not support the built-in UEFI Shell because of security reasons. Having a built-in shell may allow users to bypass security mechanisms that are contained within the BIOS.

To start the UEFI Shell on congatec x86 products, you need to create a bootable USB flash drive with compiled UEFI Shell. The procedure to create such a boot USB flash drive is explained in the application note titled How to create a bootable USB stick with a UEFI shell (AN31).

This application note explains commonly used UEFI Shell commands during system development and production.

For additional information about the UEFI Shell, refer to the UEFI Shell specification. The document can be downloaded from https://www.uefi.org/specifications

Common UEFI Shell Commands

This section describes some commonly used UEFI Shell commands for shell navigation, file management, system debugging and testing.

The commands can be used at the UEFI Shell prompt Shell> or at the file system prompt, typically FS0:\>

Basic Commands

The following commands can be used for shell navigation or file management.

help

The help -b command lists all the UEFI Shell commands.

The -b parameter displays the output one screen at a time.

The -verbose parameter displays the details of each UEFI Shell command. It also shows an example of how to use the command. For example, the command:

help -b -verbose pci

will parse and pause on each screen, giving verbose description of the pci command.

cls

The cls command can be used to clear the screen and optionally change the background and foreground color of the display.

To clear the screen without changing the background or foreground color, type:

cls

To clear the screen and change the background color to blue and the foreground color to yellow, type:

cls 1 6

where 1 is the blue background color and 6 is the yellow foreground color.

exit

The exit command is used to exit the UEFI Shell. If other boot options are available after exiting the shell, the system will boot from another loader. Otherwise, BIOS setup will be launched.

mode

The mode command can change the number of characters per line and the number of lines that can be displayed.

You can check the assigned mode for your display by typing the command:

mode

Typical modes supported by an HD display are:

Col 80 Row 25
Col 80 Row 50
Col 100 Row 31
Col 240 Row 56

For example, to change the display mode to 100 characters per line and 31 lines, use:

mode 100 31

Output Redirection

The output of UEFI Shell commands can be redirected to a file. This is especially important during system debugging. The stored file can be analyzed later or shared with others for easy collaboration. Output redirection works with all UEFI Shell commands.

The command below, for example, redirects the help text for the pci command to a UCS‑2 encoded file pcihelp.txt

help pci > pcihelp.txt

Although there are several special character combinations for the output redirection operation, the “>” character in the example above is commonly used for output redirection.

type / edit

The type and edit commands send the content of a file to the standard output device. While the type command allows you to only view the text file (without modification), the edit command allows you to view and modify the text file.

For example, the type command below will display the content of the pcihelp.txt file on the screen:

type pcihelp.txt

Inversely, the edit command below will open the pcihelp.txt file in full-screen text editor mode with full modification capability.

edit pcihelp.txt

The editor supports UCS-2 and ASCI encoded text files. In the editor, you can use the arrow keys as well as page up and page down keys to move the cursor around. The editor does not have a menu and must be controlled with the function (Fx) keys.

The table below shows the supported keys with their associated functions.

F1 Go to line F5 Search and replace a string
F2 Save file F6 Delete line
F3 Save a modified file F7 Insert previously deleted line
F4 Search a string F8 Open a new file

hexedit

With hexedit command, you can view and modify binary files in UEFI Shell. You can also use it for block devices and memory regions.

For example, to open the binary file dump.bin in a full screen hex editor, type:

hexedit dump.bin

To open block device fs0 for editing, starting from block 0 with size of 1 block, type:

hexedit -d fs0 0 1

To open the memory region for editing, starting from address 0x8CC80B98 with size of 100 bytes, type:

hexedit -m 8CC80B98 100

In the editor, you can use the arrow keys as well as the page up and page down keys to move the cursor around. The editor does not have a menu and must be controlled with the function (Fx) keys.

The table below shows the supported keys with their associated functions.

F1 Go to offset F6 Delete block
F2 Save buffer/file F7 Insert previously deleted block
F3 Save a modified buffer/file F8 Open a new file
F4 Mark block start F9 Open a new block device
F5 Mark block end F10 Open a new memory region


Caution:

Ensure adequate care is taken when editing block devices and memory at runtime. Failure to do so may cause loss of data or system crash.

ver

The ver command displays the UEFI Firmware and the UEFI Shell versions. With -s parameter, the command displays only the UEFI Shell version.

For example, ver -s displays 2.2. This is the current version of the UEFI Shell as at the date of this document.

Debugging Commands

The following commands can be used in the UEFI Shell to diagnose and debug the system.

bcfg

The bcfg command can be used to display and modify the boot option variables stored in the UEFI firmware NVRAM.

With different bcfg command options, you can add, remove, or reorder boot option variables.


Note:

You must change the setup node “Boot Priority Selection” to “UEFI Standard” in order to support modification of boot variable ordering at runtime.


The most common bcfg command options are listed below:

  • bcfg boot dump - displays all boot options
  • bcfg boot add 2 OEMOS.efi “OEM OS“ - adds the boot loader OEMOS.efi in the root directory, as new boot option #2
  • bcfg boot mv 1 0 - moves boot option #1 to #0
  • bcfg boot mv 1 0 - removes boot option #0

The syntax for the boot option variables is Bootxxxx(where xxxx is a four-digit number)

dmem / mem

Both dmem and mem commands display the content of system memory or memory‑mapped device.

The mem command is a built-in alias for the dmem command.

Syntax:

dmem [-b] [address] [size]

The address and size must be typed in hex values. For example, to display 100 bytes of system memory, starting from address 0x90000000, type:

dmem 90000000 100

If the size is not specified, the default size of 512 bytes is displayed.

The dmemcommand without a parameter displays the contents of the EFI System Table. To redirect the contents of the UEFI System Table to a file UST.txt, type:

dmem > UST.txt

dmpstore

The dmpstore command is used to display and manage UEFI variables. The main debugging purpose of this command is to dump certain variables in the UEFI Shell.

Some examples of the dmpstore command are listed below:

  • Dump all variables to a file DumpVar.txt The file can be analyzed on a host PC using a text editor.

dmpstore > DumpVar.txt

  • Dump the EFIGlobalVariable “BootOrder“ The output helps to understand boot priority handling of the UEFI firmware.

dmpstore BootOrder

  • Dump the EFIGlobalVariable “BootCurrent“ The output helps to understand boot priority handling of the UEFI firmware.

dmpstore BootCurrent

  • Dump the Secure Boot Platform Key variable one screen at a time.

dmpstore *PK* -b

  • Dump the Secure Boot Key Exchange Key variable one screen at a time.

dmpstore *KEK* -b

  • Dump the Secure Boot db and dbx variables one screen at a time.

dmpstore *DB* -b


Note:

The asterisk (*) can be used as a placeholder for the variable name. All variables that match the naming convention will be dumped.

memmap

The memmapcommand displays the memory map maintained by the UEFI environment. The UEFI firmware keeps track of all the physical memory in the system and how it is being used.

For the description of how the Memory Attribute Descriptors are used, refer to the UEFI specification.

Examples:

  • memmap -b display the memory map one page at a time
  • memmap > MemoryMap.txt - dump the memory map to a file MemoryMap.txt

mm

The mmcommand can be used to display or modify memory, memory mapped IO, PCI(e) configuration space and legacy IO.

Syntax:

mm address [value] [-w 1|2|4|8] [-MEM | -MMIO | -IO | -PCIE] [-n]

The parameters and options are described below:

  • address

This parameter is mandatory and must be in hexadecimal format. It specifies the start address of the memory area or the IO register to be modified or read from.

  • value

If value is specified, the mm command writes the value to the address location without user interaction. This parameter must be in hexadecimal format.

  • -w

The -w option defines the access width in bytes. Default width is 1 byte.

  • -n

The -n option switches the command to non-interactive mode and displays the value of the specified address. This value cannot be overridden. Without -n option, the user can edit the value of the specified memory or IO location.

  • -MEM, -MMIO, -IO, -PCIE

These parameter options define the address type. If none of these types is specified, -MEM is assumed.

Examples:

Some examples of the mm command are listed below:

  • Read one byte of memory in interactive mode

mm 0x40000000

Output: MEM 0x0000000040000000 : 0xC2 > _

In the interactive mode, you can override the current value or press the Enter key to read the next byte of data.

  • Read four bytes of memory in non-interactive mode

mm 0x40000000 -w 4 -n

Output: MEM 0x0000000040000000 : 0x1E4E3EC2

  • Write two bytes of memory (writes are always non-interactive)

mm 0x40000000 0x1234 -w 2

  • Read one byte of IO port 80h (BIOS POST code port) in interactive mode

mm 0x80 -IO

Output: MEM 0x0000000000000080 : 0x78 > _

On congatec evaluation carrier boards, you can see this IO port on a 7-segment display.

  • Read the Vendor and Device ID in PCI Express configuration space

mm 0x0000000200000 -w 4 –PCIE -n

PCIE 0x0000000000200000 : 0x3E9B8086

You do not need Interactive mode for Vendor and Device ID because these registers are read only.

In addition to the -PCIE address type, the mm command also supports a -PCI address type. The PCI address type supports only 256 bytes of config space, whereas PCIE address type supports 4k bytes. Therefore, their address format is slightly different.

The -PCIE format has 3-digit register while the -PCI format has 2-digit register. The formats are:

-PCIE: ssssbbddffrrr

-PCI: ssssbbddffrr

where

  • ssss = Segment
  • bb = Bus
  • dd = Device
  • ff = Function
  • rr or rrr = Register


Note:

With the -PCIE address type, you can read or modify the PCI config space by setting the uppermost digit of the register in -PCIE format to 0.

pci

The pcicommand displays the complete PCI device list. It can also display the configuration space of a PCI or PCIe device.

To display the PCI device list one screen at a time, type:

pci -b

To redirect the output of the pci command to a file pcitree.txt type:

pci > pcitree.txt When you type the pci command without a Bus Device Function (BDF) parameter, it lists the PCI device tree. When you type it with the BDF parameters, the command reads the config space of the selected device. For example:

When you type the pci command without a Bus Device Function (BDF) parameter, it lists the PCI device tree. When you type it with the BDF parameters, the command reads the config space of the selected device. For example:

pci 0 1F 6

The above command reads the 256 bytes configuration registers of the PCI function at bus 0, device 1Fh and function 6. The BDF numbers must be hexadecimal numbers.

The config space of a PCI device is only 256 bytes and can be displayed on one screen. For PCI Express devices with a 4k config space, use the -b parameter to pause the output after one page on the screen. For example:

pci 0 2 0 -b

Use the iparameter to display interpreted (verbose) information for the configuration space registers. For example:

pci 0 17 0 -i


Note:

The pci command only displays the PCI and PCI Express configuration space registers. To modify these registers, use the mm command.

reset

The reset command is used to reset the system. The command has three parameter options:

  • -s for shutdown (transition to SoftOff (S5), no reboot)
  • -w for warm boot (system reset without power cycle)
  • -c for cold boot (system reboot with power off/on cycle)

If no parameter is used, the resetcommand will perform a cold reboot by default. With -fwuiparameter, the UEFI firmware will launch its user interface (BIOS setup) on the next boot.

Examples:

  • To perform a system shutdown:

reset -s

  • To perform a cold reset of the system:

reset -c

  • To perform a warm reset of the system and enter BIOS setup on the next boot:

reset -w -fwui

sermode

The sermodecommand displays or sets baud rate, parity attribute, data bits and stop bits of a serial port. If no attributes are specified, then the current settings for all serial ports are displayed.

For example, to display the settings of all serial ports, type:

sermode

The output of the command on our test system is shown below:

150(88414B18) – (115200, N, 8, 1)

151(88414118) – (115200, N, 8, 1)

The system has two serial ports with device handle 150 and 151 enabled. Both serial ports have 115200 baud rate, no parity, 8 data and 1 stop bit.

To change the settings for the second serial port to 9600 baud rate and even parity, type:

sermode 151 9600 e 8 1

A confirmation message Mode set on handle 151 successfully displays.

Use the sermode command to verify the new settings:

sermode

This displays the following:

150(88414B18) – (115200, N, 8, 1)

151(88414118) – (9600, E, 8, 1)

For a list of all supported baud rate, parity, data and stop bit attribute settings, type:

help sermode -b

setvar

Similar to the dmpstorecommand, the setvarcommand can be used to display, create, delete or modify a UEFI variable. Unlike the dmpstorecommand, which can only load a variable from a file, the setvarcommand can directly modify a variable.

Some examples of the setvar command are listed below:

  • Display the EfiGlobalVariable “BootCurrent” (similar to dmpstore BootOrder).

setvar BootOrder

  • Write a new value to the EfiGlobalVariable “BootCurrent” With dmpstorecommand, this action is not possible.

setvar BootOrder =0x00030002

In addition to the “0x” indicator for a hexadecimal number, you can also use the “H” notation for a hexadecimal byte array. For example:

setvar BootOrder = H02000300

(Both commands will write the same value to the BootCurrent variable)

  • Display only the variable named "testvar1" associated with the given GUID value.

setvar testvar1 -guid 12345678-1111-2222-3333-1234567890AB

To access a variable that is not EFI­_GLOBAL_VARIABLE, you must use the ‑guid option.

  • Delete the variable named “testvar1” associated with the given GUID value.

setvar testvar1 -guid 12345678-1111-2222-3333-1234567890AB =


Note:

Having the equal sign “=” at the end of the setvar command (without data assigned) will delete the variable “testvar1”.

smbiosview

The smbiosviewcommand displays the SMBIOS information. When you type the command without parameter or with parameter -a, it displays the information for all SMBIOS structures.

For example:

smbiosview or smbiosview -a

The -t parameter allows you to select and display a specific SMBIOS structure type.

To get an overview of all supported SMBIOS types, type:

help smbiosview -b

To save all SMBIOS structures to a file smbiosdata.txt type:

smbiosview -a > smbiosdata.txt

To display SMBIOS structure 1 (system information), type:

smbiosview -t 1 -b