summaryrefslogtreecommitdiffhomepage
path: root/dev/ZKA/Sources
diff options
context:
space:
mode:
authorAmlal <amlal@el-mahrouss-logic.com>2024-09-09 17:33:20 +0200
committerAmlal <amlal@el-mahrouss-logic.com>2024-09-09 18:48:14 +0200
commit8712d6a95984805e242f1189a5a76db2fbd5d39f (patch)
tree178786a83106351560e45b7b47196b646e063708 /dev/ZKA/Sources
parent6dbc74799f465eec249e2d8f01a472d0dd3b33c8 (diff)
FIX: Kernel related, see below.
- Allocate space for heap header as well. - Don't forget to turn user bit off, and turn present off when dealing with virtual memory. Signed-off-by: Amlal <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'dev/ZKA/Sources')
-rw-r--r--dev/ZKA/Sources/Heap.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/dev/ZKA/Sources/Heap.cxx b/dev/ZKA/Sources/Heap.cxx
index 1f9af6a2..cd46a80b 100644
--- a/dev/ZKA/Sources/Heap.cxx
+++ b/dev/ZKA/Sources/Heap.cxx
@@ -94,18 +94,20 @@ namespace Kernel
{
Detail::mm_alloc_init_timeout();
- auto szFix = sz;
+ auto sz_fix = sz;
- if (szFix == 0)
+ if (sz_fix == 0)
return nullptr;
- auto wrapper = kHeapPageMgr.Request(rw, user, No, szFix);
+ sz_fix += sizeof(Detail::HEAP_INFORMATION_BLOCK);
+
+ auto wrapper = kHeapPageMgr.Request(rw, user, No, sz_fix);
Detail::HEAP_INFORMATION_BLOCK_PTR heap_info_ptr =
reinterpret_cast<Detail::HEAP_INFORMATION_BLOCK_PTR>(
wrapper.VirtualAddress() + sizeof(Detail::HEAP_INFORMATION_BLOCK));
- heap_info_ptr->fHeapSize = szFix;
+ heap_info_ptr->fHeapSize = sz_fix;
heap_info_ptr->fMagic = kKernelHeapMagic;
heap_info_ptr->fCRC32 = No; // dont fill it for now.
heap_info_ptr->fHeapPtr = reinterpret_cast<UIntPtr>(heap_info_ptr) + sizeof(Detail::HEAP_INFORMATION_BLOCK);