Commit Graph

15 Commits

Author SHA1 Message Date
Maurice Ma
970153f09d [Shell] Add memory de-allocation for Shell commands (#662)
SBL Shell allocated memory during the command registeration phase.
However, these memory is not de-allocated after Shell exits. This
patch added code to de-allocate the memory. It also rearranged the
code a little bit so that function declarations are not required
any more.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-04-13 17:37:04 -07:00
Aiden Park
29446a1c2a Pointer type cast for both 32/64-bit operation (#615)
This patch allows both 32/64-bit addressing properly.
- Pointer type cast with UINTN
- Add missing EFIAPI for APIs

Signed-off-by: Aiden Park <aiden.park@intel.com>
2020-03-26 17:30:55 -07:00
Maurice Ma
12f6f62630 Add MiniShell support for debug purpose
Soemtimes when JTAG based debug is not available, it might be easier
to have Shell access in earlier stage to check lots of platform
settings. Today it is impossible because full Shell has lots of other
dependencies which might not satisfy in early stage. This patch added
a PCD PcdMiniShellEnabled to build a mini Shell with very few
dependencies. This mini Shell can be used in early debug phase for SBL.

To use it, add the following to override the PCD for a specific stage
in BootloaderCorePkg.dsc.
EX:
    $(PLATFORM_PACKAGE)/Stage1B/Stage1B.inf {
      <PcdsFeatureFlag>
        gPlatformCommonLibTokenSpaceGuid.PcdMiniShellEnabled | TRUE
      ...
    }
Then include ShellLib.h in stage C code and add ShellLib in related
stage INF file. If adding it into Stage1A, it needs to be after the
Stage1A banner print out.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-12-18 21:29:07 -07:00
Maurice Ma
2ed3e9c46a Remove Shell global variable usage
This patch removed global variable usages in ShellLib.  It is
required when running Shell in early stage from flash. In this
case global variable is read-only. All memory should be allocated
from stack or heap.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-12-18 21:29:07 -07:00
Aiden Park
b24fd2759c Cosmetic: Convert LF to CRLF
This will fully support PatchCheck.py.
- Remove all trailing whitespace
- Convert LF to CRLF by default
- Update EFI_D_* to DEBUG_*
- Re-enable CRLF check in PatchCheck.py

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-12-02 16:21:19 -08:00
Aiden Park
d2ea80b5c9 Add InsertionSort for Linked List (#454)
This provides basic insertion sort API for Linked List. As part of change,
this insertion sort is used for PCI BAR calculation by its alignment
and for shell commands list by its name.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-11-14 11:26:31 -08:00
Aiden Park
fd5c402b3b ShellLib: 'help' lists Shell commands sorted by name (#434)
This lists the supported Shell commands in alphabetical order.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-11-05 15:48:06 -08:00
Kok Tong Ong
442a3efccc uart buffer flush during reboot in osloader 2019-11-02 22:28:41 +08:00
Maurice Ma
03b466e8db Add Shell command line history support (#401)
This patch added command line history upport in SBL Shell. It makes
it easy to run a previous command using Up/Down arrow key.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-17 11:12:55 -07:00
Maurice Ma
bc8a817e59 Reinitialize Shell command list
Since OsLoader will restart from beginning and all memory will be
reclaimed, it is required for Shell library to re-initialize the
global varaibles, for example, command list. Otherwise, the old
memory pointer will be used and cause issues. This patch added the
link list re-initialization in Shell lib.  It fixed #253.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-08-07 13:37:05 -07:00
Aiden Park
5103615bfb [ShellLib] Add ShellCommandRegister API
Currently, all shell commands are statically defined in header file.
Add shell command registration API to allow include/exclude shell
commands dynamically.
Later, some debug shell commands will be added according to build
mode or debug mask.
- TBD: Sorting shell commands by name

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-08-05 21:04:27 -07:00
Guo Dong
5e10bd1e07 Update BSD license to BSD+Patent license
To align with EDK2, update file license
to use BSD+Patent license

Signed-off-by: Guo Dong <guo.dong@intel.com>
2019-06-13 10:46:49 -07:00
Borgerson, Matthew A
2255bc10b0 Enable basic framebuffer text console output
This patch simplifies the GraphicsLib code and adds an abstraction layer
for printing to a virtual "console," through the familier
ConsoleWrite(buffer, len) style function call.

ConsoleWrite can be configured to output to either the serial port, or
the display framebuffer, or both. This primarily enables the command
shell to be used with a display and keyboard.

Signed-off-by: Borgerson, Matthew A <matthew.a.borgerson@intel.com>
2018-10-25 19:25:44 -07:00
Maurice Ma
bd1ea24cc1 Add ConsoleInLib to abstract console input (#13)
Current implementation assumes serial port is the only input console
device supported.  But other input console devices can be added later
on. This patch added a ConsoleInLib to abstract the input console
interfaces.  It also added PCDs to control enabled input console
devices.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2018-10-05 14:36:29 -07:00
Maurice Ma
c6999f497a Initial check-in for Slim Bootloader source 2018-09-13 16:11:07 -07:00