搜尋此網誌

2011年10月27日 星期四

8x86真實模式(Real Mode)與保護模式(Protected Mode)

以定址模式來說,可區分為真實模式(Real Mode)與保護模式(Protected Mode)。

真實模式(Real Mode):
16BITSCPU,它20條的位址線(A0~A19),所以能夠處理的最大容量為220 = 1048576Bytes
1048576 / 1024 = 1024 Kbytes = 1Mbytes。一般BIOS所能存取的範圍。
定址方式,如下:
0x1000(Segment):0x1234(Offset) = (0x1000(Segment) << 4) | 0x1234(Offset) = 0x11234(Address)

80286的保護模式:
80286支援24條的位址線(A0~A23),而可定址範圍就高達224 = 16MBytes。

80386/486的的IA32保護模式定址:
80386/80486 CPU更高達32的位址線(A0~A31)32條位址線,232 = 4GBytes。

2011年10月23日 星期日

EFI Shell commands -- TELNETMGMT(改變控制台型態)

Change terminal type

TELNETMGMT [-t ]

     -t      - Specifies the terminal type
               Available types:
                 0   - PcAnsi type
                 1   - vt100 type
                 2   - vt100 plus type
                 3   - VTUTF8 type

EFI Shell commands -- SHIFT(位移批次檔輸入參數位置)

Shifts batch file input parameter positions.

SHIFT

Note:

    1. The SHIFT command is only available in batch script files.
    2. Each time the SHIFT command is executed the parameters are shifted one
       position higher, giving you access to more than ten parameters.

Examples:

  * To execute a batch file named MySript.nsh:
    fs0:\> MyScript.nsh X1 X2 X3 X4 X5 X6 X7 X8 X9 X10

    The parameters available when MyScript.nsh initially begins execution will
    be set as follows:
    %1 = X1
    %2 = X2
    %3 = X3
    %4 = X4
    %5 = X5
    %6 = X6
    %7 = X7
    %8 = X8
    %9 = X9

  * To shift the parameters one position inside the batch file:
    shift

    The parameters available in MyScript.nsh are changed as follows:
    %1 = X2
    %2 = X3
    %3 = X4
    %4 = X5
    %5 = X6
    %6 = X7
    %7 = X8
    %8 = X9
    %9 = X10

2011年10月22日 星期六

EFI Shell commands -- ALIAS(在一個EFI Shell環境中,顯示、建立、或刪除別名)

Displays, creates, or deletes aliases in the EFI Shell environment.

ALIAS [-d|-v] [sname] [value]


    -d       - Deletes an alias
    -v       - Volatile variable
    sname    - Alias name
    value    - Original name

Note:
    1. 'sname' should not be an internal EFI Shell command.
    2. 'value' can be an internal EFI Shell command, a script, or an EFI
       application. However, any other values are also acceptable.
    3. ALIAS values are stored in EFI NVRAM and will be retained between boots
       unless the '-v' option is specified.
    4. ALIAS will not add a nonvolatile alias when a volatile alias of the same
       name already exists, or vice versa.

Examples:
  * To display all aliases in the EFI Shell environment:
    Shell> alias
        md   : mkdir
        rd   : rm

  * To create an alias in the EFI Shell environment:
    Shell> alias myguid guid
    Shell> alias
        md     : mkdir
        rd     : rm
        myguid : guid

  * To delete an alias in the EFI Shell environment:
    Shell> alias -d myguid
    Shell> alias
        md   : mkdir
        rd   : rm

  * To add a volatile alias in the current EFI environment, which has a star *
    at the line head. This volatile alias will disappear at next boot.
    Shell> alias -v fs0 floppy
    Shell> alias
        md   : mkdir
        rd   : rm
      * fs0  : floppy

EFI Shell commands -- ATTRIB(顯示或改變檔案或目錄的屬性)

Displays or changes the attributes of files or directories.

ATTRIB [+a|-a] [+s|-s] [+h|-h] [+r|-r] [file...] [directory...]


    +a|-a      - Sets or clears the 'archive' attribute
    +s|-s      - Sets or clears the 'system' attribute
    +h|-h      - Sets or clears the 'hidden' attribute
    +r|-r      - Sets or clears the 'read only' attribute
    file       - File name (wildcards are permitted)
    directory  - Directory name (wildcards are permitted)

Notes:
    1. If no attributes parameters are specified, the current attributes of
       the specified files or directories will be displayed.
    2. If no files or directories are specified, then the command applies to
       all files and sub-directories within the current directory.

Examples:
  * To display the attributes of a directory:
    fs0:\> attrib fs0:\
    attrib:D     fs0:\

  * To display the attributes of all files and sub-directories in the current
    directory:
    fs0:\> attrib *
    attrib: AS   fs0:\serial.efi
    attrib:DA   fs0:\test1
    attrib: A HR fs0:\bios.inf
    attrib: A    fs0:\VerboseHelp.txt
    attrib: AS   fs0:\IsaBus.efi

  * To add the system attribute to all files with extension '.efi':
    fs0:\> attrib +s *.efi

  * To remove the read only attribute from all files with extension '.inf':
    fs0:\> attrib -r *.inf
    attrib: A H  fs0:\bios.inf

EFI Shell commands -- CD(顯示或改變目前目錄)

Displays or changes the current directory.

CD [path]
    path     - The relative or absolute directory path

Note:
    1. Type CD without parameters to display the current fs and directory.
    2. There must be at least one blank space between CD and path.
    3. The 'path' parameter supports certain special characters:
       - '.'  refers to the current directory.
       - '..' refers to the parent directory.
       - '\' used at the beginning of the path refers to the root directory of
         the current filesystem.
    4. CD can only be used to change directories in the current file system.

Examples:
  * To change the current filesystem to the mapped fs0 filesystem:
    Shell> fs0:

  * To change the current directory to subdirectory 'efi':
    fs0:\> cd efi

  * To change the current directory to the parent directory (fs0:\):
    fs0:\efi\> cd ..

  * To change the current directory to 'fs0:\efi\tools':
    fs0:\> cd efi\tools

  * To change the current directory to the root of the current fs (fs0):
    fs0:\efi\tools\> cd \
    fs0:\>

  * To change volumes with cd will not work!! For example:
    fs0:\efi\tools\> cd fs1:\  !!!! will not work !!!!
    must first type fs1: then cd to desired directory

  * To move between volumes and maintain the current path.
    fs0:\> cd \efi\tools
    fs0:\efi\tools\> fs1:
    fs1:\> cd tmp
    fs1:\tmp> cp fs0:*.* .
    copies all of files in fs0:\efi\tools into fs1:\tmp directory

EFI Shell commands -- CLS(清除標準輸出與隨意改變背景顏色)

Clears the standard output and optionally changes the background color.

CLS [color]


    color    - New background color
                 0   - Black
                 1   - Blue
                 2   - Green
                 3   - Cyan
                 4   - Red
                 5   - Magenta
                 6   - Yellow
                 7   - Light gray

Note:
    1. If no parameters are specified, this command clears the standard output
       device. The background color is not changed.

Examples:
  * To clear standard output without changing the background color:
    fs0:\> cls

  * To clear standard output and change the background color to cyan:
    fs0:\> cls 3

  * To clear standard output and change the background to the default color:
    fs0:\> cls 0

