From 868213bb85aa8283c2b7b5cf2e2ae6c868bddab3 Mon Sep 17 00:00:00 2001 From: apio Date: Sat, 24 Jun 2023 22:25:18 +0200 Subject: [PATCH] kernel: Preserve the new page directory while exec() is running --- kernel/src/thread/Scheduler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/src/thread/Scheduler.cpp b/kernel/src/thread/Scheduler.cpp index 090e6ca9..e2ac9197 100644 --- a/kernel/src/thread/Scheduler.cpp +++ b/kernel/src/thread/Scheduler.cpp @@ -235,7 +235,7 @@ namespace Scheduler { switch_context(old_thread, new_thread, regs); if (!old_thread->is_kernel) old_thread->fp_data.save(); - if (old_thread->is_kernel && MMU::get_page_directory() != MMU::kernel_page_directory()) + if (MMU::get_page_directory() != MMU::kernel_page_directory()) old_thread->directory = MMU::get_page_directory(); if (new_thread->directory) MMU::switch_page_directory(new_thread->directory); if (!new_thread->is_kernel)