From 4966ca284132e4e52a9bee6f582527aa7f784ef6 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 28 Mar 2025 04:57:17 +0100 Subject: bootz: consolidate EFI namespace into Boot, finalize NetBoot fallback Collapse the EFI namespace into Boot to unify BootZ's interface for firmware handling. This simplifies calls to functions like Stop(), ThrowError(), and ExitBootServices(), and improves consistency across boot modules. Also rename SysChk/Module.cc to SysChk/SysChk.cc for naming consistency with other modules. Improve NetBoot fallback path in BootEFI: - Ensure netboot.sys is read before ExitBootServices() to avoid allocation issues after exiting firmware services. - Reuse reader and thread objects if kernel boot fails. - Update both AMD64 and ARM64 paths to follow the same logic. Update all call sites to use Boot:: instead of EFI::. Fixes: broken error handling and memory reads after ExitBootServices() Signed-off-by: Amlal El Mahrouss --- dev/boot/src/BootFileReader.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dev/boot/src/BootFileReader.cc') diff --git a/dev/boot/src/BootFileReader.cc b/dev/boot/src/BootFileReader.cc index a2afbce5..604ddaba 100644 --- a/dev/boot/src/BootFileReader.cc +++ b/dev/boot/src/BootFileReader.cc @@ -154,7 +154,7 @@ Void Boot::BootFileReader::ReadAll(SizeT readUntil, SizeT chunkToRead, UIntPtr o kEfiOk) { mWriter.Write(L"*** error: ").Write(err).Write(L" ***\r"); - EFI::ThrowError(L"OutOfMemory", L"Out of memory."); + Boot::ThrowError(L"OutOfMemory", L"Out of memory."); } } else -- cgit v1.2.3