EFI Shell commands -- COMP(根據位元去比較兩個檔案內容)

Compares the contents of two files on a byte for byte basis.

COMP [-b] file1 file2


    -b       - Display one screen at a time
    file1    - First file name  (directory name or wildcards not permitted)
    file2    - Second file name (directory name or wildcards not permitted)

Note:
    1. COMP will compare files in binary mode.
    2. COMP will exit immediately if the lengths of the compared files are
       different.
    3. COMP will exit if 10 differences encountered.

Examples:
  * To compare two files with different lengths:
    fs0:\> comp bios.inf legacy.inf
    Compare fs0:\bios.inf to fs0:\legacy.inf
    Difference #1: File sizes mismatch
    [difference(s) encountered]

  * To compare two files with the same contents:
    fs0:\> comp bios.inf rafter.inf
    Compare fs0:\bios.inf to fs0:\rafter.inf
    [no difference encountered]

  * To compare two files with the same length but different contents:
    fs0:\> comp bios.inf bios2.inf
    Compare fs0:\bios.inf to fs0:\bios2.inf
    Difference #1:
    File1: fs0:\bios.inf
     00000000: 5F                                               *_*
    File2: fs0:\bios2.inf
     00000000: 33                                               *3*
    Difference #2:
    File1: fs0:\bios.inf
     0000000C: 00 00 00 00                                      *....*
    File2: fs0:\bios2.inf
     0000000C: 25 32 03 03                                      *%2..*
    [difference(s) encountered]

EFI Shell commands -- CP(複製一個或多個檔案或目錄到另一個位置)

Copies one or more files or directories to another location.

CP [-r] [-q] src [src...] [dst]
-r      - Recursive copy
-q      - Quiet copying (replace existing files without prompt)
src     - Source file/directory name (wildcards are permitted)
dst     - Destination file/directory name (wildcards are not permitted)
Note:
  1. The '-r' option must be specified if src is a directory. If '-r' is specified, then the source directory will be recursively copied to the destination. 'src' itself will be copied.
  2. If the 'dst' parameter is not specified, then the current directory is assumed to be the destination.
  3. 'CP -r src1 src2 dst' copies all files and subdirectories in 'src1' and 'src2' to the destination 'dst'. 'src1' and 'src2' themselves are also copied. The 'dst' parameter will be interpreted as a directory.
  4. Copying a directory or file to itself is not allowed.
  5. If an error occurs, CP will exit immediately and the remaining files or directories will not be copied.
  6. When 'cp' is executed with a script file, it always performs quiet copying regardless of whether the '-q' option is specified.
  7. If you are copying multiple files, the destination must be an existing directory.
Examples:


* To display the contents of the current directory:    
* To display the contents of the current directory:    
    fs0:\〉 ls    
    Directory of: fs0:\〉    
      06/18/01  01:02p  〈DIR〉         512  efi
      06/18/01  01:02p  〈DIR〉         512  test1
      06/18/01  01:02p  〈DIR〉         512  test2
      06/13/01  10:00a             28,739  IsaBus.efi    
      06/13/01  10:00a             32,838  IsaSerial.efi    
      06/18/01  08:04p                 29  temp.txt    
      06/18/01  08:05p  〈DIR〉         512  test
              3 File(s)      61,606 bytes
              4 Dir(s)

  * To copy a file in the same directory but change the file name:    
  fs0:\〉 cp temp.txt readme.txt    
  copying fs0:\temp.txt -〉 fs0:\readme.txt
     - [ok]

  * To copy multiple files to another directory:    
  fs0:\〉 cp temp.txt isaBus.efi \test    
  copying fs0:\temp.txt -〉 fs0:\test\temp.txt   
     - [ok]    
  copying fs0:\isaBus.efi -〉 fs0:\test\IsaBus.efi
     - [ok]

  * To copy multiple directories recursively to another directory:
    fs0:\〉 cp -r test1 test2 boot \test
    copying fs0:\test1 -〉 fs0:\test\test1
    copying fs0:\test1\test1.txt -〉 fs0:\test\test1\test1.txt
     - [ok]
    copying fs0:\test2 -〉 fs0:\test\test2
    copying fs0:\test2\test2.txt -〉 fs0:\test\test2\test2.txt
     - [ok]
    copying fs0:\boot -〉 fs0:\test\boot
    copying fs0:\boot\shell.efi -〉 fs0:\test\boot\shell.efi
     - [ok]

  * To verify the results of the cp commands above:
    fs0:\〉 ls \test
    Directory of: fs0:\test
      06/18/01  01:01p  〈DIR〉     512  .
      06/18/01  01:01p  〈DIR〉       0  ..
      01/28/01  08:21p  〈DIR〉     512  test1
      01/28/01  08:21p  〈DIR〉     512  test2
      01/28/01  08:21p  〈DIR〉     512  boot
      01/28/01  08:23p             29  temp.txt      
      01/28/01  08:23p         28,739  IsaBus.efi              
              2 File(s)      28,828 bytes              
              5 Dir(s)


EFI Shell commands -- DBLK(從一個區塊裝置中,顯示一個或多個區塊內容)

Displays the contents of one or more blocks from a block device.

DBLK device [Lba] [blocks] [-b]


    -b       - Display one screen at a time
    device   - Block device name
    Lba      - Index of the first block to be displayed in hex format
    blocks   - Number of blocks to be displayed in hex format

Note:
    1. The 'Lba' and 'blocks' parameters are in hexadecimal format.
    2. The 'Lba' parameter defaults to 0 if not specified.
    3. The 'blocks' parameter defaults to 1 if not specified.
    4. If 'blocks' is larger than 10, only the first 10 blocks will be
       displayed.
    5. Lba + blocks should not be larger than the last block of the device.
    6. If a FAT file system is detected, some FAT parameters will also be
       displayed (label, systemid, oemid, sectorsize, clustersize, media etc)
       after all the blocks have been displayed.
    7. If a MBR is detected on a FAT file system, the partition information
       will be displayed after all the block contents have been displayed.

