mirror of
https://github.com/hexagonal-sun/moss-kernel.git
synced 2026-01-30 09:01:44 -05:00
Currently, when a kernel stack overflow occures, the exception handler blindly attempts to write the current context to the stack. If the SP isn't valid this causes another fault, and so on - locking up the system. This commit re-arranges the stack layout, performs SP validation before usage and switches to an emergency stack when SP isn't valid. This allows the handler to run and panic gracefully. Fixes: #98