summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/HALKit/AMD64/Paging.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-05-15 13:56:17 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-05-15 13:56:17 +0200
commit6a30f42d5dcd0f944262147b2806db6c14fe7ffc (patch)
tree86d86a66df2941e49d1d332aaa1671c11db594e5 /dev/kernel/HALKit/AMD64/Paging.h
parentf8aaa274535b6541f376090958eedbbba3ba00ba (diff)
feat(kernel): Finalizing the first version of the user scheduler.
other: - Removed DmaPool into its own Kit. - ApplicationProcessor unit has been cleaned up. - Rename functions of MemoryMgr. - Use KIB instead of MIBs of stack. - Cleanup parts of the scheduler, and hw scheduler. - Use UD handler for INT 6. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/HALKit/AMD64/Paging.h')
-rw-r--r--dev/kernel/HALKit/AMD64/Paging.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/dev/kernel/HALKit/AMD64/Paging.h b/dev/kernel/HALKit/AMD64/Paging.h
index cfba232c..061bae45 100644
--- a/dev/kernel/HALKit/AMD64/Paging.h
+++ b/dev/kernel/HALKit/AMD64/Paging.h
@@ -63,6 +63,25 @@ auto mm_free_bitmap(VoidPtr page_ptr) -> Bool;
} // namespace Kernel::HAL
namespace Kernel {
-typedef VoidPtr PTE;
-typedef VoidPtr PDE;
+struct PTE {
+ UInt64 Present : 1;
+ UInt64 Wr : 1;
+ UInt64 User : 1;
+ UInt64 Pwt : 1; // Page-level Write-Through
+ UInt64 Pcd : 1; // Page-level Cache Disable
+ UInt64 Accessed : 1;
+ UInt64 Dirty : 1;
+ UInt64 Pat : 1; // Page Attribute Table (or PS for PDE)
+ UInt64 Global : 1;
+ UInt64 Ignored1 : 3; // Available to software
+ UInt64 PhysicalAddress : 40; // Physical page frame address (bits 12–51)
+ UInt64 Ignored2 : 7; // More software bits / reserved
+ UInt64 ProtectionKey : 4; // Optional (if PKU enabled)
+ UInt64 Reserved : 1; // Usually reserved
+ UInt64 Nx : 1; // No Execute
+};
+
+struct PDE {
+ ATTRIBUTE(aligned(kib_cast(4))) PTE fPTE[512];
+};
} // namespace Kernel