summaryrefslogtreecommitdiffhomepage
path: root/Private/NewBoot/Source
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-01-29 22:38:43 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-01-29 22:38:43 +0100
commita8c17ccd6d97cc78830917dc6282b040b21ba16c (patch)
tree2181e96ccf9c89c677d2208661bce5584a667470 /Private/NewBoot/Source
parent78861f1b16f18a85e9f6890e16eb320412b6ab80 (diff)
Kernel: Update SPECS and TODO list.
Cleaned up the SPECS to get into the point. Current Task: Load kernel into memory. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/NewBoot/Source')
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/Boot.cxx15
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/Entrypoint.cxx9
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/Platform.cxx (renamed from Private/NewBoot/Source/HEL/AMD64/Processor.cxx)0
-rw-r--r--Private/NewBoot/Source/makefile8
4 files changed, 24 insertions, 8 deletions
diff --git a/Private/NewBoot/Source/HEL/AMD64/Boot.cxx b/Private/NewBoot/Source/HEL/AMD64/Boot.cxx
index 70f280e6..6bf63ffe 100644
--- a/Private/NewBoot/Source/HEL/AMD64/Boot.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/Boot.cxx
@@ -22,6 +22,21 @@ hCore::SizeT BStrLen(const char *ptr) {
return cnt;
}
+hCore::SizeT BSetMem(char *src, const char byte, const hCore::SizeT len) {
+ hCore::SizeT cnt = 0UL;
+
+ while (*src != 0) {
+ if (cnt > len) break;
+
+ *src = byte;
+ ++src;
+
+ ++cnt;
+ }
+
+ return cnt;
+}
+
/**
@brief puts wrapper over VGA.
*/
diff --git a/Private/NewBoot/Source/HEL/AMD64/Entrypoint.cxx b/Private/NewBoot/Source/HEL/AMD64/Entrypoint.cxx
index 5422d368..a1868144 100644
--- a/Private/NewBoot/Source/HEL/AMD64/Entrypoint.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/Entrypoint.cxx
@@ -8,16 +8,13 @@
*/
#include <BootKit/Boot.hxx>
-#include <BootKit/Processor.hxx>
-#include <BootKit/Protocol.hxx>
// don't remove EfiGUID, it will call initializer_list!
EFI_EXTERN_C int EfiMain(EfiHandlePtr ImageHandle,
EfiSystemTable* SystemTable) {
- EfiCharType* string = L"HCoreLdr: Initializing...\r\n";
-
- SystemTable->ConOut->OutputString(SystemTable->ConOut, string);
+ SystemTable->ConOut->OutputString(SystemTable->ConOut,
+ L"HCoreLdr: Initializing Kernel...\r\n");
EfiLoadImageProtocol* protocol;
EfiGUID guid = EFI_LOADED_IMAGE_PROTOCOL_GUID;
@@ -42,7 +39,7 @@ EFI_EXTERN_C int EfiMain(EfiHandlePtr ImageHandle,
SystemTable->ConOut, L"HCoreLdr: Could not exit Boot Services!\r\n");
SystemTable->ConOut->OutputString(SystemTable->ConOut,
- L"HCoreLdr: Hanging...\r\n");
+ L"HCoreLdr: Entering limbo state...\r\n");
while (true) {
rt_cli();
diff --git a/Private/NewBoot/Source/HEL/AMD64/Processor.cxx b/Private/NewBoot/Source/HEL/AMD64/Platform.cxx
index a0c93ab5..a0c93ab5 100644
--- a/Private/NewBoot/Source/HEL/AMD64/Processor.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/Platform.cxx
diff --git a/Private/NewBoot/Source/makefile b/Private/NewBoot/Source/makefile
index 1fa6cc46..9ae30d13 100644
--- a/Private/NewBoot/Source/makefile
+++ b/Private/NewBoot/Source/makefile
@@ -8,6 +8,10 @@ LD_GNU=x86_64-w64-mingw32-ld
FLAG_GNU=-fshort-wchar -fPIC -D__DBG__ -DEFI_FUNCTION_WRAPPER -I../ -I../../ -I../../efiSDK/inc -I./ -c -ffreestanding -fno-rtti -fno-exceptions -std=c++20 -D__HAVE_HCORE_APIS__ -D__HCORE__ -I./ -I$(HOME)/
+.PHONY: invalid-recipe
+invalid-recipe:
+ @echo "invalid-recipe: Use make arch-<arch> all instead."
+
.PHONY: arch-amd64
arch-amd64:
$(CC_GNU) $(FLAG_GNU) HEL/AMD64/*.cxx
@@ -15,8 +19,8 @@ arch-amd64:
cp HCORELDR.EXE CDROM/EFI/BOOT/BOOTX64.EFI
cp -r ../../Root ./CDROM/MAHROUSS
-.PHONY: efi-debug
-efi-debug:
+.PHONY: run-efi-debug
+run-efi-debug:
wget https://retrage.github.io/edk2-nightly/bin/DEBUGX64_OVMF.fd -O OVMF.fd
qemu-system-x86_64 -bios OVMF.fd -net none -drive file=fat:rw:CDROM,format=raw -d int