diff --git a/include/mm/mm.h b/include/mm/mm.h index 2ef7185..8bd9238 100644 --- a/include/mm/mm.h +++ b/include/mm/mm.h @@ -174,6 +174,21 @@ void *MmGetStackGuards(char rank); // void *MmTranslateKPageToAddr(void *rank); +// Page directory pointer offset +typedef ulong pdpe_t; + +// Page directory offset +typedef ulong pde_t; + +// Page table entry +typedef ulong pte_t; + +// paging.asm +void MmLoadPML4(void *); +void MmEnableWriteProtect(void); +void MmDisableWriteProtect(void); +void *MmGetStackGuards(char rank); + //----------------------------------------------------------------------------// #endif diff --git a/kaleid/kernel/ke/pit.c b/kaleid/kernel/ke/pit.c index 211f9e3..3dbe895 100644 --- a/kaleid/kernel/ke/pit.c +++ b/kaleid/kernel/ke/pit.c @@ -1,7 +1,7 @@ //----------------------------------------------------------------------------// // GNU GPL OS/K // // // -// Desc: RTC Time related functions // +// Desc: PIT Time related functions // // // // // // Copyright © 2018-2019 The OS/K Team // diff --git a/kaleid/kernel/mm/paging.c b/kaleid/kernel/mm/paging.c index 4975b23..7b9a93c 100644 --- a/kaleid/kernel/mm/paging.c +++ b/kaleid/kernel/mm/paging.c @@ -6,22 +6,6 @@ #include #include - -// Page directory pointer offset -typedef ulong pdpe_t; - -// Page directory offset -typedef ulong pde_t; - -// Page table entry -typedef ulong pte_t; - -// paging.asm -void MmLoadPML4(void *); -void MmEnableWriteProtect(void); -void MmDisableWriteProtect(void); -void *MmGetStackGuards(char rank); - enum { MF_PRESENT = 1 << 0, @@ -199,6 +183,7 @@ static void PagingHandler(ISRFrame_t *regs) StackGuardOne ); } else { + //XXX page fault bprintf(BStdOut, "\n\n%CPANIC\n[ISR 0x%x] Irrecoverable Kernel Page Fault at %p\n\n" " Error code : 0x%x (%b)", @@ -220,4 +205,5 @@ static void PagingHandler(ISRFrame_t *regs) void MmActivatePageHandler(void) { KeRegisterISR(PagingHandler, 0xe); + DebugLog("\tPaging activated\n"); }