X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;ds=sidebyside;f=EmbeddedPkg%2FEbl%2FCommand.c;h=7c00bcae85748505b4d02fe8fed0a40858cf2088;hb=3402aac7d985bf8a9f9d3c639f3fe93609380513;hp=7899a0f442c53816a956bb408b58d7e41a9fb7bb;hpb=2ef2b01e07c02db339f34004445734a2dbdd80e1;p=mirror_edk2.git diff --git a/EmbeddedPkg/Ebl/Command.c b/EmbeddedPkg/Ebl/Command.c index 7899a0f442..7c00bcae85 100644 --- a/EmbeddedPkg/Ebl/Command.c +++ b/EmbeddedPkg/Ebl/Command.c @@ -1,10 +1,10 @@ /** @file Basic commands and command processing infrastructure for EBL - Copyright (c) 2007, Intel Corporation
- Portions copyright (c) 2008-2009, Apple Inc. All rights reserved. + Copyright (c) 2007, Intel Corporation. All rights reserved.
+ Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- All rights reserved. This program and the accompanying materials + This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -32,7 +32,7 @@ EBL_COMMAND_TABLE *mCmdTable[EBL_MAX_COMMAND_COUNT]; @param chr one Ascii character - @return The uppercase value of Ascii character + @return The uppercase value of Ascii character **/ STATIC @@ -46,7 +46,7 @@ AsciiToUpper ( /** - Case insensitve comparison of two Null-terminated Unicode strings with maximum + Case insensitive comparison of two Null-terminated Unicode strings with maximum lengths, and returns the difference between the first mismatched Unicode characters. This function compares the Null-terminated Unicode string FirstString to the @@ -55,11 +55,11 @@ AsciiToUpper ( FirstString is identical to SecondString, then 0 is returned. Otherwise, the value returned is the first mismatched Unicode character in SecondString subtracted from the first mismatched Unicode character in FirstString. - - @param FirstString Pointer to a Null-terminated ASCII string. + + @param FirstString Pointer to a Null-terminated ASCII string. @param SecondString Pointer to a Null-terminated ASCII string. @param Length Max length to compare. - + @retval 0 FirstString is identical to SecondString using case insensitive comparisons. @retval !=0 FirstString is not identical to SecondString using case @@ -85,18 +85,18 @@ AsciiStrniCmp ( SecondString++; Length--; } - + return AsciiToUpper (*FirstString) - AsciiToUpper (*SecondString); } /** - Add a command to the mCmdTable. If there is no free space in the command - table ASSERT. The mCmdTable is maintained in alphabetical order and the - new entry is inserted into its sorted possition. + Add a command to the mCmdTable. If there is no free space in the command + table ASSERT. The mCmdTable is maintained in alphabetical order and the + new entry is inserted into its sorted position. - @param Entry Commnad Entry to add to the CmdTable + @param Entry Command Entry to add to the CmdTable **/ VOID @@ -124,7 +124,7 @@ EblAddCommand ( if (AsciiStriCmp (mCmdTable[Count - 1]->Name, Entry->Name) <= 0) { break; } - + mCmdTable[Count] = mCmdTable[Count - 1]; } mCmdTable[Count] = (EBL_COMMAND_TABLE *)Entry; @@ -135,11 +135,11 @@ EblAddCommand ( /** - Add an set of commands to the command table. Most commonly used on static + Add an set of commands to the command table. Most commonly used on static array of commands. @param EntryArray Pointer to array of command entries - @param ArrayCount Number of commnad entries to add + @param ArrayCount Number of command entries to add **/ VOID @@ -167,9 +167,9 @@ EBL_ADD_COMMAND_PROTOCOL gEblAddCommand = { /** - Return the best matching command for the passed in command name. The match - does not have to be exact, it just needs to be unqiue. This enables commands - to be shortend to the smallest set of starting characters that is unique. + Return the best matching command for the passed in command name. The match + does not have to be exact, it just needs to be unique. This enables commands + to be shortened to the smallest set of starting characters that is unique. @param CommandName Name of command to search for @@ -186,8 +186,16 @@ EblGetCommand ( UINTN BestMatchCount; UINTN Length; EBL_COMMAND_TABLE *Match; + CHAR8 *Str; Length = AsciiStrLen (CommandName); + Str = AsciiStrStr (CommandName, "."); + if (Str != NULL) { + // If the command includes a trailing . command extension skip it for the match. + // Example: hexdump.4 + Length = (UINTN)(Str - CommandName); + } + for (Index = 0, BestMatchCount = 0, Match = NULL; Index < mCmdTableNextFreeIndex; Index++) { if (AsciiStriCmp (mCmdTable[Index]->Name, CommandName) == 0) { // match a command exactly @@ -212,17 +220,37 @@ EblGetCommand ( } +UINTN +CountNewLines ( + IN CHAR8 *Str + ) +{ + UINTN Count; + + if (Str == NULL) { + return 0; + } + + for (Count = 0; *Str != '\0'; Str++) { + if (Str[Count] == '\n') { + Count++; + } + } + + return Count; +} + /** - List out help information on all the commands or print extended information + List out help information on all the commands or print extended information about a specific passed in command. Argv[0] - "help" Argv[1] - Command to display help about @param Argc Number of command arguments in Argv - @param Argv Array of strings that represent the parsed command line. - Argv[0] is the comamnd name + @param Argv Array of strings that represent the parsed command line. + Argv[0] is the command name @return EFI_SUCCESS @@ -235,23 +263,31 @@ EblHelpCmd ( { UINTN Index; CHAR8 *Ptr; - UINTN CurrentRow; + UINTN CurrentRow = 0; if (Argc == 1) { // Print all the commands AsciiPrint ("Embedded Boot Loader (EBL) commands (help command for more info):\n"); + CurrentRow++; for (Index = 0; Index < mCmdTableNextFreeIndex; Index++) { EblSetTextColor (EFI_YELLOW); AsciiPrint (" %a", mCmdTable[Index]->Name); EblSetTextColor (0); AsciiPrint ("%a\n", mCmdTable[Index]->HelpSummary); + // Handle multi line help summaries + CurrentRow += CountNewLines (mCmdTable[Index]->HelpSummary); + if (EblAnyKeyToContinueQtoQuit (&CurrentRow, FALSE)) { + break; + } } } else if (Argv[1] != NULL) { - // Print specific help + // Print specific help for (Index = 0, CurrentRow = 0; Index < mCmdTableNextFreeIndex; Index++) { if (AsciiStriCmp (Argv[1], mCmdTable[Index]->Name) == 0) { Ptr = (mCmdTable[Index]->Help == NULL) ? mCmdTable[Index]->HelpSummary : mCmdTable[Index]->Help; AsciiPrint ("%a%a\n", Argv[1], Ptr); + // Handle multi line help summaries + CurrentRow += CountNewLines (Ptr); if (EblAnyKeyToContinueQtoQuit (&CurrentRow, FALSE)) { break; } @@ -264,14 +300,14 @@ EblHelpCmd ( /** - Exit the EBL. If the commnad processor sees EFI_ABORTED return status it will + Exit the EBL. If the command processor sees EFI_ABORTED return status it will exit the EBL. Argv[0] - "exit" @param Argc Number of command arguments in Argv - @param Argv Array of strings that represent the parsed command line. - Argv[0] is the comamnd name + @param Argv Array of strings that represent the parsed command line. + Argv[0] is the command name @return EFI_ABORTED @@ -282,66 +318,66 @@ EblExitCmd ( IN CHAR8 **Argv ) { - EFI_STATUS Status; - UINTN MemoryMapSize; - EFI_MEMORY_DESCRIPTOR *MemoryMap; - UINTN MapKey; - UINTN DescriptorSize; - UINTN DescriptorVersion; - UINTN Pages; - - if (Argc > 1) { + EFI_STATUS Status; + UINTN MemoryMapSize; + EFI_MEMORY_DESCRIPTOR *MemoryMap; + UINTN MapKey; + UINTN DescriptorSize; + UINT32 DescriptorVersion; + UINTN Pages; + + if (Argc > 1) { if (AsciiStriCmp (Argv[1], "efi") != 0) { return EFI_ABORTED; } } else if (Argc == 1) { return EFI_ABORTED; } - - MemoryMap = NULL; - MemoryMapSize = 0; - do { - Status = gBS->GetMemoryMap ( - &MemoryMapSize, - MemoryMap, - &MapKey, - &DescriptorSize, - &DescriptorVersion - ); - if (Status == EFI_BUFFER_TOO_SMALL) { - - Pages = EFI_SIZE_TO_PAGES (MemoryMapSize) + 1; - MemoryMap = AllocatePages (Pages); - - // - // Get System MemoryMap - // - Status = gBS->GetMemoryMap ( - &MemoryMapSize, - MemoryMap, - &MapKey, - &DescriptorSize, - &DescriptorVersion - ); - // Don't do anything between the GetMemoryMap() and ExitBootServices() - if (!EFI_ERROR (Status)) { - Status = gBS->ExitBootServices (gImageHandle, MapKey); - if (EFI_ERROR (Status)) { - FreePages (MemoryMap, Pages); - MemoryMap = NULL; - MemoryMapSize = 0; - } - } - } - } while (EFI_ERROR (Status)); + + MemoryMap = NULL; + MemoryMapSize = 0; + do { + Status = gBS->GetMemoryMap ( + &MemoryMapSize, + MemoryMap, + &MapKey, + &DescriptorSize, + &DescriptorVersion + ); + if (Status == EFI_BUFFER_TOO_SMALL) { + + Pages = EFI_SIZE_TO_PAGES (MemoryMapSize) + 1; + MemoryMap = AllocatePages (Pages); + + // + // Get System MemoryMap + // + Status = gBS->GetMemoryMap ( + &MemoryMapSize, + MemoryMap, + &MapKey, + &DescriptorSize, + &DescriptorVersion + ); + // Don't do anything between the GetMemoryMap() and ExitBootServices() + if (!EFI_ERROR (Status)) { + Status = gBS->ExitBootServices (gImageHandle, MapKey); + if (EFI_ERROR (Status)) { + FreePages (MemoryMap, Pages); + MemoryMap = NULL; + MemoryMapSize = 0; + } + } + } + } while (EFI_ERROR (Status)); // // At this point it is very dangerous to do things EFI as most of EFI is now gone. // This command is useful if you are working with a debugger as it will shutdown // DMA and other things that could break a soft resets. - // + // CpuDeadLoop (); - + // Should never get here, but makes the compiler happy return EFI_ABORTED; } @@ -349,10 +385,10 @@ EblExitCmd ( /** Update the screen by decrementing the timeout value. - This AsciiPrint has to match the AsciiPrint in - EblPauseCmd. + This AsciiPrint has to match the AsciiPrint in + EblPauseCmd. - @param ElaspedTime Current timout value remaining + @param ElaspedTime Current timeout value remaining **/ VOID @@ -374,11 +410,11 @@ EblPauseCallback ( Argv[1] - timeout value is decimal seconds @param Argc Number of command arguments in Argv - @param Argv Array of strings that represent the parsed command line. - Argv[0] is the comamnd name + @param Argv Array of strings that represent the parsed command line. + Argv[0] is the command name @return EFI_SUCCESS Timeout expired with no input - @return EFI_TIMEOUT Stop procesing other commands on the same command line + @return EFI_TIMEOUT Stop processing other commands on the same command line **/ EFI_STATUS @@ -397,8 +433,8 @@ EblPauseCmd ( Status = EblGetCharKey (&Key, Delay, EblPauseCallback); AsciiPrint ("\n"); - // If we timeout then the pause succeded thus return success - // If we get a key return timout to stop other commnad on this cmd line + // If we timeout then the pause succeeded thus return success + // If we get a key return timeout to stop other command on this cmd line return (Status == EFI_SUCCESS) ? EFI_TIMEOUT : EFI_SUCCESS;; } @@ -409,8 +445,8 @@ EblPauseCmd ( Argv[0] - "break" @param Argc Number of command arguments in Argv - @param Argv Array of strings that represent the parsed command line. - Argv[0] is the comamnd name + @param Argv Array of strings that represent the parsed command line. + Argv[0] is the command name @return EFI_SUCCESS @@ -435,8 +471,8 @@ EblBreakPointCmd ( Argv[1] - warm or shutdown reset type @param Argc Number of command arguments in Argv - @param Argv Array of strings that represent the parsed command line. - Argv[0] is the comamnd name + @param Argv Array of strings that represent the parsed command line. + Argv[0] is the command name @return EFI_SUCCESS @@ -460,7 +496,7 @@ EblResetCmd ( case 's': ResetType = EfiResetShutdown; } - } + } gRT->ResetSystem (ResetType, EFI_SUCCESS, 0, NULL); return EFI_SUCCESS; @@ -475,8 +511,8 @@ EblResetCmd ( Argv[1] - on or off @param Argc Number of command arguments in Argv - @param Argv Array of strings that represent the parsed command line. - Argv[0] is the comamnd name + @param Argv Array of strings that represent the parsed command line. + Argv[0] is the command name @return EFI_SUCCESS @@ -488,7 +524,7 @@ EblPageCmd ( ) { if (Argc <= 1) { - // toggle setting + // toggle setting gPageBreak = (gPageBreak) ? FALSE : TRUE; } else { // use argv to set the value @@ -525,12 +561,9 @@ ConvertToTextLine ( IN CHAR8 Character ) { - if (Character < ' ' || Character > '~') - { + if (Character < ' ' || Character > '~') { return '.'; - } - else - { + } else { return Character; } } @@ -543,15 +576,15 @@ GetBytes ( { UINTN Result = 0; - if (Bytes >= 1) + if (Bytes >= 1) { Result = *Address++; - - if (Bytes >= 2) + } + if (Bytes >= 2) { Result = (Result << 8) + *Address++; - - if (Bytes >= 3) + } + if (Bytes >= 3) { Result = (Result << 8) + *Address++; - + } return Result; } @@ -574,26 +607,20 @@ OutputData ( CHAR8 Blanks[80]; AsciiStrCpy (Blanks, mBlanks); - for (EndAddress = Address + Length; Address < EndAddress; Offset += Line) - { + for (EndAddress = Address + Length; Address < EndAddress; Offset += Line) { AsciiPrint ("%08x: ", Offset); - for (Line = 0; (Line < 0x10) && (Address < EndAddress);) - { + for (Line = 0; (Line < 0x10) && (Address < EndAddress);) { Bytes = EndAddress - Address; - - switch (Width) - { + + switch (Width) { case 4: - if (Bytes >= 4) - { + if (Bytes >= 4) { AsciiPrint ("%08x ", *((UINT32 *)Address)); TextLine[Line++] = ConvertToTextLine(*Address++); TextLine[Line++] = ConvertToTextLine(*Address++); TextLine[Line++] = ConvertToTextLine(*Address++); TextLine[Line++] = ConvertToTextLine(*Address++); - } - else - { + } else { AsciiPrint ("%08x ", GetBytes(Address, Bytes)); Address += Bytes; Line += Bytes; @@ -601,14 +628,11 @@ OutputData ( break; case 2: - if (Bytes >= 2) - { + if (Bytes >= 2) { AsciiPrint ("%04x ", *((UINT16 *)Address)); TextLine[Line++] = ConvertToTextLine(*Address++); TextLine[Line++] = ConvertToTextLine(*Address++); - } - else - { + } else { AsciiPrint ("%04x ", GetBytes(Address, Bytes)); Address += Bytes; Line += Bytes; @@ -627,10 +651,8 @@ OutputData ( } // Pad spaces - if (Line < 0x10) - { - switch (Width) - { + if (Line < 0x10) { + switch (Width) { case 4: Spaces = 9 * ((0x10 - Line)/4); break; @@ -645,29 +667,79 @@ OutputData ( Blanks[Spaces] = '\0'; AsciiPrint(Blanks); - + Blanks[Spaces] = ' '; } TextLine[Line] = 0; AsciiPrint ("|%a|\n", TextLine); - if (EblAnyKeyToContinueQtoQuit(&CurrentRow, FALSE)) - { + if (EblAnyKeyToContinueQtoQuit (&CurrentRow, FALSE)) { return EFI_END_OF_FILE; } } - if (Length % Width != 0) - { + if (Length % Width != 0) { AsciiPrint ("%08x\n", Offset); } - + return EFI_SUCCESS; } + +/** + See if command contains .# where # is a number. Return # as the Width + or 1 as the default Width for commands. + + Example hexdump.4 returns a width of 4. + + @param Argv Argv[0] is the command name + + @return Width of command + +**/ +UINTN +WidthFromCommandName ( + IN CHAR8 *Argv, + IN UINTN Default + ) +{ + CHAR8 *Str; + UINTN Width; + + //Hexdump.2 HexDump.4 mean use a different width + Str = AsciiStrStr (Argv, "."); + if (Str != NULL) { + Width = AsciiStrDecimalToUintn (Str + 1); + if (Width == 0) { + Width = Default; + } + } else { + // Default answer + return Default; + } + + return Width; +} + #define HEXDUMP_CHUNK 1024 +/** + Toggle page break global. This turns on and off prompting to Quit or hit any + key to continue when a command is about to scroll the screen with its output + + Argv[0] - "hexdump"[.#] # is optional 1,2, or 4 for width + Argv[1] - Device or File to dump. + Argv[2] - Optional offset to start dumping + Argv[3] - Optional number of bytes to dump + + @param Argc Number of command arguments in Argv + @param Argv Array of strings that represent the parsed command line. + Argv[0] is the command name + + @return EFI_SUCCESS + +**/ EFI_STATUS EblHexdumpCmd ( IN UINTN Argc, @@ -677,70 +749,70 @@ EblHexdumpCmd ( EFI_OPEN_FILE *File; VOID *Location; UINTN Size; - UINTN Width = 1; + UINTN Width; UINTN Offset = 0; EFI_STATUS Status; UINTN Chunk = HEXDUMP_CHUNK; - if ((Argc < 2) || (Argc > 3)) - { + if ((Argc < 2) || (Argc > 4)) { return EFI_INVALID_PARAMETER; } - - if (Argc == 3) - { - Width = AsciiStrDecimalToUintn(Argv[2]); - } - - if ((Width != 1) && (Width != 2) && (Width != 4)) - { + + Width = WidthFromCommandName (Argv[0], 1); + if ((Width != 1) && (Width != 2) && (Width != 4)) { return EFI_INVALID_PARAMETER; } - File = EfiOpen(Argv[1], EFI_FILE_MODE_READ, 0); - if (File == NULL) - { + File = EfiOpen (Argv[1], EFI_FILE_MODE_READ, 0); + if (File == NULL) { return EFI_NOT_FOUND; } - Location = AllocatePool(Chunk); - Size = EfiTell(File, NULL); + Location = AllocatePool (Chunk); + Size = (Argc > 3) ? AsciiStrHexToUintn (Argv[3]) : EfiTell (File, NULL); - for (Offset = 0; Offset + HEXDUMP_CHUNK <= Size; Offset += Chunk) - { + Offset = 0; + if (Argc > 2) { + Offset = AsciiStrHexToUintn (Argv[2]); + if (Offset > 0) { + // Make sure size includes the part of the file we have skipped + Size += Offset; + } + } + + Status = EfiSeek (File, Offset, EfiSeekStart); + if (EFI_ERROR (Status)) { + goto Exit; + } + + for (; Offset + HEXDUMP_CHUNK <= Size; Offset += Chunk) { Chunk = HEXDUMP_CHUNK; - - Status = EfiRead(File, Location, &Chunk); - if (EFI_ERROR(Status)) - { + Status = EfiRead (File, Location, &Chunk); + if (EFI_ERROR(Status)) { AsciiPrint ("Error reading file content\n"); goto Exit; } - Status = OutputData(Location, Chunk, Width, File->BaseOffset + Offset); - if (EFI_ERROR(Status)) - { + Status = OutputData (Location, Chunk, Width, File->BaseOffset + Offset); + if (EFI_ERROR(Status)) { if (Status == EFI_END_OF_FILE) { Status = EFI_SUCCESS; } goto Exit; } } - + // Any left over? - if (Offset < Size) - { + if (Offset < Size) { Chunk = Size - Offset; - Status = EfiRead(File, Location, &Chunk); - if (EFI_ERROR(Status)) - { + Status = EfiRead (File, Location, &Chunk); + if (EFI_ERROR(Status)) { AsciiPrint ("Error reading file content\n"); goto Exit; } - Status = OutputData(Location, Chunk, Width, File->BaseOffset + Offset); - if (EFI_ERROR(Status)) - { + Status = OutputData (Location, Chunk, Width, File->BaseOffset + Offset); + if (EFI_ERROR(Status)) { if (Status == EFI_END_OF_FILE) { Status = EFI_SUCCESS; } @@ -749,141 +821,13 @@ EblHexdumpCmd ( } Exit: - EfiClose(File); + EfiClose (File); - FreePool(Location); + FreePool (Location); return EFI_SUCCESS; } -#define USE_DISKIO 1 - -EFI_STATUS -EblDiskIoCmd ( - IN UINTN Argc, - IN CHAR8 **Argv - ) -{ - EFI_STATUS Status; - UINTN Offset; - UINT8 *EndOffset; - UINTN Length; - UINTN Line; - UINT8 *Buffer; - UINT8 *BufferOffset; - CHAR8 TextLine[0x11]; -#if USE_DISKIO - EFI_DISK_IO_PROTOCOL *DiskIo; -#else - EFI_BLOCK_IO_PROTOCOL *BlockIo; - UINTN Lba; -#endif - - if (AsciiStrCmp(Argv[1], "r") == 0) - { - Offset = AsciiStrHexToUintn(Argv[2]); - Length = AsciiStrHexToUintn(Argv[3]); - -#if USE_DISKIO - Status = gBS->LocateProtocol(&gEfiDiskIoProtocolGuid, NULL, (VOID **)&DiskIo); - if (EFI_ERROR(Status)) - { - AsciiPrint("Did not locate DiskIO\n"); - return Status; - } - - Buffer = AllocatePool(Length); - BufferOffset = Buffer; - - Status = DiskIo->ReadDisk(DiskIo, SIGNATURE_32('f','l','s','h'), Offset, Length, Buffer); - if (EFI_ERROR(Status)) - { - AsciiPrint("DiskIO read failed\n"); - gBS->FreePool(Buffer); - return Status; - } -#else - Status = gBS->LocateProtocol(&gEfiBlockIoProtocolGuid, NULL, (VOID **)&BlockIo); - if (EFI_ERROR(Status)) - { - AsciiPrint("Did not locate BlockIo\n"); - return Status; - } - - Length = BlockIo->Media->BlockSize; - Buffer = AllocatePool(Length); - BufferOffset = Buffer; - Lba = Offset/BlockIo->Media->BlockSize; - - Status = BlockIo->ReadBlocks(BlockIo, BlockIo->Media->MediaId, Lba, Length, Buffer); - if (EFI_ERROR(Status)) - { - AsciiPrint("BlockIo read failed\n"); - gBS->FreePool(Buffer); - return Status; - } - - // Whack offset to what we actually read from - Offset = Lba * BlockIo->Media->BlockSize; - - Length = 0x100; -#endif - - for (EndOffset = BufferOffset + Length; BufferOffset < EndOffset; Offset += 0x10) - { - AsciiPrint ("%08x: ", Offset); - - for (Line = 0; Line < 0x10; Line++) - { - AsciiPrint ("%02x ", *BufferOffset); - - if (*BufferOffset < ' ' || *BufferOffset > '~') - TextLine[Line] = '.'; - else - TextLine[Line] = *BufferOffset; - - BufferOffset++; - } - - TextLine[Line] = '\0'; - AsciiPrint ("|%a|\n", TextLine); - } - - gBS->FreePool(Buffer); - - return EFI_SUCCESS; - } - else if (AsciiStrCmp(Argv[1], "w") == 0) - { - Offset = AsciiStrHexToUintn(Argv[2]); - Length = AsciiStrHexToUintn(Argv[3]); - Buffer = (UINT8 *)AsciiStrHexToUintn(Argv[4]); - -#if USE_DISKIO - Status = gBS->LocateProtocol(&gEfiDiskIoProtocolGuid, NULL, (VOID **)&DiskIo); - if (EFI_ERROR(Status)) - { - AsciiPrint("Did not locate DiskIO\n"); - return Status; - } - - Status = DiskIo->WriteDisk(DiskIo, SIGNATURE_32('f','l','s','h'), Offset, Length, Buffer); - if (EFI_ERROR(Status)) - { - AsciiPrint("DiskIO write failed\n"); - return Status; - } - -#else -#endif - - return EFI_SUCCESS; - } - else - { - return EFI_INVALID_PARAMETER; - } -} GLOBAL_REMOVE_IF_UNREFERENCED const EBL_COMMAND_TABLE mCmdTemplate[] = { @@ -931,16 +875,10 @@ GLOBAL_REMOVE_IF_UNREFERENCED const EBL_COMMAND_TABLE mCmdTemplate[] = }, { "hexdump", - " filename ; dump a file as hex bytes", + "[.{1|2|4}] filename [Offset] [Size]; dump a file as hex .width", NULL, EblHexdumpCmd - }, - { - "diskio", - " [r|w] offset [length [dataptr]]; do a DiskIO read or write ", - NULL, - EblDiskIoCmd - } + } }; @@ -956,7 +894,7 @@ EblInitializeCmdTable ( { EblAddCommands (mCmdTemplate, sizeof (mCmdTemplate)/sizeof (EBL_COMMAND_TABLE)); - + gBS->InstallProtocolInterface ( &gExternalCmdHandle, &gEfiEblAddCommandProtocolGuid,