summaryrefslogtreecommitdiffstats
path: root/ShellPkg
Commit message (Collapse)AuthorAgeFilesLines
* ShellPkg/UefiHandleParsingLib.c: Unify EOL and remove trailing spaceRuiyu Ni2016-06-171-183/+173
| | | | | | | | | The patch doesn't change any code logic. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg: Use ".." to indicate device path is partially displayedRuiyu Ni2016-06-171-1/+4
| | | | | | | | | | | | | | | The output of "dh <handle>" originally is like below: 12C: USBIO DevicePath(x0)/Pci(0x14,0x0)/USB(0x6,0x0)) The device path part is very confusing. Use ".." in front of the partially displayed device path is better and it also aligns to the example output in Shell spec. 12C: USBIO DevicePath(..)/Pci(0x14,0x0)/USB(0x6,0x0)) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg/App: Fix memory leak and save resources.Marvin H?user2016-05-251-2/+14
| | | | | | | | | | | | | | | | | | | 1) RunSplitCommand() allocates the initial SplitStdOut via CreateFileInterfaceMem(). Free SplitStdIn after the swap to fix the memory leak. 2) In RunSplitCommand(), SplitStdOut is checked for equality with StdIn. This cannot happen due to the if-check within the swap. Hence remove it. 3) UefiMain() doesn't free SplitList. Delete all list entries and reinitialize the list when in DEBUG. This does not include the CreateFileInterfaceMem()-allocated SplitStd mentioned in 1), so keep the ASSERT() until resolved. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
* ShellPkg: Fix ARM build failure.Fu Siyuan2016-05-201-2/+2
| | | | | | | | | This patch fixes the ARM build failure introduced by 2be45bfe2779043bc3566e879e7ec279412012dc. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* ShellPkg/Bcfg: Add support for 'addp' command.Qiu Shumin2016-05-201-13/+5
| | | | | | | | | | Until now the 'addp' command has been handled in the same way as 'add'. Just copy the DevicePath starting from the Hard Drive node when 'addp' is used. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
* ShellPkg: Also accept gEfiUnicodeCollation2ProtocolGuid for parsing.Marvin H?user2016-05-201-2/+9
| | | | | | | | | The EFI_UNICODE_COLLATION_PROTOCOL can have two different GUIDs. Look for both to support more UEFI implementations. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
* ShellPkg: Add argument to set block size for tftp command.Fu Siyuan2016-05-202-4/+48
| | | | | | | | | | | | TFTP block size has a big impact on the transmit performance, this patch is to add new argument [-s <block size>] for shell "tftp" command to configure the block size for file download. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg: Fix the incorrect behavior when pressing 'shift' key.Pedroa Liu2016-05-181-0/+6
| | | | | | | | | If 'ReadKeyStroke' function return EFI_NOT_READY then skip it. If the return value is EFI_DEVICE_ERROR clean the currentString buffer. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Pedroa Liu <pedroa.liu@insyde.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
* ShellPkg: Use a local variable to cache the pointer.Jaben Carsey2016-05-131-2/+4
| | | | | | | | CC: Qiu Shumin <shumin.qiu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
* report line number for command errors in a script.Jaben Carsey2016-05-122-1/+6
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
* ShellPkg: Remove debug message in release binaries.Qiu Shumin2016-05-061-0/+4
| | | | | | | | | Use BaseDebugLibNull instance instead of UefiDebugLibConOut to remove the debug message in release Shell binaries. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg UefiDpLib: Delete one comment introduced by 196ccda08fc4Star Zeng2016-05-031-2/+2
| | | | | | | | | | | Cc: Cinnamon Shia <cinnamon.shia@hpe.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Shumin Qiu <shumin.qiu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Cinnamon Shia <cinnamon.shia@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg/UefiDpLib: Fix the error message "Timer library instance error!"Cinnamon Shia2016-05-031-1/+5
| | | | | | | | | | | | | | | | | | When executing shell dp command, there is an error message "Timer library instance error!" The error message "Timer library instance error!" should be for the case about duration > EndTimeStamp if CountUp or duration > StartTimeStamp if CountDown. But if the EndTimeStamp of an entry is not added, it should not the case to catch. This change fixes the error message "Timer library instance error!" from the "BdsAttempt" entry which is logged when trying to boot a boot option. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg: Add NULL pointer check.Qiu Shumin2016-04-291-3/+17
| | | | | | | | | | Add pointer check to avoid NULL pointer dereferenced. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Tapan Shah <tapandshah@hpe.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Tapan Shah <tapandshah@hpe.com>
* ShellPkg: Enhance ping6 to select the interface automaticallyJiaxin Wu2016-04-291-71/+95
| | | | | | | | | | | | | | | | | | | | v2: * Refine the code to make it more readable. This patch is used to support no source IP specified case while multiple NICs existed in the platform. The command will select the first both connected and configured interface automatically. Note: Source address is always required when pinging a link-local address. Cc: Bhupesh Sharma <bhupesh.sharma@nxp.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* ShellPkg: Enhance ping to select the interface automaticallyJiaxin Wu2016-04-292-101/+129
| | | | | | | | | | | | | | | | | | | | | | | v2: * A. Refine the code to make it more readable. * B. Add hint message for link local address case. This patch is used to support no source IP specified case while multiple NICs existed in the platform. The command will select the first both connected and configured interface automatically. Note: Source address is always required when pinging a link-local address. Cc: David Van Arnem <dvanarnem@cmlab.biz> Cc: Bhupesh Sharma <bhupesh.sharma@nxp.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* ShellPkg: Update smbiosview for latest Type 17 devicesSamer El-Haj-Mahmoud2016-04-281-0/+21
| | | | | | | | | Update smbiosview to understand latest SMBIOS Type 17 devices from SMBIOS 3.0.0 spec Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg: Fix typos and EDK2 coding style issuesTapan Shah2016-04-271-10/+10
| | | | | | | | | Fixing typos and EDK2 coding style issues found from previous submit Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hpe.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg: Fix pci command for '_e' optionAbdul Lateef Attar2016-04-271-0/+1
| | | | | | | | | | | | | ShellPkg: Fix pci command for '_e' option Processing of '_e' argument was missing. Added fix, to process the '_e' option for printing additional AER information. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Abdul Lateef Attar <abdul-lateef.attar@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
* ShellPkg: Fix Shell treats every .EFI file as an executable application.Qiu Shumin2016-04-262-1/+19
| | | | | | | | | | | | UEFI Shell 2.x cannot recognize whether a .EFI file is an application or a driver. This means when we typed in a driver image in Shell command line, Shell will load the driver image and try to run the entry point function of the driver. This patch check the ImageCodeType to fix the issue. Cc: Jaben Carsey <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
* ShellPkg: Enahance 'dh' command to add more protocols decoding supportTapan Shah2016-04-256-10/+267
| | | | | | | | | | Adding EdidDiscovered, EdidActive protocol decode support a in 'dh' command. Extending GraphicsOutput protocol decoding to list all supported GOP resolutions. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hpe.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg: Support connect a device handle recursively with '-r'.Qiu Shumin2016-04-211-3/+4
| | | | | | | | | This patch make Shell 'connect' a device handle recursively with '-r' option. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg: Update ping command options to sync with SpecJiaxin Wu2016-04-192-15/+19
| | | | | | | | | | | | | | | This patch is used to update ping command options to sync with shell2.2 Spec. Considering the backward compatible issue, the patch keeps ā€˜-_sā€™ command option unchanged, only add the new option '-s' and make the old option '-_s' function same as new one. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg : Cache the environment variable into memory to enhanceQiu Shumin2016-04-154-45/+322
| | | | | | | | | | | | | | | | | the performance. Currently UEFI Shell reads variable storage to get the environment variables every time running a new command. And reading(writing) UEFI variables is a high cost operation on most platforms. In order to enhance the performance this patch read the variable storage once and cache the environment variables in memory. Every further 'set' command will save the variable not only to Shell cache, but also the flash variable storage. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by:Ruiyu Ni <ruiyu.ni@intel.com>
* ShellPkg: Update Guid/Protocol usages in INF files.Liming Gao2016-04-137-31/+31
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
* ShellPkg: Fix Shell ASSERT when mv file with cwd is NULL.Qiu Shumin2016-04-111-13/+16
| | | | | | | | | | | | | | | Shell will ASSERT when doing the following operation: "" Shell> mv fs2:\file1 fs2:\file2 "" This patch add NULL pointer check to fix this issue. Fixes: https://github.com/tianocore/edk2/issues/76 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* ShellPkg: Refine the comparisons code in ShellPkg.Qiu Shumin2016-03-291-7/+7
| | | | | | | | | For Boolean values not use explicit comparisons to TRUE or FALSE. For non-Boolean comparisons we should use a compare operator. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg/UefiDpLib: Fix a memory leak issue in Dp.Cinnamon Shia2016-03-291-0/+3
| | | | | | | | | The allocated memory of ParamPackage is not freed. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* ShellPkg AARCH64: remove DEBUG BuildOptions overrideArd Biesheuvel2016-03-251-7/+0
| | | | | | | | | | | | | | | The BuildOptions for AARCH64 in Application/Shell/Shell.inf only affect the core Shell binary, and not the Shell component libraries which are merged into the final Shell binary via NULL library class resolution. This means we need to override the UEFI_APPLICATION build options in the platform .DSC anyway, there is no point in setting these options here as well. So remove them. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* ShellPkg/UefiHandleParsingLib: Fix GUID referenceQiu Shumin2016-03-251-1/+1
| | | | | | | | | Pass in GUID* for the GUID reference in a CatSPrint statement. Issue was noticed when running "dh -d -v" command on a system with a PCI NIC installed. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
* ShellPkg/UefiShellDebug1CommandsLib: remove unused but set variableArd Biesheuvel2016-03-241-4/+0
| | | | | | | | | | Remove variable FStartRow that is declared, assigned but never referenced. This fixes a warning emitted by GCC when -Wunused-but-set-variable is in effect. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com>
* ShellPkg: Modify the 'dh' Shell command to dump the Firmware Management ā†µTapan Shah2016-03-243-3/+573
| | | | | | | | | | | | Protocol Image Descriptor Information. Modify 'dh' shell command to dump FirmwareManagement Protocol information. Add FirmwareManagement image descriptor V1 and V2 structure definition in UefiHandleParsingLib.h to support decoding V1/V2 revisions. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hpe.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg: Make the USB mouse behavior in 'edit' consistent with 'hexedit'.Qiu Shumin2016-03-245-39/+480
| | | | | | | | | 1. Make the USB mouse cursor move smoothly in 'edit'. 2. Make the USB mouse can drag and select text in 'edit'. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg: Remove the unused local variable.Qiu Shumin2016-03-171-3/+0
| | | | | | | | | | | | | Remove the unused local variable to refine the code. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc:Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* ShellPkg: Per UEFI Shell 2.2 SPEC to make Shell supports 'NoNesting'.Qiu Shumin2016-03-163-25/+162
| | | | | | | | | | | | This patch makes Shell support -nonesting invocation option. This option specifies that EFI_SHELL_PROTOCOL.Execute API nesting of a new Shell instance is optional and dependent on the 'nonesting' Shell environment variable. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jim Dailey <Jim_Dailey@Dell.com>
* ShellPkg: Fix Shell ASSERT when read 'TAB' key fail from 'ConIn'.Qiu Shumin2016-03-141-2/+4
| | | | | | | | | Free 'FoundFileList' when read 'TAB' key fail to avoid memory leak and ASSERT. Cc: Jaben Carsey <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* ShellPkg: Use DOS format end of line.Qiu Shumin2016-03-093-21/+21
| | | | | | | | Use DOS format end of line(CR, LF). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg/UefiDpLib: Support execution breakCinnamon Shia2016-03-084-25/+110
| | | | | | | | | | Support UEFI shell execution break. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Samer EL-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg: Merge Ping6 and Ifconfig6 tools to Shell command.Zhang, Lubo2016-03-089-4/+3478
| | | | | | | | | | | | | | According to the new Shell spec, we add Network2 profile and merge Ping6 and Ifconfig6 tools to Shell command. Cc: Carsey Jaben <jaben.carsey@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-By: Jaben Carsey <Jaben.carsey@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* ShellPkg: Fix smbiosview decode of PCIe Extended CapabilitiesSamer El-Haj-Mahmoud2016-03-042-4/+12
| | | | | | | | | | Fix SMBIOSVIEW decode of the HeaderLog fields of the PCIe AER structure . The PCIe 2.1 Base Specification, section 7.10, lists this as 16 bytes, or 4 DWORDs. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg: Update 'ifconfig -r' implementationJiaxin Wu2016-03-031-5/+26
| | | | | | | | | | | | | | | | | | | | | | | | This patch is used to update ifconfig -r implementation to sync with UEFI Shell 2.2. option -r means to reconfigure all or specified interface, and set DHCP policy. If specified interface is already set to DHCP, then refresh the IPv4 configuration. If the interface name is specified with '-r', DHCP DORA process will be triggered by the policy transition (static -> dhcp). Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Carsey Jaben <jaben.carsey@intel.com> Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com> Cc: Subramanian Sriram <sriram-s@hpe.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com> Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* ShellPkg: Increase reallocation size for temp memory filesJim_Dailey@Dell.com2016-03-031-4/+6
| | | | | | | | | | | | | | If data of any real size were to be piped from one command to another, an inordinate amount of time could be taken up by reallocating memory that is only 10 bytes bigger than what is currently needed. Also, this could cause unwelcome memory fragmentation. Added a define to control how much memory is reallocated beyond that which is currently needed. Set it to 1K vs. the original 10 bytes. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jim Dailey <jim_dailey@dell.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg: Do not write the UNICODE BOM on ConOut.Jim_Dailey@Dell.com2016-03-031-2/+4
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jim Dailey <jim_dailey@dell.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg: Add FileSize member to shell memory file structure.Jim_Dailey@Dell.com2016-03-031-3/+6
| | | | | | | | | | | | | | | The shell uses the memory file structure to manage temporary files in memory that support piping of output from one command into the the input of another command. The BufferSize member is the size of the internal buffer, not the size of the data that was written to the file. So, it was possible to read beyond the EOF of these files as reads used BufferSize. Now FileSize tracks the actual size of these files (the number of bytes written, not the number of bytes available in the buffer), and the reads use this member. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jim Dailey <jim_dailey@dell.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg: Revert git 'd6cf1af9' fixJiaxin Wu2016-03-021-103/+14
| | | | | | | | | | | | | | | 'd6cf1af9' is associated with '3d0a49ad' commit. So, this patch is used to respond the revert for '3d0a49ad' to adapt the Ipv4 config policy update. Cc: Subramanian Sriram <sriram-s@hpe.com> Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
* ShellPkg: Don't strip BOM when piping UCS2 data to a UEFI appJim_Dailey@Dell.com2016-03-011-11/+6
| | | | | | | | | | If the BOM is stripped from StdIn, then an app that duplicates StdIn will not be able to duplicate, say, a UCS2 file that was piped into it (the output file it creates would not start with a BOM). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jim Dailey <jim_dailey@dell.com> Reviewed-by: Jaben Carsey <Jaben.Carsey@intel.com>
* ShellPkg: Fix unexpected behavior of mouse cursor in Editor.Qiu Shumin2016-02-271-3/+4
| | | | | | | | | | | USB mouse cursor cannot move unless the left button is down. The patch refresh the FileBuffer of Editor every time when the 'MainEditorRefresh' is called to fix this bug. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
* ShellPkg: Support finding help message embedded in resource section.Qiu Shumin2016-02-243-17/+259
| | | | | | | | | | | | | | | | | | | | | | | | UEFI Shell scandalizes the help message in spec level so that a standalone UEFI shell application can never get "-?" switch, instead the Shell core (interpreter) detects the "-?" and finds .MAN file for that shell application in certain spec defined paths, then show the help extracted from that .MAN file. But it means distributing a UEFI shell application not only means distributing a .EFI file but also distributing a .MAN file. If the text formatted .MAN file is corrupted (edited by user by mistake), or is missing (deleted by user by mistake), no help will be shown to user. So this patch enhance the Shell to make it support finding help message imbedded in resource section of application image. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* ShellPkg: Do NULL pointer check before the pointer is used.Qiu Shumin2016-02-231-1/+1
| | | | | | | | Do NULL pointer check before the pointer is used to avoid dereferenced. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg: Fix the last command doesn't work in a script.Qiu Shumin2016-02-191-1/+4
| | | | | | | | | | When the last line in a script file is not an empty line the Shell will not execute the command in the last line. The patch refine the logic in function 'ShellFileHandleReturnLine' and fix the issue. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>