summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Private/NewBoot/BootKit/Boot.hxx2
-rw-r--r--Private/NewBoot/Source/BootNotes.txt9
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/Entrypoint.cxx42
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/compile_flags.txt3
-rw-r--r--Private/NewBoot/Source/HEL/RISCV/.gitkeep (renamed from Private/NewBoot/Source/HEL/PowerPC/.gitkeep)0
-rw-r--r--Private/NewBoot/Source/makefile6
-rw-r--r--Public/SDK/ZipKit/Makefile6
-rw-r--r--Public/SDK/ZipKit/NewFS-Addon.hpp6
-rw-r--r--TODO_LIST.TXT4
9 files changed, 40 insertions, 38 deletions
diff --git a/Private/NewBoot/BootKit/Boot.hxx b/Private/NewBoot/BootKit/Boot.hxx
index a6ff15c5..70607a9c 100644
--- a/Private/NewBoot/BootKit/Boot.hxx
+++ b/Private/NewBoot/BootKit/Boot.hxx
@@ -68,7 +68,7 @@ enum {
kWhite,
};
-#define BK_START_KERNEL (0x80000000)
+#define BK_START_KERNEL (0x8000000)
HCore::SizeT BStrLen(const char *ptr);
HCore::SizeT BSetMem(char *src, const char byte, const HCore::SizeT len);
diff --git a/Private/NewBoot/Source/BootNotes.txt b/Private/NewBoot/Source/BootNotes.txt
deleted file mode 100644
index e09e9cce..00000000
--- a/Private/NewBoot/Source/BootNotes.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-bootloader roadmap:
-
-- Rom is being mapped.
-- Move boot code to link address (8M)
-- Decompress kernel using newboot_decompress_pef()
-- Find start image.
-- Run image at 8M page zero.
-
-- Amlal
diff --git a/Private/NewBoot/Source/HEL/AMD64/Entrypoint.cxx b/Private/NewBoot/Source/HEL/AMD64/Entrypoint.cxx
index a1868144..f155311f 100644
--- a/Private/NewBoot/Source/HEL/AMD64/Entrypoint.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/Entrypoint.cxx
@@ -9,24 +9,42 @@
#include <BootKit/Boot.hxx>
+namespace Detail {
+/**
+@brief Stop Execution of Bootloader.
+@param SystemTable EFI System Table.
+*/
+Void Stop(EfiSystemTable* SystemTable) noexcept {
+ SystemTable->ConOut->OutputString(SystemTable->ConOut,
+ L"HCoreLdr: Hanging...\r\n");
+
+ while (true) {
+ rt_cli();
+ rt_halt();
+ }
+}
+} // namespace Detail
+
// don't remove EfiGUID, it will call initializer_list!
EFI_EXTERN_C int EfiMain(EfiHandlePtr ImageHandle,
EfiSystemTable* SystemTable) {
SystemTable->ConOut->OutputString(SystemTable->ConOut,
- L"HCoreLdr: Initializing Kernel...\r\n");
+ L"HCoreLdr: Initializing...\r\n");
- EfiLoadImageProtocol* protocol;
+ EfiLoadImageProtocol* protocol = nullptr;
EfiGUID guid = EFI_LOADED_IMAGE_PROTOCOL_GUID;
- SystemTable->BootServices->LocateProtocol(&guid, nullptr,
- (VoidPtr*)&protocol);
+ Int32 status_code = SystemTable->BootServices->OpenProtocol(
+ ImageHandle, &guid, (VoidPtr*)&protocol, ImageHandle, nullptr,
+ EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (!protocol) {
+ if (status_code != kEfiOk) {
SystemTable->ConOut->OutputString(
SystemTable->ConOut,
L"HCoreLdr: Could not locate EfiLoadImageProtocol! Aborting...\r\n");
+ Detail::Stop(SystemTable);
return kEfiFail;
}
@@ -38,21 +56,11 @@ EFI_EXTERN_C int EfiMain(EfiHandlePtr ImageHandle,
SystemTable->ConOut->OutputString(
SystemTable->ConOut, L"HCoreLdr: Could not exit Boot Services!\r\n");
- SystemTable->ConOut->OutputString(SystemTable->ConOut,
- L"HCoreLdr: Entering limbo state...\r\n");
-
- while (true) {
- rt_cli();
- rt_halt();
- }
+ Detail::Stop(SystemTable);
}
// TODO: Jump Code
- while (true) {
- rt_cli();
- rt_halt();
- }
-
+ Detail::Stop(SystemTable);
return kEfiOk;
}
diff --git a/Private/NewBoot/Source/HEL/AMD64/compile_flags.txt b/Private/NewBoot/Source/HEL/AMD64/compile_flags.txt
new file mode 100644
index 00000000..e4515efe
--- /dev/null
+++ b/Private/NewBoot/Source/HEL/AMD64/compile_flags.txt
@@ -0,0 +1,3 @@
+-std=c++20
+-I../../../
+-I../../../../
diff --git a/Private/NewBoot/Source/HEL/PowerPC/.gitkeep b/Private/NewBoot/Source/HEL/RISCV/.gitkeep
index e69de29b..e69de29b 100644
--- a/Private/NewBoot/Source/HEL/PowerPC/.gitkeep
+++ b/Private/NewBoot/Source/HEL/RISCV/.gitkeep
diff --git a/Private/NewBoot/Source/makefile b/Private/NewBoot/Source/makefile
index 9ae30d13..2e092da2 100644
--- a/Private/NewBoot/Source/makefile
+++ b/Private/NewBoot/Source/makefile
@@ -15,8 +15,8 @@ invalid-recipe:
.PHONY: arch-amd64
arch-amd64:
$(CC_GNU) $(FLAG_GNU) HEL/AMD64/*.cxx
- $(LD_GNU) *.o -e efi_main -filealign:16 -shared --subsystem=10 -ffreestanding -o HCORELDR.EXE
- cp HCORELDR.EXE CDROM/EFI/BOOT/BOOTX64.EFI
+ $(LD_GNU) *.o -e efi_main -filealign:16 -shared --subsystem=10 -ffreestanding -o HCoreLdr.exe
+ cp HCoreLdr.exe CDROM/EFI/BOOT/BOOTX64.EFI
cp -r ../../Root ./CDROM/MAHROUSS
.PHONY: run-efi-debug
@@ -26,4 +26,4 @@ run-efi-debug:
.PHONY: clean
clean:
- rm -f *.o *.EFI *.EXE
+ rm -f *.o HCoreLdr.exe OVMF.fd
diff --git a/Public/SDK/ZipKit/Makefile b/Public/SDK/ZipKit/Makefile
index b015c393..7665c614 100644
--- a/Public/SDK/ZipKit/Makefile
+++ b/Public/SDK/ZipKit/Makefile
@@ -8,12 +8,12 @@ CCFLAGS=-c -ffreestanding -fno-rtti -fno-exceptions -std=c++20
ASM=nasm
ASMFLAGS=-f elf64
-.PHONY: build_zipkit
-build_zipkit:
+.PHONY: build-zipkit
+build-zipkit:
$(CC) -I../ -I../../../Private/ $(CCFLAGS) *.cxx
.PHONY: all
-all: build_zipkit
+all: build-zipkit
@echo "Done."
.PHONY: clean
diff --git a/Public/SDK/ZipKit/NewFS-Addon.hpp b/Public/SDK/ZipKit/NewFS-Addon.hpp
index 0325f81e..140c7c1f 100644
--- a/Public/SDK/ZipKit/NewFS-Addon.hpp
+++ b/Public/SDK/ZipKit/NewFS-Addon.hpp
@@ -9,10 +9,10 @@
#pragma once
-// TODO: integrate NewFS compression.
+/// TODO: integrate NewFS compression.
-// NewFS catalog is compressed.
+/// @brief NewFS catalog is compressed.
#define kNewFSIsZip 255
-// NewFS catalog has password attached to it.
+/// @brief NewFS catalog has password attached to it.
#define kNewFSHasPassword 256
diff --git a/TODO_LIST.TXT b/TODO_LIST.TXT
index f8e1da3e..7479344e 100644
--- a/TODO_LIST.TXT
+++ b/TODO_LIST.TXT
@@ -4,8 +4,8 @@
- We need a bootloader for AMD64/ARM [ X ]
- Implement Boot Services [ X ]
- Design Handover [ X ]
- - Load kernel into memory [ ]
- - Jump to kernel [ ]
+ - Load kernel into memory [ ]
+ - Jump to kernel [ ]
- Context switch x87/SSE/AVX registers [ ]
- Framebuffer and ATA support [ ]
- Native Subsystem and GUI [ ]