Examples:
  * To display one block of blk0, beginning from block 0:
    Shell>dblk blk0

  * To display one block of fs0, beginning from block 0x2:
    Shell>dblk fs0 2

  * To display 0x5 blocks of fs0, beginning from block 0x12:
    Shell>dblk fs0 12 5

  * To display 0x10 blocks of fs0, beginning from block 0x12:
    Shell>dblk fs0 12 10

  * The attempt to display more than 0x10 blocks will display only 0x10 blocks:
    Shell>dblk fs0 12 20

  * To display one block of blk2, beginning from the first block (blk0):
    fs1:\tmps1> dblk blk2 0 1

 LBA 0000000000000000 Size 00000200 bytes BlkIo 3F0CEE78
  00000000: EB 3C 90 4D 53 44 4F 53-35 2E 30 00 02 04 08 00  *.<.MSDOS5.0.....*
  00000010: 02 00 02 00 00 F8 CC 00-3F 00 FF 00 3F 00 00 00  *........?...?...*
  00000020: 8E 2F 03 00 80 01 29 2C-09 1B D0 4E 4F 20 4E 41  *./....),...NO NA*
  00000030: 4D 45 20 20 20 20 46 41-54 31 36 20 20 20 33 C9  *ME    FAT16   3.*
  00000040: 8E D1 BC F0 7B 8E D9 B8-00 20 8E C0 FC BD 00 7C  *......... ......*
  00000050: 38 4E 24 7D 24 8B C1 99-E8 3C 01 72 1C 83 EB 3A  *8N$.$....<.r...:*
  00000060: 66 A1 1C 7C 26 66 3B 07-26 8A 57 FC 75 06 80 CA  *f...&f;.&.W.u...*
  00000070: 02 88 56 02 80 C3 10 73-EB 33 C9 8A 46 10 98 F7  *..V....s.3..F...*
  00000080: 66 16 03 46 1C 13 56 1E-03 46 0E 13 D1 8B 76 11  *f..F..V..F....v.*
  00000090: 60 89 46 FC 89 56 FE B8-20 00 F7 E6 8B 5E 0B 03  *`.F..V.. ....^..*
  000000A0: C3 48 F7 F3 01 46 FC 11-4E FE 61 BF 00 00 E8 E6  *.H...F..N.a.....*
  000000B0: 00 72 39 26 38 2D 74 17-60 B1 0B BE A1 7D F3 A6  *.r9&8-t.`.......*
  000000C0: 61 74 32 4E 74 09 83 C7-20 3B FB 72 E6 EB DC A0  *at2Nt... ;.r....*
  000000D0: FB 7D B4 7D 8B F0 AC 98-40 74 0C 48 74 13 B4 0E  *........@t.Ht...*
  000000E0: BB 07 00 CD 10 EB EF A0-FD 7D EB E6 A0 FC 7D EB  *................*
  000000F0: E1 CD 16 CD 19 26 8B 55-1A 52 B0 01 BB 00 00 E8  *.....&.U.R......*
  00000100: 3B 00 72 E8 5B 8A 56 24-BE 0B 7C 8B FC C7 46 F0  *;.r.[.V$......F.*
  00000110: 3D 7D C7 46 F4 29 7D 8C-D9 89 4E F2 89 4E F6 C6  *=..F.)....N..N..*
  00000120: 06 96 7D CB EA 03 00 00-20 0F B6 C8 66 8B 46 F8  *........ ...f.F.*
  00000130: 66 03 46 1C 66 8B D0 66-C1 EA 10 EB 5E 0F B6 C8  *f.F.f..f....^...*
  00000140: 4A 4A 8A 46 0D 32 E4 F7-E2 03 46 FC 13 56 FE EB  *JJ.F.2....F..V..*
  00000150: 4A 52 50 06 53 6A 01 6A-10 91 8B 46 18 96 92 33  *JRP.Sj.j...F...3*
  00000160: D2 F7 F6 91 F7 F6 42 87-CA F7 76 1A 8A F2 8A E8  *......B...v.....*
  00000170: C0 CC 02 0A CC B8 01 02-80 7E 02 0E 75 04 B4 42  *............u..B*
  00000180: 8B F4 8A 56 24 CD 13 61-61 72 0B 40 75 01 42 03  *...V$..aar.@u.B.*
  00000190: 5E 0B 49 75 06 F8 C3 41-BB 00 00 60 66 6A 00 EB  *^.Iu...A...`fj..*
  000001A0: B0 4E 54 4C 44 52 20 20-20 20 20 20 0D 0A 52 65  *.NTLDR      ..Re*
  000001B0: 6D 6F 76 65 20 64 69 73-6B 73 20 6F 72 20 6F 74  *move disks or ot*
  000001C0: 68 65 72 20 6D 65 64 69-61 2E FF 0D 0A 44 69 73  *her media....Dis*
  000001D0: 6B 20 65 72 72 6F 72 FF-0D 0A 50 72 65 73 73 20  *k error...Press *
  000001E0: 61 6E 79 20 6B 65 79 20-74 6F 20 72 65 73 74 61  *any key to resta*
  000001F0: 72 74 0D 0A 00 00 00 00-00 00 00 AC CB D8 55 AA  *rt............U.*

Fat 16 BPB  FatLabel: 'NO NAME    '  SystemId: 'FAT16   ' OemId: 'MSDOS5.0'
 SectorSize 200  SectorsPerCluster 4 ReservedSectors 8  # Fats 2
 Root Entries 200  Media F8  Sectors 32F8E  SectorsPerFat CC
 SectorsPerTrack 3F Heads 255

EFI Shell commands -- DMEM(顯示系統內容或裝置記憶體)

Displays the contents of system or device memory.

DMEM [-b] [Address] [Size] [-MMIO]


    -b       - Display one screen at a time
    address  - Starting address in hexadecimal format
    size     - Number of bytes to display in hexadecimal format
    -MMIO    - Forces address cycles to the PCI bus

Note:
    1. All units are in hexadecimal format.
    2. Address must be aligned on an even processor address boundary.
    3. If the 'address' parameter is not specified, DMEM will display the
       all system table pointer entries by default.

Examples:
* To display the EFI system table pointer entries:
  fs0:\> dmem

  Memory Address 000000003FF7D808 200 Bytes
  3FF7D808: 49 42 49 20 53 59 53 54-02 00 01 00 78 00 00 00  *IBI SYST....x...*
  3FF7D818: 5C 3E 6A FE 00 00 00 00-88 2E 1B 3F 00 00 00 00  *\>j........?....*
  3FF7D828: 26 00 0C 00 00 00 00 00-88 D3 1A 3F 00 00 00 00  *&..........?....*
  3FF7D838: A8 CE 1A 3F 00 00 00 00-88 F2 1A 3F 00 00 00 00  *...?.......?....*
  3FF7D848: 28 EE 1A 3F 00 00 00 00-08 DD 1A 3F 00 00 00 00  *(..?.......?....*
  3FF7D858: A8 EB 1A 3F 00 00 00 00-18 C3 3F 3F 00 00 00 00  *...?..........*
  3FF7D868: 00 4B 3F 3F 00 00 00 00-06 00 00 00 00 00 00 00  *.K............*
  3FF7D878: 08 DA F7 3F 00 00 00 00-70 74 61 6C 88 00 00 00  *...?....ptal....*
  3FF7D888: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  *................*
  3FF7D898: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  *................*
  3FF7D8A8: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  *................*
  3FF7D8B8: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  *................*
  3FF7D8C8: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  *................*
  3FF7D8D8: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  *................*
  3FF7D8E8: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  *................*
  3FF7D8F8: 00 00 00 00 00 00 00 00-70 68 06 30 88 00 00 00  *........ph.0....*
  3FF7D908: 65 76 6E 74 00 00 00 00-02 02 00 60 00 00 00 00  *evnt.......`....*
  3FF7D918: 18 6F 1A 3F 00 00 00 00-10 E0 3F 3F 00 00 00 00  *.o.?..........*
  3FF7D928: 10 00 00 00 00 00 00 00-40 C0 12 3F 00 00 00 00  *........@..?....*
  3FF7D938: 10 80 13 3F 00 00 00 00-00 00 00 00 00 00 00 00  *...?............*
  3FF7D948: 00 00 00 00 00 00 00 00-40 7D 3F 3F 00 00 00 00  *........@.....*
  3FF7D958: 50 6F 1A 3F 00 00 00 00-00 00 00 00 00 00 00 00  *Po.?............*
  3FF7D968: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  *................*
  3FF7D978: 00 00 00 00 00 00 00 00-70 74 61 6C 88 00 00 00  *........ptal....*
  3FF7D988: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  *................*
  3FF7D998: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  *................*
  3FF7D9A8: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  *................*
  3FF7D9B8: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  *................*
  3FF7D9C8: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  *................*
  3FF7D9D8: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  *................*
  3FF7D9E8: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  *................*
  3FF7D9F8: 00 00 00 00 00 00 00 00-70 68 06 30 A0 00 00 00  *........ph.0....*

  Valid EFI Header at Address 000000003FF7D808
  --------------------------------------------
  System: Table Structure size 00000078 revision 00010002
  ConIn (3F1AD388) ConOut (3F1AF288) StdErr (3F1ADD08)
  Runtime Services 000000003F3FC318
  Boot Services    000000003F3F4B00
  SAL System Table 000000003FF22760
  ACPI Table       000000003FFD9FC0
  ACPI 2.0 Table   00000000000E2000
  MPS Table        000000003FFD0000
  SMBIOS Table     00000000000F0020

