Kernel: Add some helpful debug prints

Log RIP when stack pointer is out of bounds.

Log all syscalls that return ENOTSUP
This commit is contained in:
Bananymous 2024-01-03 02:08:01 +02:00
parent 001e95f973
commit b0ff2392a1
2 changed files with 4 additions and 0 deletions

View File

@ -189,6 +189,7 @@ namespace Kernel::IDT
else
{
derrorln("Stack pointer out of bounds!");
derrorln("rip {H}", interrupt_stack.rip);
derrorln("rsp {H}, stack {H}->{H}, istack {H}->{H}",
interrupt_stack.rsp,
stack.vaddr(), stack.vaddr() + stack.size(),

View File

@ -217,6 +217,9 @@ namespace Kernel
asm volatile("cli");
if (ret.is_error() && ret.error().get_error_code() == ENOTSUP)
dprintln("ENOTSUP {}", syscall);
if (ret.is_error() && ret.error().is_kernel_error())
Kernel::panic("Kernel error while returning to userspace {}", ret.error());