From 0228cd4f31f3304090a4ce44fc4eb86f58acd0ac Mon Sep 17 00:00:00 2001 From: Bananymous Date: Thu, 14 Nov 2024 21:03:04 +0200 Subject: [PATCH] Kernel: Increase userspace stack size and decrease kernel stack Quake II needs a lot of stack, it was overflowing my 256 KiB stack so this patch doubles that, so Quake II can run! Also every thread had 256 KiB kernel stack. This is unnecessarily large and now dropped to 32 KiB. --- kernel/include/kernel/Thread.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/include/kernel/Thread.h b/kernel/include/kernel/Thread.h index 921b56eb27..af38dcc1d3 100644 --- a/kernel/include/kernel/Thread.h +++ b/kernel/include/kernel/Thread.h @@ -103,8 +103,8 @@ namespace Kernel // {kernel,userspace}_stack has to be destroyed before page table BAN::UniqPtr m_keep_alive_page_table; - static constexpr size_t m_kernel_stack_size { PAGE_SIZE * 64 }; - static constexpr size_t m_userspace_stack_size { PAGE_SIZE * 64 }; + static constexpr size_t m_kernel_stack_size { PAGE_SIZE * 8 }; + static constexpr size_t m_userspace_stack_size { PAGE_SIZE * 128 }; BAN::UniqPtr m_kernel_stack; BAN::UniqPtr m_userspace_stack; const pid_t m_tid { 0 };