* To display memory contents from 1af3088 with size of 16 bytes:
  Shell> dmem 1af3088 16
  Memory Address 0000000001AF3088 16 Bytes
  01AF3088: 49 42 49 20 53 59 53 54-00 00 02 00 18 00 00 00 *IBI SYST........*
  01AF3098: FF 9E D7 9B 00 00                               *......*

* To display memory mapped IO contents from 1af3088 with size of 16 bytes:
  Shell> dmem 1af3088 16 -MMIO

EFI Shell commands -- DMPSTORE(顯示所有EFI NVRAM變數)

Displays all EFI NVRAM variables.

DMPSTORE [-b] [-d] [Variable]
DMPSTORE [Variable] -s file
DMPSTORE [Variable] -l file


    -b       - Display one screen at a time
    Variable - Display the specified variable name
    -d       - Delete variables
    -s       - Save variables to file
    -l       - Load and set variables from file

Note:
    1. If the 'variable' parameter is not specified, all variables will be
       displayed.
    2. The variable name is not case sensitive.

Examples:
* To display all EFI NVRAM variables:
  Shell> dmpstore

  Dump NVRAM

  Variable RT+BS 'Efi:BootCurrent' DataSize = 2
   00000000: FF FF                                           *..*
  Variable NV+RT+BS 'Efi:LangCodes' DataSize = 2A
   00000000: 65 6E 67 65 6E 6D 61 6E-67 63 68 69 7A 68 6F 64 *engenmangchizhod*
   00000010: 65 75 67 65 6D 67 65 72-67 6D 68 67 6F 68 66 72 *eugemgergmhgohfr*
   00000020: 61 66 72 65 66 72 6D 66-72 6F                   *afrefrmfro*
  Variable NV+RT+BS 'Efi:Lang' DataSize = 3
   00000000: 65 6E 67                                        *eng*
  ...
  Variable NV+BS 'ShellAlias:copy' DataSize = 6
   00000000: 63 00 70 00 00 00                                *c.p...*
  Variable NV+BS 'SEnv:path' DataSize = 4
   00000000: 2E 00 00 00                                      *....*

* To display the Boot0000 EFI NVRAM variable:
  Shell> dmpstore Boot0000
  Dump Variable Boot0000
  Variable NV+RT+BS 'Efi:Boot0000' DataSize = 48
  00000000: 01 00 00 00 30 00 42 00-6F 00 6F 00 74 00 30 00  *....0.B.o.o.t.0.*
  00000010: 30 00 30 00 30 00 00 00-01 04 14 00 B1 18 C5 58  *0.0.0..........X*
  00000020: F3 76 D4 11 BC EA 00 80-C7 3C 88 81 01 04 18 00  *.v.......<......*
  00000030: 2F A9 95 0C 06 A0 D4 11-BC FA 00 80 C7 3C 88 81  */............<..*
  00000040: 00 00 00 00 7F FF 04 00-                         *........*

EFI Shell commands -- DRVCFG(行使一個驅動程式配置協定)

Invokes the Driver Configuration Protocol.

DRVCFG [-l XXX] [-c] [-f Type|-v|-s]
       [DriverHandle [DeviceHandle [ChildHandle]]]


    -l           - Configure using the specified language
    -c           - Configure all child devices
    -f           - Force defaults
    -v           - Validate options
    -s           - Set options
    Type         - The type of default configuration options to force on the
                   controller specified by ControllerHandle and ChildHandle:
                     0   - Safe Defaults.
                     1   - Manufacturing Defaults.
                     2   - Custom Defaults.
                     3   - Performance Defaults.
    DriverHandle - Handle of the driver to configure
    DeviceHandle - Handle of a device that DriverHandle is managing
    ChildHandle  - Handle of a device that is a child of DeviceHandle

Note:
   1. Default Type.
       0 - Safe Defaults. Places a controller in a safe configuration with
           the greatest probability of functioning correctly in a platform.
       1 - Manufacturing Defaults. Optional type that places the controller in
           a configuration suitable for a manufacturing and test environment.
       2 - Custom Defaults. Optional type that places the controller in a
           custom configuration.
       3 - Performance Defaults. Optional type that places the controller in a
           configuration that maximizes the controller's performance in a
           platform.
       Other Value - Depends on the driver's implementation.

Examples:
  * To display the list of devices available for configuration:
    Shell> drvcfg

  * To display the list of devices and child devices available for
    configuration:
    Shell> drvcfg -c

  * To force defaults on all devices:
    Shell> drvcfg -f 0

  * To force defaults on all devices managed by driver 0x17:
    Shell> drvcfg -f 0 17

  * To force defaults on device 0x28 which is managed by driver 0x17:
    Shell> drvcfg -f 0 17 28

  * To force defaults on all child devices of device 0x28 which is managed by
    driver 0x17:
    Shell> drvcfg -f 0 17 28 -c

  * To force defaults on child device 0x30 of device 0x28 which is managed by
    driver 0x17:
    Shell> drvcfg -f 0 17 28 30

  * To validate options on all devices:
    Shell> drvcfg -v

  * To validate options on all devices managed by driver 0x17:
    Shell> drvcfg -v 17

  * To validate options on device 0x28 which is managed by driver 0x17:
    Shell> drvcfg -v 17 28

  * To validate options on all child devices of device 0x28 which are managed
    by driver 0x17:
    Shell> drvcfg -v 17 28 -c

  * To validate options on child device 0x30 of device 0x28 which is managed
    by driver 0x17:
    Shell> drvcfg -v 17 28 30

  * To set options on device 0x28 which is managed by driver 0x17:
    Shell> drvcfg -s 17 28

  * To set options on child device 0x30 of device 0x28 which is managed by
    driver 0x17:
    Shell> drvcfg -s 17 28 30

  * To set options on device 0x28 which is managed by driver 0x17, in English:
    Shell> drvcfg -s 17 28 -l eng

  * To set options on device 0x28 which is managed by driver 0x17, in Spanish:
    Shell> drvcfg -s 17 28 -l spa

