Improve processes kernel stack - #126
Open
Amjad50 wants to merge 2 commits into
Open
Conversation
This will allow us to modify TSS next, which is useful in managing user space kernel stacks Signed-off-by: Amjad Alsharafi <26300843+Amjad50@users.noreply.github.com>
Previously each process had its own isolated process-specific kernel stack space that was VM-switched on process context switches. This approach had limitations when processes needed to be switched from kernel mode. This commit changes the architecture to use shared kernel stacks that are mapped to all processes but allocated per-process from a pool. Key changes: - Replace per-process VM-specific kernel stacks with shared pool approach - Add `ProcessKernelStack` allocator with bitmap-based management - Move kernel stack allocation from VM switching to process creation - Update TSS to load process-specific kernel stack on context switch - This supports 32768 concurrent processes kernel stacks (number is too large, just used it to fit into 4096 u8 array XD) Benefits: - Allows safer process switching from kernel mode contexts - Reduces VM switching complexity for kernel stack management Signed-off-by: Amjad Alsharafi <26300843+Amjad50@users.noreply.github.com>
Amjad50
force-pushed
the
improve-user-kernel-stack
branch
from
July 29, 2025 10:50
2ee4016 to
20d8820
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Related issue
Changes
Checklist