logo资料库

UEFI SHELL.pdf

第1页 / 共143页
第2页 / 共143页
第3页 / 共143页
第4页 / 共143页
第5页 / 共143页
第6页 / 共143页
第7页 / 共143页
第8页 / 共143页
资料共143页,剩余部分请下载后查看
1 Introduction
1.1 Overview
1.2 Help System of This Document
1.3 Terms
1.4 Conventions Used in This Document
1.4.1 Command Descriptions
1.4.2 Pseudo-Code Conventions
1.4.3 Typographic Conventions
2 Features
2.1 Shell Features Introduction
2.2 Shell Appearance
2.3 Supported Features
2.3.1 Supported Features
2.3.2 EFI Shell Commands
2.3.3 Batch Scripts
2.3.4 Nesting the Shell
2.3.5 PATH Variable Support
2.3.6 KEY History Support
2.3.7 Execution Interrupts
2.3.7.1 Execution Interrupt Support
2.3.7.2 Script Execution Interrupt
2.3.7.3 Internal Command Execution Interrupt
2.3.8 Consistent Mapping of File Systems
2.3.9 Output Redirection
2.3.10 Output Streaming Control
2.3.11 Scroll Back Buffer Support
2.3.12 Verbose Help Support
2.3.13 EFI Compatibility of the EFI Shell
2.3.14 Running Modes and Backward-Compatibility Support
2.4 Invoking the EFI Shell
2.4.1 Invoking the EFI Shell
2.4.2 Start-up Batch File Startup.nsh
2.4.3 EFI Shell Prompt
3 Syntax
3.1 Introduction
3.2 Special Characters
3.3 Variable and Alias Substitution
3.3.1 Environment Variables and Variable Substitution
3.3.2 Alias Substitution
3.3.3 Valid Characters for Variable Names
3.3.4 Variables Available Only in Batch Scripts
3.3.5 Special Shell Variables
3.3.6 Variable Substitution Flowchart
3.4 Wildcard Expansion
3.5 Switches and Arguments in Commands
3.6 Quotation Marks
3.7 Output Redirection
3.8 File Naming Conventions
4 Batch Scripts
4.1 Introduction
4.2 Batch Script Command Descriptions
4.2.1 Summary of Batch Script Commands
4.2.2 for...endfor
4.2.3 goto
4.2.4 if...else...endif
4.2.5 pause
4.2.6 shift
4.3 Variable, Argument, and Alias Substitution
4.3.1 Variable, Argument, and Alias Substitution in Batch Scripts
4.3.2 Alias Substitution Rule in Batch Scripts
4.3.3 General Variable Substitution Rule in Batch Scripts
4.3.4 General Command Line Variable Substitution Rule in Batch Scripts
4.3.5 Supported Number of Arguments in Batch Scripts
4.3.6 Syntax for Variables in Batch Scripts
4.3.7 Example of Variable, Argument, and Alias Substitution in Batch Scripts
4.4 Comments
4.5 Error Handling
4.6 Running Modes in Batch Scripts
4.7 Nesting Batch Scripts
4.8 Output Redirection in Batch Scripts
4.9 Echoing in Batch Scripts
4.10 Known Limitations with the Shell Scripting Language
5 Commands
5.1 Introduction
5.2 External Commands
5.3 Supported EFI Protocols in the Shell
5.4 MS-DOS* 6.22 and Unix* Equivalents
5.5 Internal Command Descriptions
5.5.1 Summary of EFI Shell Internal Commands
5.5.2 Command Usage Notes
5.5.3 alias
5.5.4 attrib
5.5.5 cd
5.5.6 cls
5.5.7 connect
5.5.8 copy
5.5.9 cp
5.5.10 date
5.5.11 del
5.5.12 dh
5.5.13 dir
5.5.14 disconnect
5.5.15 drivers
5.5.16 drvcfg
5.5.17 drvdiag
5.5.18 echo
5.5.19 exit
5.5.20 help
5.5.21 load
5.5.22 ls
5.5.23 map
5.5.24 mkdir
5.5.25 mv
5.5.26 reconnect
5.5.27 reset
5.5.28 rm
5.5.29 set
5.5.30 time
5.5.31 touch
5.5.32 type
5.5.33 unload
5.5.34 ver
5.5.35 vol
6 Shell How To's
6.1 Introduction
6.2 How to Switch an External Command to an Internal Command
6.3 How to Switch an Internal Command to an External Command
6.4 How to Understand Consistent Mapping
6.5 How to Switch the Running Modes of the EFI Shell
6.6 How to Correctly Write Scripts in the New EFI Shell
6.7 How to Start a Specific startup.nsh File When Launching EFI Shell
6.8 How to Understand the Use of Quotation Marks
6.9 How to Understand the Use of the Escaping Character '^'
6.10 How to Alias
6.11 How to Map a File System to a User-Specific Mapping Name
6.12 How to Set/Modify/Delete Environment Variables
6.13 How to Launch and Exit the EFI Shell
6.14 How to Determine the Version of the EFI Shell
6.15 How to Get Help Information
6.16 How to Terminate the Execution of Commands
6.17 How to Pause the Screen Output
6.18 How to View the Screen History
6.19 How to Redirect the Output of Commands to Files
6.20 How to View the Contents of a Text File
6.21 How to Edit a Text File
6.22 How to Edit a Binary File
6.23  How to Edit Disk Blocks
6.24 How to Edit Memory
6.25 How to Connect a Driver to a Device
EFI Shell User’s Guide Draft for Review Version 1.0_to7thRvw July 7, 2005 i
EFI Shell User's Guide Information in this document is provided in connection with Intel products. No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted by this document. Except as provided in Intel's Terms and Conditions of Sale for such products, Intel assumes no liability whatsoever, and INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. Intel products are not intended for use in medical, life saving, or life sustaining applications. Intel may make changes to specifications and product descriptions at any time, without notice. This document contains information on products in the design phase. The information here is subject to change without notice. Do not finalize a design with this information. Designers must not rely on the absence or characteristics of any features or instructions marked "reserved" or "undefined." Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. This document as well as the software described in it is furnished under license and may only be used or copied in accordance with the terms of the license. The information in this manual is furnished for informational use only, is subject to change without notice, and should not be construed as a commitment by Intel Corporation to update or revise the information or document. Intel Corporation assumes no responsibility or liability for any errors or inaccuracies that may appear in this document or any software that may be provided in association with this document. This document provides website addresses for certain third party websites. The referenced sites are not under the control of Intel and Intel is not responsible for the content of any referenced site or any link contained in a referenced site. Intel does not endorse companies or products for sites which it references. If you decide to access any of the third party sites referenced in this document, you do this entirely at your own risk. *Other names and brands may be claimed as the property of others. Intel, the Intel logo, Itanium, and Pentium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. Copyright © 2000–2005, Intel Corporation. All Rights Reserved. ii
Revision History Revision 1.0_toRvw 1.0_to2ndRvw 1.0_to7thRvw Revision History Finished editing pass and first help version. Sent to engr owner for review. This version is missing the Shell How To's chapter (will be added soon). Added Shell How To's chapter and sent for review. Incorporated the review comments that I received from Winters. Did not receive replies for all of my review questions, so some are still included in this version. Incorporated review comments received from Fang & Liu. (External). Synchronized database. Date 7/15/04 8/2/04 8/25/04 7/6/2005 1.0to7thRvw July, 2005 iii
EFI Shell User's Guide iv
Contents 1.4.1 1.4.2 1.4.3 2.4 1 Introduction ...................................................................................................... 9 1.1 Overview ........................................................................................................................9 1.2 Help System of This Document......................................................................................9 1.3 Terms .............................................................................................................................9 1.4 Conventions Used in This Document...........................................................................10 Command Descriptions .................................................................................10 Pseudo-Code Conventions............................................................................11 Typographic Conventions..............................................................................11 2 Features .......................................................................................................... 13 2.1 Shell Features Introduction ..........................................................................................13 2.2 Shell Appearance.........................................................................................................13 2.3 Supported Features .....................................................................................................14 Supported Features.......................................................................................14 2.3.1 EFI Shell Commands.....................................................................................15 2.3.2 Batch Scripts .................................................................................................15 2.3.3 Nesting the Shell ...........................................................................................16 2.3.4 PATH Variable Support .................................................................................16 2.3.5 KEY History Support......................................................................................17 2.3.6 Execution Interrupts.......................................................................................17 2.3.7 Consistent Mapping of File Systems .............................................................18 2.3.8 Output Redirection.........................................................................................18 2.3.9 2.3.10 Output Streaming Control..............................................................................18 2.3.11 Scroll Back Buffer Support ............................................................................19 2.3.12 Verbose Help Support ...................................................................................19 2.3.13 EFI Compatibility of the EFI Shell..................................................................19 2.3.14 Running Modes and Backward-Compatibility Support ..................................20 Invoking the EFI Shell ..................................................................................................20 Invoking the EFI Shell....................................................................................20 2.4.1 2.4.2 Start-up Batch File Startup.nsh .....................................................................20 EFI Shell Prompt ...........................................................................................21 2.4.3 3 Syntax.............................................................................................................. 22 Introduction ..................................................................................................................22 3.1 3.2 Special Characters.......................................................................................................22 3.3 Variable and Alias Substitution ....................................................................................23 Environment Variables and Variable Substitution .........................................23 Alias Substitution...........................................................................................23 Valid Characters for Variable Names ............................................................23 Variables Available Only in Batch Scripts......................................................23 Special Shell Variables..................................................................................24 Variable Substitution Flowchart .....................................................................25 3.4 Wildcard Expansion .....................................................................................................27 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 1.0to7thRvw July, 2005 v
EFI Shell User's Guide 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 3.5 Switches and Arguments in Commands ......................................................................27 3.6 Quotation Marks...........................................................................................................28 3.7 Output Redirection .......................................................................................................29 3.8 File Naming Conventions .............................................................................................30 4 Batch Scripts .................................................................................................. 31 4.1 Introduction ..................................................................................................................31 4.2 Batch Script Command Descriptions ...........................................................................31 Summary of Batch Script Commands ...........................................................31 for...endfor .....................................................................................................32 goto................................................................................................................34 if...else...endif ................................................................................................35 pause.............................................................................................................36 shift................................................................................................................39 4.3 Variable, Argument, and Alias Substitution..................................................................40 Variable, Argument, and Alias Substitution in Batch Scripts .........................40 Alias Substitution Rule in Batch Scripts.........................................................41 General Variable Substitution Rule in Batch Scripts .....................................41 General Command Line Variable Substitution Rule in Batch Scripts ............41 Supported Number of Arguments in Batch Scripts........................................42 Syntax for Variables in Batch Scripts ............................................................42 Example of Variable, Argument, and Alias Substitution in Batch Scripts ......42 4.4 Comments....................................................................................................................43 4.5 Error Handling..............................................................................................................43 4.6 Running Modes in Batch Scripts ..................................................................................44 4.7 Nesting Batch Scripts...................................................................................................44 4.8 Output Redirection in Batch Scripts .............................................................................44 4.9 Echoing in Batch Scripts ..............................................................................................45 4.10 Known Limitations with the Shell Scripting Language..................................................45 5 Commands...................................................................................................... 46 5.1 Introduction ..................................................................................................................46 5.2 External Commands.....................................................................................................46 5.3 Supported EFI Protocols in the Shell ...........................................................................46 5.4 MS-DOS* 6.22 and Unix* Equivalents .........................................................................48 5.5 Internal Command Descriptions...................................................................................49 Summary of EFI Shell Internal Commands ...................................................49 5.5.1 Command Usage Notes ................................................................................50 5.5.2 alias ...............................................................................................................51 5.5.3 5.5.4 attrib...............................................................................................................53 cd...................................................................................................................56 5.5.5 cls ..................................................................................................................58 5.5.6 5.5.7 connect..........................................................................................................59 copy...............................................................................................................62 5.5.8 5.5.9 cp...................................................................................................................66 5.5.10 date................................................................................................................69 5.5.11 del..................................................................................................................70 5.5.12 dh...................................................................................................................73 vi
5.5.13 dir...................................................................................................................77 5.5.14 disconnect .....................................................................................................79 5.5.15 drivers............................................................................................................82 5.5.16 drvcfg.............................................................................................................84 5.5.17 drvdiag...........................................................................................................88 5.5.18 echo...............................................................................................................91 5.5.19 exit.................................................................................................................94 5.5.20 help................................................................................................................94 load................................................................................................................97 5.5.21 5.5.22 ls....................................................................................................................98 5.5.23 map..............................................................................................................101 5.5.24 mkdir............................................................................................................108 5.5.25 mv................................................................................................................110 reconnect.....................................................................................................112 5.5.26 5.5.27 reset.............................................................................................................115 rm ................................................................................................................116 5.5.28 set................................................................................................................118 5.5.29 time..............................................................................................................121 5.5.30 5.5.31 touch............................................................................................................122 5.5.32 type..............................................................................................................124 5.5.33 unload..........................................................................................................127 ver................................................................................................................129 5.5.34 5.5.35 vol................................................................................................................131 6 Shell How To's.............................................................................................. 133 6.1 Introduction ................................................................................................................133 6.2 How to Switch an External Command to an Internal Command ................................133 6.3 How to Switch an Internal Command to an External Command ................................134 6.4 How to Understand Consistent Mapping....................................................................135 6.5 How to Switch the Running Modes of the EFI Shell...................................................135 6.6 How to Correctly Write Scripts in the New EFI Shell..................................................136 6.7 How to Start a Specific startup.nsh File When Launching EFI Shell..........................136 6.8 How to Understand the Use of Quotation Marks........................................................137 6.9 How to Understand the Use of the Escaping Character '^' ........................................138 6.10 How to Alias ...............................................................................................................139 6.11 How to Map a File System to a User-Specific Mapping Name ..................................139 6.12 How to Set/Modify/Delete Environment Variables .....................................................139 6.13 How to Launch and Exit the EFI Shell........................................................................140 6.14 How to Determine the Version of the EFI Shell..........................................................140 6.15 How to Get Help Information......................................................................................141 6.16 How to Terminate the Execution of Commands.........................................................141 6.17 How to Pause the Screen Output...............................................................................141 6.18 How to View the Screen History.................................................................................142 6.19 How to Redirect the Output of Commands to Files....................................................142 6.20 How to View the Contents of a Text File ....................................................................142 6.21 How to Edit a Text File ...............................................................................................142 6.22 How to Edit a Binary File............................................................................................142 6.23 How to Edit Disk Blocks .............................................................................................143 1.0to7thRvw July, 2005 vii
EFI Shell User's Guide 6.24 How to Edit Memory...................................................................................................143 6.25 How to Connect a Driver to a Device .........................................................................143 Figures Figure 2-1 EFI Shell Look and Feel ......................................................................................14 Figure 3-1 Variable and Argument Substitution Flowchart....................................................26 Table Table 1-1 Organization of This Document .............................................................................9 Table 2-1 Types of Commands Available in the EFI Shell...................................................15 Table 2-2 EFI Shell Command Help Information Level........................................................19 Table 3-1 Special Characters in the EFI Shell .....................................................................22 Table 3-2 Index and Positional Variables ............................................................................24 Table 3-3 Special Shell Variables ........................................................................................24 Table 3-4 Wildcard Character Expansion ............................................................................27 Table 3-5 Output Redirection Syntax...................................................................................29 Table 4-1 EFI Shell Batch Script Commands ......................................................................31 Table 4-2 Additional Information on Running Modes...........................................................44 Table 5-1 EFI Shell Protocol Information Table ...................................................................46 Table 5-2 MS-DOS 6.22 and Unix Equivalents for Shell Internal Commands .....................48 Table 5-3 EFI Shell Internal Commands..............................................................................49 Table 5-4 Conventions for Directory Names........................................................................56 Table 5-5 Default Values for the Type Parameter ...............................................................85 Table 6-1 Examples of Custom Aliases .............................................................................139 viii
分享到:
收藏