EFI Shell commands -- DRVDIAG(行使一個驅動程式診斷協定)

Invokes the Driver Diagnostics Protocol.

DRVDIAG [-c] [-l XXX] [-s|-e|-m] [DriverHandle [DeviceHandle [ChildHandle]]]


    -c           - Diagnose all child devices
    -l           - Diagnose using the specified language
    -s           - Run diagnostics in standard mode
    -e           - Run diagnostics in extended mode
    -m           - Run diagnostics in manufacturing mode
    DriverHandle - Handle of the driver to configure
    DeviceHandle - Handle of a device that DriverHandle is managing
    ChildHandle  - Handle of a device that is a child of DeviceHandle

Examples:
  * To display the list of devices available for diagnostics:
    Shell> drvdiag

  * To display the list of devices and child devices available for diagnostics:
    Shell> drvdiag -c

  * To run diagnostics in standard mode on all devices:
    Shell> drvdiag -s

  * To run diagnostics in standard mode on all devices in English:
    Shell> drvdiag -s -l eng

  * To run diagnostics in standard mode on all devices in Spanish:
    Shell> drvdiag -s -l spa

  * To run diagnostics in standard mode on all devices and child devices:
    Shell> drvdiag -s -c

  * To run diagnostics in extended mode on all devices:
    Shell> drvdiag -e

  * To run diagnostics in manufacturing mode on all devices:
    Shell> drvdiag -m

  * To run diagnostics in standard mode on all devices managed by driver 0x17:
    Shell> drvdiag -s 17

  * To run diagnostics in standard mode on device 0x28 managed by driver 0x17:
    Shell> drvdiag -s 17 28

  * To run diagnostics in standard mode on all child devices of device 0x28
    managed by driver 0x17:
    Shell> drvdiag -s 17 28 -c

  * To run diagnostics in standard mode on child device 0x30 of device 0x28
    managed by driver 0x17:
    Shell> drvdiag -s 17 28 30
  No required handle found

EFI Shell commands -- ECHO(控制批次檔的回應與顯示一個訊息)

Controls batch file command echoing or displays a message.

ECHO [-on|-off]
ECHO [message]


    -on      - Enable  echo when executing batch file commands
    -off     - Disable echo when executing batch file commands
    message  - Display a message string

Note:
    1. Echo -off disables the echo feature when executing batch file commands.
       This command is not like the MS-DOS echo command.
    2. Echo without a parameter shows the current echo setting.

Examples:
  * To display the current echo setting:
    fs0:\> echo
    Echo is off

  * To enable command echoing:
    fs0:\> echo -on

  * To disable command echoing:
    fs0:\> echo -off

  * To execute HelloWorld.nsh batch file and echo commands when executing:
    fs0:\> HelloWorld.nsh
    +HelloWorld.nsh> echo Hello World
    Hello World

  * To display a message string of 'Hello World':
    fs0:\> echo Hello World
    Hello World

EFI Shell commands -- EFICOMPRESS(壓縮一個檔案)

Compress a file.

EFICOMPRESS infile outfile


    infile   - Filename for uncompressed input file
    outfile  - Filename for compressed output file

EFI Shell commands -- EFIDECOMPRESS(解壓縮一個檔案)

Decompress a file.

EFIDECOMPRESS infile outfile


    infile   - Filename of compressed input file
    outfile  - Filename of decompressed output file

EFI Shell commands -- ERR(顯示或修改系統中的錯誤層次)

Displays or changes the error level in the system.

ERR [ErrorLevel]
ERR -dump [Handle]
ERR Handle ErrorLevel


    ErrorLevel   - New error level bit mask
    -dump        - Display debug mask of all handles or specified handle
    Handle       - Device handle

Note:
    1. Saving to NVRAM will cause the error level to be saved and used on all
       future reboots. The EFI Core will use the new error level as system
       reboots. All core EFI routines will then output using the new error
       level.
    2. Error console must be set to a device path (i.e. com port or console).
    3. Not all EFI implementations include an error console or support debug
       output. Consult the BIOS release notes for this support.
    4. In debug version, the message whose error level is higher than the
       specified level will be displayed.
    5. To add your own errors/error level see debug macro in sample
       implementation source in efidebug.h.

Examples:
  * To display the current error message output level:
    Shell> err
    EFI ERROR 80000000
      00000001  EFI_D_INIT
      00000002  EFI_D_WARN
      00000004  EFI_D_LOAD
      00000008  EFI_D_FS
      00000010  EFI_D_POOL
      00000020  EFI_D_PAGE
      00000040  EFI_D_INFO
      00000100  EFI_D_VARIABLE
      00000400  EFI_D_BM
      00001000  EFI_D_BLKIO
      00004000  EFI_D_NET
      00010000  EFI_D_UNDI
      00020000  EFI_D_LOADFILE
      00080000  EFI_D_EVENT
      80000000  EFI_D_ERROR

  * To change the error message output level:
    Shell> err 80000107
    Make this change and save to NVRAM? [Y/N]y

    Shell> _

  * To dump the debug mask of all handles which support debug mask protocol:
    Shell> err -dump
     Handle     Mask
    ========  ========
           1: 80000004
           9: 80000004
           B: 80000004
           D: 80000004
           F: 80000004
          11: 80000004
          13: 80000004
          45: 80000004
          62: 80000004
          63: 80000004
          64: 80000004

  * To display the debug mask of handle 0x13:
    Shell> err -dump 13
     Handle     Mask
    ========  ========
          13: 80000004

  * To change the debug mask of handle 0x13:
    Shell> err 13 80000007

    Shell> _

EFI Shell commands -- EXIT(離開EFI Shell環境與歸還控制權到上一層處理機制)

Exits the EFI Shell environment and returns control to the parent process.

EXIT

Examples:
    Shell> exit

EFI Shell commands -- FOR(在一個項目集合中,去行一個或多個指令對於每個項目)

Executes one or more commands for each item in a set of items.

FOR %indexvar IN set
    command [arguments]
    [command [arguments]]
     ...
ENDFOR


FOR %indexvar RUN (start end[ step])
    command [arguments]
    [command [arguments]]
    ...
ENDFOR


    %indexvar           - Variable name used to index a set
    set                  - Set to be searched
    command [arguments]  - Command to be executed with optional arguments

Note:
    1. The FOR command is only available in batch script files.
    2. FOR shall be matched with ENDFOR.
    3. start and end can be any integer.  Up to 6 digits allowed.
    4. step can be any integer but zero.  Up to 6 digits allowed.
    5. step is optional, if step is not specified, step will be automatically
       determined as below:
         if start <= end, then step = 1
         if start > end,  then step = -1

Examples:
    #
    #  Sample for loop type contents of all *.txt files
    #
    for %a in *.txt
       type %a
       echo ===== %a done =====
    endfor

    #
    #  To repeat operations, supporting multiple loop:
    #
        for %a in 1 2 3 4 5 6 7 8 9
          for %b in a b c d e f g h i j k l m n o p q r s t u v w x y z
            alias %a a%a
            alias %b %b%a
          endfor
        endfor

        for %a run (1 3)
          echo %a
        endfor
Output:
1
2
3

        for %a run (3 1)
          echo %a
        endfor
