Refactor MMU for multi-paging support and add 5-Level paging #16

已合并
harraiken 2025-08-23 20:03:56 +02:00 将 35 次代码提交从 harraiken_mm合并至 master
共有 2 个文件被更改,包括 14 次插入0 次删除
仅显示提交 720d525b95 的更改 - 显示所有提交

查看文件

@@ -4,6 +4,7 @@
* FILE: xtoskrnl/mm/amd64/init.c * FILE: xtoskrnl/mm/amd64/init.c
* DESCRIPTION: Architecture specific Memory Manager initialization routines * DESCRIPTION: Architecture specific Memory Manager initialization routines
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org> * DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
* Aiken Harris <harraiken91@gmail.com>
*/ */
#include <xtos.h> #include <xtos.h>
@@ -23,6 +24,9 @@ MmInitializePageMapSupport(VOID)
/* Check if XPA is enabled */ /* Check if XPA is enabled */
if(MmpGetExtendedPhysicalAddressingStatus()) if(MmpGetExtendedPhysicalAddressingStatus())
{ {
/* XPA enabled, use LA57 paging (PML5) */
MmpPageMapRoutines = &MmpPml5Routines;
/* Set PML5 page map information */ /* Set PML5 page map information */
MmpPageMapInfo.Xpa = TRUE; MmpPageMapInfo.Xpa = TRUE;
@@ -35,6 +39,9 @@ MmInitializePageMapSupport(VOID)
} }
else else
{ {
/* XPA disabled, use LA48 paging (PML4) */
MmpPageMapRoutines = &MmpPml4Routines;
/* Set PML4 page map information */ /* Set PML4 page map information */
MmpPageMapInfo.Xpa = FALSE; MmpPageMapInfo.Xpa = FALSE;

查看文件

@@ -4,6 +4,7 @@
* FILE: xtoskrnl/mm/i686/init.c * FILE: xtoskrnl/mm/i686/init.c
* DESCRIPTION: Architecture specific Memory Manager initialization routines * DESCRIPTION: Architecture specific Memory Manager initialization routines
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org> * DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
* Aiken Harris <harraiken91@gmail.com>
*/ */
#include <xtos.h> #include <xtos.h>
@@ -23,6 +24,9 @@ MmInitializePageMapSupport(VOID)
/* Check if XPA is enabled */ /* Check if XPA is enabled */
if(MmpGetExtendedPhysicalAddressingStatus()) if(MmpGetExtendedPhysicalAddressingStatus())
{ {
/* XPA enabled, use modern PAE paging (PML3) */
MmpPageMapRoutines = &MmpPml3Routines;
/* Set PML3 page map information */ /* Set PML3 page map information */
MmpPageMapInfo.Xpa = TRUE; MmpPageMapInfo.Xpa = TRUE;
@@ -36,6 +40,9 @@ MmInitializePageMapSupport(VOID)
} }
else else
{ {
/* XPA disabled, use legacy i386 paging (PML2) */
MmpPageMapRoutines = &MmpPml2Routines;
/* Set PML2 page map information */ /* Set PML2 page map information */
MmpPageMapInfo.Xpa = FALSE; MmpPageMapInfo.Xpa = FALSE;