Commit Graph

76 Commits

Author SHA1 Message Date
Vincent Chen
a63818df94 fix: [Common] correct the free memory function for fs load command
When OsLoader shell "fs load" tried to free memory, the
assertion happened with the message "CR has Bad Signature".
It's caused when FreePool() tried to free the memory allocated
by AllocatePages(), and the memory signature is not as expected.
So modify the free memory function to FreePages()

Signed-off-by: Vincent Chen <vincent.chen@intel.com>
2024-09-26 11:38:31 -07:00
tsaikevin
e40e8679be fix: [Common] Fix coverity issues for x64 build (#2276)
Address following coverity issues
1. Integer Overflow or Wraparound (CWE 190)
2. Unexpected Sign Extension (CWD 194)

Signed-off-by: Kevin Tsai <kevin.tsai@intel.com>
2024-08-27 11:54:51 -07:00
Jiaqing Zhao
8a670266fd ShellLib: Assign BootOption->SwPart on editing boot option
When editing a boot option entry, new SwPart value is only assgined to
FileImage or LbaImage struct, while BootOption->SwPart is cleared,
breaking traditional linux boot as it uses SwPart there. Assign the
new value to BootOption->SwPart to keep compatibility.

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2024-07-08 11:05:25 -07:00
Biswas Arghya
f8bfe71c06 feat:[Common] boot from an image from memory
Add a new entry in CfgData_BootOption.yaml to boot from memory. The boot
device must be 7 (MEMORY), and the address of the container boot image
(CONTAINER_BOOT_SIGNATURE) can be placed at an address specified by
LBA format (i.e., use HEX prefix. EX: #0x12345678).

Example entry of CfgData_BootOption.yaml:
!expand { BOOT_OPTION_TMPL : [ 0 , 0,  0,  7,   0 ,   0 ,   0xFF ,   1 , '#0x47A31000'] }

If the address is not predefined then it can be updated in run time from
SBL shell boot option table.

Validated by loading a container image to the memory by using 'fs load'
command in SBL shell and update the load image address in boot option table.

Signed-off-by: Biswas Arghya <arghya.biswas@intel.com>
2024-03-18 10:04:41 -07:00
Guo Dong
b4c1b6b36c Add "acpi" shell command (#2041)
It could help debug ACPI related issues.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2023-10-07 23:14:39 -07:00
Jiaqing Zhao
338ba840bf OsLoader: Print misc image info in Shell
Add support to print misc image info in shell. Misc image will only be
printed when BOOT_FLAGS_MISC is set.

Also fixes some minor bugs in 5968cfa919 ("OsLoader: Print all extra
images")

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2023-09-19 17:58:18 -07:00
Jiaqing Zhao
c65cd572d2 OsLoader: Print all extra images
Currently only PreOs and Extra0 image info is printed in boot options
list, this patch prints all of them.

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2023-09-12 13:55:06 -07:00
Jiaqing Zhao
5968cfa919 OsLoader: Shell support for FILE_IMAGE_LOCATION
Support printing and modifying boot file info in FILE_IMAGE_LOCATION
struct in OsLoader shell.

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2023-09-12 13:55:06 -07:00
Jiaqing Zhao
b17d6f8c2f Fix typo EnumImageTypeAdroid
"Adroid" should be "Android".

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2023-09-05 20:36:54 -07:00
Jiaqing Zhao
68da867e71 ShellLib: Allow editing ImageType in boot command
Allow ImageType to be edited in boot command in shell.

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2023-09-05 20:36:54 -07:00
Stanley Chang
ca071fd9e3 feat: [EHL] add EfiResetShutdown in ResetSystemLib
The patch handles EfiResetShutdown. With the patch, one can
test "reset off" under OS Loader.

The patch also
 - fixes a wrong reference error in ResetSystemLib.inf.
 - add shutdown text in CmdReset.c

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2023-08-22 21:25:00 -07:00
tsaikevin
d952b1487c fix: [Common] Fix Coverity issues (#1978)
Fixed Untrusted loop bound (CWE 606)

Signed-off-by: Kevin Tsai <kevin.tsai@intel.com>
2023-07-31 16:06:00 -07:00
Jiaqing Zhao
b1bf6bf6d6 ShellLib: Fix type mismatch warning in MmRead()
Change the data type of Width to UINT32 of MmRead() declared in
CmdPci.h to match its definition in CmdMm.c.

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2023-07-31 14:47:43 -07:00
tsaikevin
0d45c3e60a fix: [Common] Fix Coverity issues (#1958)
Fixed dead default in switch and logically dead code (CWE 561)

Signed-off-by: Kevin Tsai <kevin.tsai@intel.com>
2023-07-19 14:03:41 -07:00
Sean McGinn
637f4b26b6 Remove PCD for OSL corruption tool
Removes PCD for OSL corruption tool so that it
doesn't accidentally get enabled in production code

Signed-off-by: Sean McGinn <sean.mcginn@intel.com>
2023-06-12 21:38:12 -07:00
Guo Dong
474fb76f1d feat: Update the lite variable usage
Since lite variable API change, this patch Update
the caller to align with variable library.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2023-05-10 12:16:57 -07:00
Arghya Biswas
224e75fbf6 fix: enumerate all USB instances to search devices (#1818)
instance 0 was hardcoded, so not able to read the devices from other
instances. Now read the instances number from the device table and
enumerate all USB instances one by one.

Signed-off-by: Biswas Arghya <arghya.biswas@intel.com>
2023-02-03 10:54:33 -08:00
Atharva Lele
622ad48cff ShellLib/CmdMmap: fix MemTypeToStr() strings (#1820)
0x03 is ACPI Reclaim Memory
0x04 is ACPI NVS Memory

As defined in BootloaderCommonPkg/Include/Guid/MemoryMapInfoGuid.h
and ACPI Specification Chapter 15.

Signed-off-by: Atharva Lele <atharva.lele@intel.com>
2023-02-01 18:31:41 -08:00
Guo Dong
aee7833455 Add description for performance data (#1783)
When running "perf" command from OsLoader shell, it would
print the performance data but it is difficult to know what
they are mean. The patch adds the description to performance
data.

Signed-off-by: Guo Dong <guo.dong@intel.com>

Signed-off-by: Guo Dong <guo.dong@intel.com>
2022-12-14 07:27:53 -05:00
Kalp Parikh
c68f61707f [ADL/RPL] Update default boot options
Change boot flag to 0 to enable booting
yocto/ubuntu

TEST:Boot to yocto on ADL

Signed-off-by: Kalp Parikh <kalp.parikh@intel.com>
2022-11-09 13:54:13 -07:00
Sean McGinn
ceea7d1d03 Rename PCD for SBL component corruption command
Signed-off-by: Sean McGinn <sean.mcginn@intel.com>
2022-10-17 11:59:04 -07:00
Sean McGinn
44b332d609 Add more examples for corruptcomp tool
Signed-off-by: Sean McGinn <sean.mcginn@intel.com>
2022-10-17 11:59:04 -07:00
Sean McGinn
b82dcd344f Add PCD for enablement of corruptcomp tool
Adds build-time PCD that hides corruptcomp
tool by default
Renames corruptcomponent to corruptcomp
Enhances error checking/logs

Signed-off-by: Sean McGinn <sean.mcginn@intel.com>
2022-10-17 11:59:04 -07:00
Sean McGinn
f7c6cc599e Create OS loader shell tool for SBL component corruption
Create a tool that corrupts SBL components so that
the SBL resiliency feature can more easily be tested
and demonstrated

Signed-off-by: Sean McGinn <sean.mcginn@intel.com>
2022-10-17 11:59:04 -07:00
ckolhe
0ad56ef2dd Update mm shell command description (#1700)
Updated the help section of mm shell command.

Signed-off-by: Chirag Vijay Kolhe <chirag.vijay.kolhe@intel.com>
Signed-off-by: Sachin Kamat <sachin.kamat@intel.com>

Signed-off-by: Chirag Vijay Kolhe <chirag.vijay.kolhe@intel.com>
Signed-off-by: Sachin Kamat <sachin.kamat@intel.com>
2022-10-03 09:43:09 -04:00