Output:
3
2
1

EFI Shell commands -- GOTO(強制批次檔案中無條件的執行跳要至一個特定位置)

Forces batch file execution to unconditionally jump to specified location.

GOTO label


    label    - Specifies a location in batch file

Note:
    1. The GOTO command is only available in batch script files.
    2. Execution of batch file will jump to the line immediately following the
       specified label name.
    3. GOTO cannot jump from outside into a FOR cycle block.

Examples:
    #
    #  Example script for "goto" command
    #
    goto Done
    ...
    :Done
    cleanup.nsh

EFI Shell commands -- HEXEDIT(全螢幕的16 位元編輯器,可用於檔案、區塊裝置、或記憶體)

Full screen hex editor for files, block devices, or memory.

HEXEDIT [[-f] FileName | [-d DiskName Offset Size] | [-m Address Size]]


    -f      - Name of file to edit
    -d      - Disk block to edit:
                DiskName - Name of disk to edit (for example fs0)
                Offset   - Starting block number (beginning from 0)
                Size     - Number of blocks to be edited
    -m      - Memory region to edit:
                Address  - Starting 32-bit memory address (beginning from 0)
                Size     - Size of memory region to be edited in bytes

Examples:
  * To edit a file in hex mode:
    fs0:\> hexedit test.bin

  * To edit block device fs0 starting at block 0 with size of 2 blocks:
    fs0:\> hexedit -d fs0 0 2

  * To edit memory region starting at address 0x00000000 with size of 2 bytes:
    fs0:\> hexedit -m 0 2

EFI Shell commands -- IF(在一個特定的狀況去執行一個或多個指令)

Executes one or more commands in specified conditions.

IF [NOT] EXIST file THEN
    command [arguments]
[ELSE
    command [arguments]]
ENDIF


IF [NOT] string1 == string2 THEN
    command [arguments]
    [command [arguments]]
    ...
[ELSE
    command [arguments]
    [command [arguments]]
    ...]
ENDIF


    EXIST file            - TRUE if file exists in the directory
    string1 == string2    - TRUE if the two stings are same

Note:
    1. The IF command is only available in batch script files.
    2. If condition is TRUE, commands between IF and ELSE will be
       executed.
    3. If condition is FALSE but keyword 'NOT' is not prefixed, commands
       between ELSE and ENDIF will also be executed.

Examples:
    #
    #  Example script for "if" command
    #
    if exist fs0:\myscript.sc then
    myscript myarg1 myarg2
    endif
    if %myvar% == runboth then
    myscript1
    myscript2
    endif

EFI Shell commands -- IfConfig(修改預設UEFI網路堆疊的IP位址)

IfConfig (c) Intel Corporation 2006
  modify the default IP address of UEFI network stack

To list the current address:
  IfConfig -l [Name]
    --Show the configuration for all or the interface

To set the default address use:
  IfConfig -s dhcp [perment]
    --Use the EFI_DHCP4_PROTOCOL to request address dynamically

  IfConfig -s [perment]
    --Use the static IP4 address configuration

  perment is optional. If present, the configuration survives
  the network stack reload. Otherwise, it is for this time only

To clear the current address:
  IfConfig -c [Name]
    --Clear the configuration for all or the interface
      although the configure is cleared, the network stack
      will fall back to the DHCP as default

Other:
  IfConfig -?
    --Show this help message

Example:
IfConfig -s eth0 dhcp
IfConfig -l eth0
IfConfig -s eth0 static 192.168.0.5 255.255.255.0 192.168.0.1 perment

EFI Shell commands -- IPCONFIG(顯示或修改目前IP配置)

Displays or modifies the current IP configuration.

IPCONFIG [-r]|[-b] [-c Instance] [IpAddress [-m NetMask]]


    -r          - Restart the PXE base code and DHCP settings
    -b          - Display one screen at a time
    Instance    - Zero-based Simple Network Protocol instance
    IpAddress   - IP address in a.b.c.d format
    NetMask     - Network mask in 255.255.255.0 format

Examples:
  * To restart the PXE base code and refresh the DHCP settings:
    shell:\> IpConfig -r

  * To display the current IP configuration:
    Shell:\> IpConfig

  * To modify the IP address without changing the network mask:
    shell:\> IpConfig 192.168.10.30

  * To modify the IP address and network mask:
    shell:\> IpConfig 192.168.10.30 -m 255.255.255.0

EFI Shell commands -- LoadPciRom(載入一個PCI Option ROM從指定檔案)

Loads a PCI Option ROM from the specified file.

LoadPciRom [-nc] romfile [romfile...]


    -nc      - Load the ROM image but do not connect the driver
    romfile  - PCI option ROM image file (wildcards are permitted)

EFI Shell commands -- LS(在一個目錄中,顯示一個檔案列表與子目錄)

Displays a list of files and subdirectories in a directory.

LS [-b] [-r] [-a[attrib]] [file]


    -b       - Display one screen at a time
    -r       - Display recursively (including subdirectories)
    -a       - Display files with attributes of type attrib
    attrib   - File attribute list:
                 a   - Archive
                 s   - System
                 h   - Hidden
                 r   - Read-only
                 d   - Directory
    file     - Name of file or directory (wildcards are permitted)

Note:
    1. Files and directories with the system and hidden attributes are not
       displayed unless the 's' and 'h' attributes are specified.

Examples:

  * To hide files by adding the hidden and system attributes:
    fs0:\〉 attrib +h +s *.efi
     ASH  fs0:\IsaBus.efi
     ASH  fs0:\IsaSerial.efi

  * To display all files in the current directory:
    fs0:\〉 ls
    Directory of: fs0:\

      06/18/01  09:32p                  153  for.nsh
      06/18/01  01:02p 〈DIR〉          512  efi
      06/18/01  01:02p 〈DIR〉          512  test1
      06/18/01  01:02p 〈DIR〉          512  test2
      06/18/01  08:04p                   29  temp.txt
      06/18/01  08:05p 〈DIR〉          512  test
      01/28/01  08:24p       r           29  readme.txt
              3 File(s)         211 bytes
              4 Dir(s)

  * To display all files in the current directory:
    fs0:\〉 ls -a
    Directory of: fs0:\

      06/18/01  09:32p                  153  for.nsh
      06/18/01  01:02p 〈DIR〉          512  efi
      06/18/01  01:02p 〈DIR〉          512  test1
      06/18/01  01:02p 〈DIR〉          512  test2
      06/18/01  10:59p               28,739  IsaBus.efi
      06/18/01  10:59p               32,838  IsaSerial.efi
      06/18/01  08:04p                   29  temp.txt
      06/18/01  08:05p 
           512  test
      01/28/01  08:24p       r           29  readme.txt
              5 File(s)      61,788 bytes
              4 Dir(s)

  * To display all read-only files in the current directory:
    fs0:\〉 ls -ar
    Directory of: fs0:\

      06/18/01  11:14p       r           29  readme.txt
              1 File(s)          29 bytes
              0 Dir(s)

  * To display the file 'isabus.efi' with the system attribute:
    fs0:\〉 ls -as isabus.efi
    Directory of: fs0:\

      06/18/01  10:59p               28,739  IsaBus.efi
              1 File(s)      28,739 bytes
              0 Dir(s)

  * To display all files in the fs0:\efi directory recursively:
    fs0:\〉 ls -r -a efi

  * To display all files with the '*.efi' extension recursively one screen at
    a time:
    fs0:\〉 ls -b -r -a *.efi


