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/kernel/FirmwareKit/EFI/API.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'dev/kernel/FirmwareKit') diff --git a/dev/kernel/FirmwareKit/EFI/API.h b/dev/kernel/FirmwareKit/EFI/API.h index b05fcc71..916a6b1a 100644 --- a/dev/kernel/FirmwareKit/EFI/API.h +++ b/dev/kernel/FirmwareKit/EFI/API.h @@ -31,7 +31,7 @@ inline EfiBootServices* BS = nullptr; EXTERN_C void rt_cli(); EXTERN_C void rt_hlt(); -namespace EFI +namespace Boot { /// @brief Halt and clear interrupts. /// @return @@ -79,9 +79,9 @@ Bascially frees everything we have in the EFI side. ST->ConOut->OutputString(ST->ConOut, L" ***\r"); - EFI::Stop(); + Boot::Stop(); } -} // namespace EFI +} // namespace Boot inline void InitEFI(EfiSystemTable* SystemTable) noexcept { -- cgit v1.2.3