From 1a844fe4332313983e86efd1f3e41f8a7f73c465 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 15 Mar 2024 10:40:40 +0100 Subject: Kernel: Update README and fix MUST_PASS in hal_try_alloc_new_page. Signed-off-by: Amlal El Mahrouss --- Private/Drivers/README.TXT | 14 ++++++++++---- Private/HALKit/AMD64/HalPageAlloc.cpp | 7 ++++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Private/Drivers/README.TXT b/Private/Drivers/README.TXT index d26f409b..e6af72bc 100644 --- a/Private/Drivers/README.TXT +++ b/Private/Drivers/README.TXT @@ -6,10 +6,16 @@ Basic Device Drivers (BDD) 2 - Place them inside Private/Root 3 - And continue your build. - -==================== +=============== What are these? -==================== +=============== These are HCore device drivers. -Running in Ring-3. To let the driver restart in case of a crash. +Some of them are running in Ring-3, to let the driver restart in case of a crash. + +=========== +Maintainers +=========== + +ACPIManager: Amlal EL Mahrouss +AHCI: Amlal EL Mahrouss \ No newline at end of file diff --git a/Private/HALKit/AMD64/HalPageAlloc.cpp b/Private/HALKit/AMD64/HalPageAlloc.cpp index a52eb646..599810f3 100644 --- a/Private/HALKit/AMD64/HalPageAlloc.cpp +++ b/Private/HALKit/AMD64/HalPageAlloc.cpp @@ -11,15 +11,15 @@ // this files handles paging. -static HCore::SizeT kPageCnt = 0UL; +STATIC HCore::SizeT kPageCnt = 0UL; -#define kKernelPagingPadding 4096 +#define kKernelPagingPadding (4096) namespace HCore { namespace HAL { static auto hal_try_alloc_new_page(SizeT sz, Boolean rw, Boolean user) -> PageTable64 * { - MUST_PASS(sz != 0); + MUST_PASS(sz > 0); PageTable64 *pte = &reinterpret_cast((UIntPtr)kKernelVirtualStart)->Pte[0]; @@ -32,6 +32,7 @@ static auto hal_try_alloc_new_page(SizeT sz, Boolean rw, Boolean user) kKernelVirtualStart = (VoidPtr)((UIntPtr)kKernelVirtualStart + kPageCnt + sz + kKernelPagingPadding); + return pte; } -- cgit v1.2.3