EFI Shell commands -- MEMMAP(顯示記憶體映射維持由EFI環境)

Displays the memory map maintained by the EFI environment.

MEMMAP [-b]


    -b       - Display one screen at a time

Note:
    1. The EFI environment keeps track all the physical memory in the system
       and how it is currently being used.
    2. Total memory is the physical memory size not including the MemMapIO
       and MemPortIO size.
    3. Refer to the EFI specification for memory type definitions.

Examples:
  * To display the system memory map:
    fs0:\> memmap

Type     Start      End         # Pages      Attributes
available  0000000000750000-0000000001841FFF  00000000000010F2 0000000000000009
LoaderCode 0000000001842000-00000000018A3FFF  0000000000000062 0000000000000009
available  00000000018A4000-00000000018C1FFF  000000000000001E 0000000000000009
LoaderData 00000000018C2000-00000000018CAFFF  0000000000000009 0000000000000009
BS_code    00000000018CB000-0000000001905FFF  000000000000003B 0000000000000009
BS_data    0000000001906000-00000000019C9FFF  00000000000000C4 0000000000000009
...
RT_data    0000000001B2B000-0000000001B2BFFF  0000000000000001 8000000000000009
BS_data    0000000001B2C000-0000000001B4FFFF  0000000000000024 0000000000000009
reserved   0000000001B50000-0000000001D4FFFF  0000000000000200 0000000000000009

  reserved  :     512 Pages (2,097,152)
  LoaderCode:      98 Pages (401,408)
  LoaderData:      32 Pages (131,072)
  BS_code   :     335 Pages (1,372,160)
  BS_data   :     267 Pages (1,093,632)
  RT_data   :      19 Pages (77,824)
  available :   4,369 Pages (17,895,424)
Total Memory: 20 MB (20,971,520) Bytes

EFI Shell commands -- MKDIR(建立一個或多個目錄)

Creates one or more directories.

MKDIR dir [dir...]


    dir      - Name of a directory to be created(wildcards are not allowed)

Note:
    1. The parent directory must already exist.
    2. If the directory already exists, mkdir will abort.
    3. Specifying additional directory parameters dependent on previous
       directory parameters is not allowed:
       For example, mkdir new new\test is not allowed.
    4. Redirecting output to a file that exists under the directory specified
       on the command line is not allowed.

Examples:

  * To create a new directory:
    fs0:\〉 mkdir rafter

    fs0:\〉 ls
    Directory of: fs0:\

      06/18/01  08:05p 〈DIR〉          512  test
      06/18/01  11:14p       r           29  readme.txt
      06/18/01  11:50p 〈DIR〉          512  rafter
              1 File(s)         211 bytes
              2 Dir(s)

  * To create multiple directories:
    fs0:\〉 mkdir temp1 temp2
    fs0:\〉 ls
    Directory of: fs0:\

      06/18/01  08:05p 〈DIR〉          512  test
      06/18/01  11:14p       r           29  readme.txt
      06/18/01  11:50p 〈DIR〉          512  rafter
      06/18/01  11:52p 〈DIR〉          512  temp1
      06/18/01  11:52p 〈DIR〉          512  temp2
              1 File(s)         211 bytes
              4 Dir(s)


EFI Shell commands -- MM(顯示或修改MEM/MMIO/IO/PCI/PCIE位址空間)

Displays or modifies MEM/MMIO/IO/PCI/PCIE address space.

MM Address [Value] [-w 1|2|4|8] [-MEM | -MMIO | -IO | -PCI | -PCIE] [-n]


    Address  - Starting address
    Value    - The value to write
    -MEM     - Memory Address type
    -MMIO    - Memory Mapped IO Address type
    -IO      - IO Address type
    -PCI     - PCI Configuration Space Address type:
               Address format: 0x000000ssbbddffrr
                 ss   - Segment
                 bb   - Bus
                 dd   - Device
                 ff   - Function
                 rr   - Register
    -PCIE    - PCIE Configuration Space Address type:
               Address format: 0x00000ssbbddffrrr
                 ss   - Segment
                 bb   - Bus
                 dd   - Device
                 ff   - Function
                 rrr  - Register
    -w       - Unit size accessed in bytes:
                 1    - 1 byte
                 2    - 2 bytes
                 4    - 4 bytes
                 8    - 8 bytes
    -n       - Non-interactive mode

Note:
    1.  If the address type parameter is not specified, address type defaults
        to the 'MEM' type.
    2.  If the 'Value' parameter is specified, the '-n' option will be used
        automatically. In this case, this command will write the value to the
        specified address in non-interactive mode. If the 'Value' parameter is
        not specified, only the current contents in the address are displayed.
    3.  If the '-w' option is not specified, unit size defaults to 1 byte.
    4.  If the PCI address type is specified, the 'Address' parameter should
        follow the PCI Configuration Space Address format above. The 'PCI'
        command can be used to determine the address for a specified device.
        It is listed in the PCI configuration space dump information, in the
        following format: "[EFI 0x000000ssbbddffxx]".
    5.  If the PCIE address type is specified, the 'Address' parameter should
        follow the PCIE Configuration Space Address format above.
    6.  In interactive mode, type a hex value to modify, 'q' or '.' to exit.
        If the '-n' option is specified, it will run in non-interactive mode
        which supports batch file operation without user intervention.
    7.  Not all PCI configuration register locations are writable.
    8.  MM will only write the specified value. Read-modify-write operations
        are not supported.
    9.  The 'Address' parameter should be aligned on a boundary of the
        specified width.
    10. Not all addresses are safe to access. Access to any improper address
        can bring unexpected results.

