Kernel: Make userspace stack on-demand allocated

Also bump the hardlimit of stack size from 512 KiB->32 MiB. This still
feels quite low but is much better than before :D
This commit is contained in:
2025-08-07 02:49:02 +03:00
parent f5bbcc017c
commit 72f85dce2b
3 changed files with 14 additions and 4 deletions

View File

@@ -35,7 +35,9 @@ namespace Kernel
// FIXME: kernel stack does NOT have to be this big, but my recursive AML interpreter
// stack overflows on some machines with 8 page stack
static constexpr size_t kernel_stack_size { PAGE_SIZE * 16 };
static constexpr size_t userspace_stack_size { PAGE_SIZE * 128 };
// TODO: userspace stack is hard limited to 32 MiB, maybe make this dynamic?
static constexpr size_t userspace_stack_size { 32 << 20 };
public:
static BAN::ErrorOr<Thread*> create_kernel(entry_t, void*);