diff options
author | Marvin Borner | 2021-02-25 23:32:18 +0100 |
---|---|---|
committer | Marvin Borner | 2021-02-25 23:32:18 +0100 |
commit | dec16faf32e75d613e20cac175b8a0c2d3612b94 (patch) | |
tree | 756d1ce3cf07cfe7da80702d96f9ec9e6585dceb /kernel/drivers | |
parent | c258de9038d113cafcc8e290f7f70bbc2f1cb50d (diff) |
Added some debugging features
I've tried to track down the bugs with kvm and q35 but I didn't manage
to do it - yet!
I'll probably look into it soon.
Diffstat (limited to 'kernel/drivers')
-rw-r--r-- | kernel/drivers/interrupts.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/drivers/interrupts.c b/kernel/drivers/interrupts.c index 268bff5..fa455d7 100644 --- a/kernel/drivers/interrupts.c +++ b/kernel/drivers/interrupts.c @@ -173,12 +173,15 @@ void isr_handler(struct regs *r); void isr_handler(struct regs *r) { if (r->int_no <= 32) { - printf("%s Exception, exiting!\n", isr_exceptions[r->int_no]); struct proc *proc = proc_current(); - if (proc) + printf("%s Exception at 0x%x, exiting!\n", isr_exceptions[r->int_no], r->eip); + if (proc) { + printf("\t-> Exception occurred in %s at addr 0x%x\n", proc->name, + r->eip - proc->entry); proc_exit(proc, 1); - else + } else { __asm__ volatile("cli\nhlt"); + } proc_yield(r); } else { // Execute fault handler if exists |