From 800977c96cd64b3beeccaa7d373daed3987b1c2a Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 2 Feb 2024 14:26:01 +0100 Subject: Kernel: Improvements and fixes regarding the VMMers and assembly code. Signed-off-by: Amlal El Mahrouss --- Private/HALKit/AMD64/HalPageAlloc.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Private/HALKit/AMD64/HalPageAlloc.cpp') diff --git a/Private/HALKit/AMD64/HalPageAlloc.cpp b/Private/HALKit/AMD64/HalPageAlloc.cpp index 86631e57..6d6e4ba5 100644 --- a/Private/HALKit/AMD64/HalPageAlloc.cpp +++ b/Private/HALKit/AMD64/HalPageAlloc.cpp @@ -8,12 +8,12 @@ */ #include -#include #include +#include // this files handles paging. -static HCore::UIntPtr kPagePtr = kPagePtrAddress; +static HCore::UIntPtr kPagePtr = 0; static HCore::SizeT kPageCnt = 0UL; namespace HCore { @@ -23,6 +23,7 @@ static auto hal_try_alloc_new_page(SizeT sz, Boolean rw, Boolean user) char *ptr = &(reinterpret_cast(kPagePtr))[kPageCnt + 1]; PageTable64 *pte = reinterpret_cast(ptr); + pte->Rw = rw; pte->User = user; pte->Present = true; @@ -52,5 +53,9 @@ auto hal_create_page(Boolean rw, Boolean user) -> UIntPtr { return reinterpret_cast(new_pte); } + +UIntPtr& hal_get_page_ptr() noexcept { return kPagePtr; } + +void hal_set_page_ptr(const UIntPtr& newPagePtr) noexcept { kPagePtr = newPagePtr; } } // namespace HAL } // namespace HCore -- cgit v1.2.3