aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/core/idt.c
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2015-03-09 17:04:04 +0100
committerAlex Auvolat <alex@adnab.me>2015-03-09 17:04:04 +0100
commit3341e7a3a184b5bea17f0f678b40bc51c92d72a4 (patch)
treec77a940a371148b256676f7b59caaecc725a1f1d /src/kernel/core/idt.c
parent436418e575b68fd7e85f7fdaf039e03874ec1cb9 (diff)
downloadkogata-3341e7a3a184b5bea17f0f678b40bc51c92d72a4.tar.gz
kogata-3341e7a3a184b5bea17f0f678b40bc51c92d72a4.zip
Partial implement VFS pager (enough for ISO9660!)
Also add some debugging facilities (especially stack trace).
Diffstat (limited to 'src/kernel/core/idt.c')
-rw-r--r--src/kernel/core/idt.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/kernel/core/idt.c b/src/kernel/core/idt.c
index 6bfe8b5..eef3ca6 100644
--- a/src/kernel/core/idt.c
+++ b/src/kernel/core/idt.c
@@ -275,7 +275,19 @@ void dbg_dump_registers(registers_t *regs) {
dbg_printf("| EAX: 0x%p EBX: 0x%p ECX: 0x%p EDX: 0x%p\n", regs->eax, regs->ebx, regs->ecx, regs->edx);
dbg_printf("| EDI: 0x%p ESI: 0x%p ESP: 0x%p EBP: 0x%p\n", regs->edi, regs->esi, regs->esp, regs->ebp);
dbg_printf("| EIP: 0x%p CS : 0x%p DS : 0x%p SS : 0x%p\n", regs->eip, regs->cs, regs->ds, regs->ss);
- dbg_printf("\\ EFl: 0x%p I# : 0x%p Err: 0x%p\n", regs->eflags, regs->int_no, regs->err_code);
+ dbg_printf("| EFl: 0x%p I# : 0x%p Err: 0x%p\n", regs->eflags, regs->int_no, regs->err_code);
+ dbg_printf("- Stack trace:\n");
+
+ uint32_t ebp = regs->ebp, eip = regs->eip;
+ int i = 0;
+ while (ebp >= K_HIGHHALF_ADDR && eip >= K_HIGHHALF_ADDR && i++ < 10) {
+ dbg_printf("| 0x%p EIP: 0x%p\n", ebp, eip);
+ uint32_t *d = (uint32_t*)ebp;
+ ebp = d[0];
+ eip = d[1];
+ }
+
+ dbg_printf("\\\n");
}
/* vim: set ts=4 sw=4 tw=0 noet :*/