From 3341e7a3a184b5bea17f0f678b40bc51c92d72a4 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 9 Mar 2015 17:04:04 +0100 Subject: Partial implement VFS pager (enough for ISO9660!) Also add some debugging facilities (especially stack trace). --- src/kernel/core/idt.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/kernel/core/idt.c') 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 :*/ -- cgit v1.2.3