Examples:
  * To display or modify memory:
    Address 0x1b07288, default width=1 byte:
    fs0:\> mm 1b07288
    MEM  0x0000000001B07288 : 0x6D >
    MEM  0x0000000001B07289 : 0x6D >
    MEM  0x0000000001B0728A : 0x61 > 80
    MEM  0x0000000001B0728B : 0x70 > q

    fs0:\> mm 1b07288
    MEM  0x0000000001B07288 : 0x6D >
    MEM  0x0000000001B07289 : 0x6D >
    MEM  0x0000000001B0728A : 0x80 >        *Modified
    MEM  0x0000000001B0728B : 0x70 > q

  * To modify memory:
    Address 0x1b07288, width = 2 bytes:
    Shell> mm 1b07288 -w 2
    MEM  0x0000000001B07288 : 0x6D6D >
    MEM  0x0000000001B0728A : 0x7061 > 55aa
    MEM  0x0000000001B0728C : 0x358C > q

    Shell> mm 1b07288 -w 2
    MEM  0x0000000001B07288 : 0x6D6D >
    MEM  0x0000000001B0728A : 0x55AA >      *Modified
    MEM  0x0000000001B0728C : 0x358C > q

  * To display IO space:
    Address 80h, width = 4 bytes:
    Shell> mm 80 -w 4 -IO
    IO  0x0000000000000080 : 0x000000FE >
    IO  0x0000000000000084 : 0x00FF5E6D > q

  * To modify IO space using non-interactive mode:
    Shell> mm 80 52 -w 1 -IO
    Shell> mm 80 -w 1 -IO
    IO  0x0000000000000080 : 0x52 > FE    *Modified
    IO  0x0000000000000081 : 0xFF >
    IO  0x0000000000000082 : 0x00 >
    IO  0x0000000000000083 : 0x00 >
    IO  0x0000000000000084 : 0x6D >
    IO  0x0000000000000085 : 0x5E >
    IO  0x0000000000000086 : 0xFF >
    IO  0x0000000000000087 : 0x00 > q

  * To display PCI configuration space, ss=00, bb=00, dd=00, ff=00, rr=00:
    Shell> mm 0000000000 -PCI
    PCI  0x0000000000000000 : 0x86 >
    PCI  0x0000000000000001 : 0x80 >
    PCI  0x0000000000000002 : 0x30 >
    PCI  0x0000000000000003 : 0x11 >
    PCI  0x0000000000000004 : 0x06 >
    PCI  0x0000000000000005 : 0x00 > q
  * These contents can also be displayed by 'PCI 00 00 00'.

  * To display PCIE configuration space, ss=00, bb=06, dd=00, ff=00, rrr=000:
    Shell> mm 00060000000 -PCIE
    PCIE  0x0000000060000000 : 0xAB >
    PCIE  0x0000000060000001 : 0x11 >
    PCIE  0x0000000060000002 : 0x61 >
    PCIE  0x0000000060000003 : 0x43 >
    PCIE  0x0000000060000004 : 0x00 > q

EFI Shell commands -- MV(移動一個或多個檔案與目錄到另一個位置)

Moves one or more files or directories to another location.

MV src [src...] [dst]


    src     - Source file/directory name (wildcards are permitted)
    dst     - Destination file/directory name (wildcards not permitted)

Note:
    1. If the 'dst' parameter is not specified, the current directory is
       assumed to be the destination.
    2. If there is more than one argument in the command line, the last one
       will be taken as 'dst' unconditionally. If there is more than one
       source file or directory to move, the 'dst' should be an existing
       directory.
    3. Attempting to move a read-only file or directory is not allowed.
    4. Moving a directory that contains read-only file(s) is allowed.
    5. You cannot move a directory into itself or its subdirectories.
    6. You cannot move a directory if the current directory is itself or its
       subdirectory.
    7. Redirecting output to a file under a directory to be moved is not
       allowed.
    8. If an error occurs, the remaining files or directories will still be
       moved.

Examples:
  * To rename a file:
    fs0:\> mv IsaBus.efi Bus.efi
    moving fs0:\IsaBus.efi -> \Bus.efi
     - [ok]

  * To move a directory to the current directory:
    fs0:\> mkdir test1\temp
    fs0:\> mv test1\temp
    moving fs0:\test1\temp -> \.\temp
     - [ok]

  * To rename a directory:
    fs0:\> mv efi efi1.1
    moving fs0:\efi -> \efi1.1
     - [ok]

  * To move multiple directories at a time:
    fs0:\> mv test1 test2 test
    moving fs0:\test1 -> \test\test1
     - [ok]
    moving fs0:\test2 -> \test\test2
     - [ok]

  * Moving a read-only directory will result a failure:
    fs0:\test> attrib +r temp1
    DA  R fs0:\test\temp1
    fs0:\test> mv temp1 temp2
    moving fs0:\test\temp1 -> \test\temp2
     - [error] - Write Protected

EFI Shell commands -- PAUSE (印出一個訊息與等待鍵盤輸入)

Prints a message and waits for keyboard input.

PAUSE [-q]


    -q       - Do not display notification message

Note:
    1. The PAUSE command is only available in batch script files.
    2. The prompt message is "Enter 'q' to quit, any other key to continue".

Examples:

  * To pause the system after displaying the date and time:
    fs0:\> type pause.nsh
    File: fs0:\pause.nsh, Size 204
    #
    #  Example script for 'pause' command
    #
    echo pause.nsh begin..
    date
    time
    pause
    echo pause.nsh done.

  * To execute the script with echo on:
    fs0:\> pause.nsh
    +pause.nsh> echo pause.nsh begin..
    pause.nsh begin..
    +pause.nsh> date
    06/19/2001
    +pause.nsh> time
    00:51:45
    +pause.nsh> pause
    Enter 'q' to quit, any other key to continue:
    +pause.nsh> echo pause.nsh done.
    pause.nsh done.

  * To execute the script with echo off:
    fs0:\> echo -off
    fs0:\> pause.nsh
    pause.nsh begin..
    06/19/2001
    00:52:50
    Enter 'q' to quit, any other key to continue: q
    fs0:\>

EFI Shell commands -- Ping(詢問目的IP位址狀態)

Ping [-n count] [-l size] TargetIp
  -n count    Number of echo requests to send.
  -l size     Send buffer size.

EFI Shell commands -- RM(刪除一個或多個檔案或目錄)

Deletes one or more files or directories.

RM [-q] file/directory [file/directory ...]

    -q           - Quiet mode will not prompt for user confirmation
    file         - File name (wildcards are permitted)
    directory    - Directory name (wildcards are permitted)

Note:
    1. The root directory cannot be removed.
    2. The current directory and upstream directories cannot be removed.
    3. Read-only files and directories cannot be removed.
    4. Directories containing read-only file(s) cannot be removed.
    5. If an error occurs, RM will exit immediately.
    6. RM will not prompt for user confirmation if the specified filename
       contains wildcards.
    7. Redirecting output to a file under a directory to be removed is not
       allowed.

Examples:

  * To remove multiple directories:
    fs0:\〉 ls test
    Directory of: fs0:\test

      06/18/01  01:01p 〈DIR〉           512  .
      06/18/01  01:01p 〈DIR〉             0  ..
      06/19/01  12:59a 〈DIR〉           512  temp1
      06/19/01  12:59a 〈DIR〉           512  temp2
              0 File(s)           0 bytes
              4 Dir(s)

  * Error occurs and RM will exit:
    fs0:\〉 rm test\temp11 temp2
    rm/del: Cannot find 'fs0:\test\temp11' - Not Found

  * To remove multiple directories with wildcards:
    fs0:\〉 rm test\temp*
    rm/del: Remove subtree 'fs0:\test\temp1' [y/n]? y
    removing fs0:\test\temp1\temp1.txt
     - [ok]
    removing fs0:\test\temp1\boot\nshell.efi
     - [ok]
    removing fs0:\test\temp1\boot
     - [ok]
    removing fs0:\test\temp1
     - [ok]
    rm/del: Remove subtree 'fs0:\test\temp2' [y/n]? y
    removing fs0:\test\temp2\temp2.txt
     - [ok]
    removing fs0:\test\temp2
     - [ok]

  * To remove a directory that contains a read-only file will fail:
    fs0:\〉 attrib +r test\temp1\readme.txt
     A  R fs0:\test\temp1\readme.txt

    fs0:\〉 rm test\temp1
    rm/del: Cannot open readme.txt under fs0:\test\temp1 in write mode
    - [error] - Access Denied
    Exit status code: Access Denied