summaryrefslogtreecommitdiffhomepage
path: root/Private/HALKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-04 17:07:33 +0100
committerAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-04 17:07:33 +0100
commit9fe3b6e1e2447a11644307e83df2b109b24fe0d1 (patch)
treed6eafa0dee897572554d4519b1a9cd878591254c /Private/HALKit
parenta3d92ea68a74ef3cc3d3c9a34540754869e4d014 (diff)
HCR-11: Support for EFI GOP and SFP.
- SFP stands for Simple Filesystem Protocol, it's always reading through the ESP. - Add GOP for UI code. - Did also patch kernel Virtual Memory code. Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private/HALKit')
-rw-r--r--Private/HALKit/AMD64/HalPageAlloc.cpp4
-rw-r--r--Private/HALKit/AMD64/HalPageAlloc.hpp14
-rw-r--r--Private/HALKit/PowerPC/HalHardware.cxx2
3 files changed, 12 insertions, 8 deletions
diff --git a/Private/HALKit/AMD64/HalPageAlloc.cpp b/Private/HALKit/AMD64/HalPageAlloc.cpp
index 6d6e4ba5..d94d994d 100644
--- a/Private/HALKit/AMD64/HalPageAlloc.cpp
+++ b/Private/HALKit/AMD64/HalPageAlloc.cpp
@@ -54,8 +54,8 @@ auto hal_create_page(Boolean rw, Boolean user) -> UIntPtr {
return reinterpret_cast<UIntPtr>(new_pte);
}
-UIntPtr& hal_get_page_ptr() noexcept { return kPagePtr; }
+UIntPtr& hal_page_base() noexcept { return kPagePtr; }
-void hal_set_page_ptr(const UIntPtr& newPagePtr) noexcept { kPagePtr = newPagePtr; }
+void hal_page_base(const UIntPtr& newPagePtr) noexcept { kPagePtr = newPagePtr; }
} // namespace HAL
} // namespace HCore
diff --git a/Private/HALKit/AMD64/HalPageAlloc.hpp b/Private/HALKit/AMD64/HalPageAlloc.hpp
index 711dc27d..367cc26e 100644
--- a/Private/HALKit/AMD64/HalPageAlloc.hpp
+++ b/Private/HALKit/AMD64/HalPageAlloc.hpp
@@ -12,11 +12,11 @@
#include <NewKit/Defines.hpp>
#ifndef PTE_MAX
-#define PTE_MAX (512)
+#define PTE_MAX (0x200)
#endif //! PTE_MAX
#ifndef PTE_ALIGN
-#define PTE_ALIGN (4096)
+#define PTE_ALIGN (0x1000)
#endif //! PTE_ALIGN
extern "C" void flush_tlb(HCore::UIntPtr VirtualAddr);
@@ -41,8 +41,12 @@ struct PageTable64 {
bool ExecDisable : 1;
};
-PageTable64 *hal_alloc_page(SizeT sz, Boolean rw, Boolean user);
-UIntPtr& hal_get_page_ptr() noexcept;
-void hal_set_page_ptr(const UIntPtr& newPagePtr) noexcept;
+struct PageDirectory64 final {
+ PageTable64 ALIGN(PTE_ALIGN) Pte[PTE_MAX];
+};
+
+PageTable64* hal_alloc_page(SizeT sz, Boolean rw, Boolean user);
+UIntPtr& hal_page_base() noexcept;
+void hal_page_base(const UIntPtr& newPagePtr) noexcept;
UIntPtr hal_create_page(Boolean rw, Boolean user);
} // namespace HCore::HAL
diff --git a/Private/HALKit/PowerPC/HalHardware.cxx b/Private/HALKit/PowerPC/HalHardware.cxx
index 550d3747..89b1a6ae 100644
--- a/Private/HALKit/PowerPC/HalHardware.cxx
+++ b/Private/HALKit/PowerPC/HalHardware.cxx
@@ -33,7 +33,7 @@ void rt_hang_thread(HAL::StackFrame* stack) {}
// @brief main HAL entrypoint
void ke_init_hal() {}
-void ke_com_print(const char* bytes) {
+void ke_com_print(const Char* bytes) {
if (!bytes) return;
SizeT index = 0;