summaryrefslogtreecommitdiffhomepage
path: root/Private/NewBoot/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Private/NewBoot/Source')
-rw-r--r--Private/NewBoot/Source/RuntimeMain.cxx20
-rw-r--r--Private/NewBoot/Source/makefile2
2 files changed, 7 insertions, 15 deletions
diff --git a/Private/NewBoot/Source/RuntimeMain.cxx b/Private/NewBoot/Source/RuntimeMain.cxx
index a520b980..a6e4015c 100644
--- a/Private/NewBoot/Source/RuntimeMain.cxx
+++ b/Private/NewBoot/Source/RuntimeMain.cxx
@@ -15,15 +15,7 @@
#include <KernelKit/PE.hpp>
#include <NewKit/Ref.hpp>
-namespace Detail {
-constexpr Int32 kBufferReadSz = 2048;
-
-auto FindPEHeader(DosHeaderPtr ptrDos) -> ExecHeaderPtr {
- if (!ptrDos) return nullptr;
-
- return (ExecHeaderPtr)(&ptrDos->eLfanew + 1);
-}
-} // namespace Detail
+#define kBufferReadSz 2048
EFI_EXTERN_C EFI_API Int EfiMain(EfiHandlePtr ImageHandle,
EfiSystemTable* SystemTable) {
@@ -54,17 +46,17 @@ EFI_EXTERN_C EFI_API Int EfiMain(EfiHandlePtr ImageHandle,
BFileReader img(L"HCOREKRNL.EXE", ImageHandle);
- img.Size() = Detail::kBufferReadSz;
+ img.Size() = kBufferReadSz;
img.Read();
if (img.Error() == BFileReader::kOperationOkay) {
BlobType blob = (BlobType)img.Blob();
- DosHeaderPtr ptrDos = reinterpret_cast<DosHeaderPtr>(blob);
- ExecHeaderPtr ptrHdr = Detail::FindPEHeader(ptrDos);
+ ExecHeaderPtr ptrHdr = reinterpret_cast<ExecHeaderPtr>(
+ HCore::rt_find_exec_header(reinterpret_cast<DosHeaderPtr>(blob)));
- if (ptrDos->eMagic[0] == kMagMz0 && ptrDos->eMagic[1] == kMagMz1 &&
- ptrHdr->mMachine == EFI::Platform() && ptrHdr->mMagic == kPeMagic) {
+ if (ptrHdr && ptrHdr->mMachine == EFI::Platform() &&
+ ptrHdr->mMagic == kPeMagic) {
if (ptrHdr->mNumberOfSections > 1) {
UInt64 MapKey = 0;
diff --git a/Private/NewBoot/Source/makefile b/Private/NewBoot/Source/makefile
index 23678e9d..fab7453d 100644
--- a/Private/NewBoot/Source/makefile
+++ b/Private/NewBoot/Source/makefile
@@ -22,7 +22,7 @@ bootloader-amd64:
$(ASM) $(FLAG_ASM) HEl/AMD64/AMD64-VirtualMemory.asm
$(LD_GNU) $(OBJ) $(LD_FLAGS) -o HCoreLdr.exe
cp HCoreLdr.exe CDROM/EFI/BOOT/BOOTX64.EFI
- cp ../../HCoreKrnl.exe CDROM/HCOREKRNL.EXE
+ cp ../../HCoreKrnl.exe CDROM/HCOREKRNL.EXE && cp ../../Root/System/LookAndFeel.css CDROM/LOOK.CSS
.PHONY: run-efi-amd64
run-efi-amd64: