summaryrefslogtreecommitdiffhomepage
path: root/Boot/Sources/HEL
diff options
context:
space:
mode:
authorAmlal <amlal@zka.com>2024-07-18 09:43:27 +0200
committerAmlal <amlal@zka.com>2024-07-18 09:43:27 +0200
commit384300904e6cf9187e5e4c4d9a8fad740592cacb (patch)
treef0a0f196f32f5a224ca529ad7d4e99dd6a95586e /Boot/Sources/HEL
parente9b8d8f68bdd79907feeed9e87572ba562c213e9 (diff)
[IMP] BootJump has been fixed, LoaderUtils API for CFKit. (Kernel's CoreFoundation like API)
[IMP] Add Write for UChar* types. (BTextWriter) Signed-off-by: Amlal <amlal@zka.com>
Diffstat (limited to 'Boot/Sources/HEL')
-rw-r--r--Boot/Sources/HEL/AMD64/BootJump.S11
-rw-r--r--Boot/Sources/HEL/AMD64/BootMain.cxx14
-rw-r--r--Boot/Sources/HEL/AMD64/BootTextWriter.cxx30
3 files changed, 43 insertions, 12 deletions
diff --git a/Boot/Sources/HEL/AMD64/BootJump.S b/Boot/Sources/HEL/AMD64/BootJump.S
index e807ab52..fc7b3c68 100644
--- a/Boot/Sources/HEL/AMD64/BootJump.S
+++ b/Boot/Sources/HEL/AMD64/BootJump.S
@@ -8,11 +8,12 @@
@brief this function setups a stack and then jumps to
a function */
rt_jump_to_address:
- mov rdx, rsp
- mov rdi, rcx
- mov rdx, rbp
+ mov r8, rsp
+
push rax
- mov r8, rcx
- call rdi
+ push rdx
+ jmp rcx
+ pop rdx
pop rax
+
ret
diff --git a/Boot/Sources/HEL/AMD64/BootMain.cxx b/Boot/Sources/HEL/AMD64/BootMain.cxx
index 51f8e8cf..8946aadc 100644
--- a/Boot/Sources/HEL/AMD64/BootMain.cxx
+++ b/Boot/Sources/HEL/AMD64/BootMain.cxx
@@ -13,7 +13,7 @@
#include <FirmwareKit/Handover.hxx>
#include <KernelKit/MSDOS.hxx>
#include <KernelKit/PE.hxx>
-#include <KernelKit/PEF.hpp>
+#include <KernelKit/PEF.hxx>
#include <NewKit/Macros.hpp>
#include <NewKit/Ref.hpp>
#include <BootKit/ProgramLoader.hxx>
@@ -121,8 +121,8 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle,
vendorTable[4] == 'P' && vendorTable[5] == 'T' &&
vendorTable[6] == 'R' && vendorTable[7] == ' ')
{
- writer.Write(L"newosldr: filling rsdptr...\r");
- handoverHdrPtr->f_HardwareTables.f_RsdPtr = (VoidPtr)vendorTable;
+ writer.Write(L"newosldr: Filling rsdptr...\r");
+ handoverHdrPtr->f_HardwareTables.f_VendorPtr = (VoidPtr)vendorTable;
break;
}
@@ -149,8 +149,8 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle,
kHandoverHeader = handoverHdrPtr;
- // check if we are in AMD64
-#if defined(__NEWOS_AMD64__)
+ // check if we are running in the PC platform. If so abort.
+#if defined(__NEWOS_AMD64__) && !defined(__DEBUG__)
writer.Write(L"\rnewosldr: AMD64 support is not official.\r");
EFI::ThrowError(L"Beta-Software", L"Beta Software.");
#endif
@@ -244,10 +244,10 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle,
#ifdef __NEWOS_OTA__
if (loader)
loader->Start(handoverHdrPtr);
+#else
+ hal_init_platform(handoverHdrPtr);
#endif // ifdef __NEWOS_OTA__
- hal_init_platform(handoverHdrPtr);
-
EFI::Stop();
CANT_REACH();
diff --git a/Boot/Sources/HEL/AMD64/BootTextWriter.cxx b/Boot/Sources/HEL/AMD64/BootTextWriter.cxx
index 18f32bd8..7b0ab50c 100644
--- a/Boot/Sources/HEL/AMD64/BootTextWriter.cxx
+++ b/Boot/Sources/HEL/AMD64/BootTextWriter.cxx
@@ -85,6 +85,36 @@ BTextWriter& BTextWriter::Write(const Char* str)
return *this;
}
+BTextWriter& BTextWriter::Write(const UChar* str)
+{
+#ifdef __DEBUG__
+ if (!str || *str == 0)
+ return *this;
+
+ CharacterTypeUTF16 strTmp[2];
+ strTmp[1] = 0;
+
+ for (size_t i = 0; str[i] != 0; i++)
+ {
+ if (str[i] == '\r')
+ {
+ strTmp[0] = str[i];
+ ST->ConOut->OutputString(ST->ConOut, strTmp);
+
+ strTmp[0] = '\n';
+ ST->ConOut->OutputString(ST->ConOut, strTmp);
+ }
+ else
+ {
+ strTmp[0] = str[i];
+ ST->ConOut->OutputString(ST->ConOut, strTmp);
+ }
+ }
+#endif // ifdef __DEBUG__
+
+ return *this;
+}
+
/**
@brief putc wrapper over EFI ConOut.
*/