From 70cbbea3c0351e76807e65fdb8efade206eb9df5 Mon Sep 17 00:00:00 2001 From: EnderIce2 Date: Thu, 21 Mar 2024 02:08:18 +0200 Subject: [PATCH] Clear CR2 if the page fault is handled --- core/panic/user.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/core/panic/user.cpp b/core/panic/user.cpp index 798ed87d..3f525fbd 100644 --- a/core/panic/user.cpp +++ b/core/panic/user.cpp @@ -164,6 +164,7 @@ nsa bool UserModeExceptionHandler(CPU::ExceptionFrame *Frame) if (Handled) { debug("Page fault handled"); + Frame->cr2 = 0; thread->SetState(Tasking::Ready); return true; }