From 8f7904569a60721cfd051a359dd17cc86ea67cfe Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 31 Jan 2024 17:09:04 +0100 Subject: Kernel: add Terminal init sequence in KeInitEFI. Signed-off-by: Amlal El Mahrouss --- Private/EFIKit/EFILib.hxx | 3 +++ Private/NewBoot/Source/HEL/AMD64/Entrypoint.cxx | 5 +---- Private/Source/NewFS-Journal.cxx | 8 ++++---- Private/makefile | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'Private') diff --git a/Private/EFIKit/EFILib.hxx b/Private/EFIKit/EFILib.hxx index 0d076b24..e7b135ef 100644 --- a/Private/EFIKit/EFILib.hxx +++ b/Private/EFIKit/EFILib.hxx @@ -43,6 +43,9 @@ inline void KeInitEFI(EfiSystemTable* SystemTable) noexcept { ST = SystemTable; BS = ST->BootServices; + + ST->ConOut->ClearScreen(SystemTable->ConOut); + ST->ConOut->SetAttribute(SystemTable->ConOut, kEFIYellow); } inline void KeRuntimeStop(const EfiCharType* ErrorCode, diff --git a/Private/NewBoot/Source/HEL/AMD64/Entrypoint.cxx b/Private/NewBoot/Source/HEL/AMD64/Entrypoint.cxx index 3e96ff14..17d308df 100644 --- a/Private/NewBoot/Source/HEL/AMD64/Entrypoint.cxx +++ b/Private/NewBoot/Source/HEL/AMD64/Entrypoint.cxx @@ -18,16 +18,13 @@ EFI_EXTERN_C int EfiMain(EfiHandlePtr ImageHandle, EfiSystemTable* SystemTable) { KeInitEFI(SystemTable); - SystemTable->ConOut->ClearScreen(SystemTable->ConOut); - SystemTable->ConOut->SetAttribute(SystemTable->ConOut, kEFIYellow); - BTextWriter writer; writer.WriteString(L"HCoreLdr: Booting from \\Volume0\\...") .WriteString(L"\r\n"); UInt64 mapKey = 0; - BFileReader reader(L"\\MAHROUSS\\Root\\System\\HCoreKrnl.efi\0"); + BFileReader reader(L"\\MAHROUSS\\Root\\System\\HCoreKrnl.exe\0"); auto blob = reader.ReadAll(); if (!blob) diff --git a/Private/Source/NewFS-Journal.cxx b/Private/Source/NewFS-Journal.cxx index 1412c7b0..029e051a 100644 --- a/Private/Source/NewFS-Journal.cxx +++ b/Private/Source/NewFS-Journal.cxx @@ -27,13 +27,13 @@ class NewFSJournalRunner final { : fLoadRoutine(load_runner) { MUST_PASS(fLoadRoutine); - fLoadRoutine(this); + // load runner + if (fLoadRoutine) fLoadRoutine(this); } + /// @brief Unload journal runner ~NewFSJournalRunner() noexcept { - MUST_PASS(fUnloadRoutine); - - fUnloadRoutine(this); + if (fUnloadRoutine) fUnloadRoutine(this); } HCORE_COPY_DEFAULT(NewFSJournalRunner); diff --git a/Private/makefile b/Private/makefile index 9ac4a434..5ec3e277 100644 --- a/Private/makefile +++ b/Private/makefile @@ -10,7 +10,7 @@ ASM = nasm ASMFLAGS = -f elf64 # This file is the kernel, responsible of task management, memory, drivers and more. -KERNEL = HCoreKrnl.efi +KERNEL = HCoreKrnl.exe # The kernel entrypoint SCRIPT = --script=Linker/Platforms/PC.lds -- cgit v1.2.3