summaryrefslogtreecommitdiff
path: root/trap.c
diff options
context:
space:
mode:
authorFrans Kaashoek <[email protected]>2010-07-02 14:51:53 -0400
committerFrans Kaashoek <[email protected]>2010-07-02 14:51:53 -0400
commit40889627ba50db29a64bc6a1553c2b21e6a99b78 (patch)
tree7cb8f51492af706cafdcaf1b01a5cac8073d5a38 /trap.c
parentb7a517f2277670e156f150ee2cb7aae6426c6aef (diff)
downloadxv6-labs-40889627ba50db29a64bc6a1553c2b21e6a99b78.tar.gz
xv6-labs-40889627ba50db29a64bc6a1553c2b21e6a99b78.tar.bz2
xv6-labs-40889627ba50db29a64bc6a1553c2b21e6a99b78.zip
Initial version of single-cpu xv6 with page tables
Diffstat (limited to 'trap.c')
-rw-r--r--trap.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/trap.c b/trap.c
index 86ce052..1f35708 100644
--- a/trap.c
+++ b/trap.c
@@ -78,13 +78,14 @@ trap(struct trapframe *tf)
default:
if(proc == 0 || (tf->cs&3) == 0){
// In kernel, it must be our mistake.
- cprintf("unexpected trap %d from cpu %d eip %x\n",
- tf->trapno, cpu->id, tf->eip);
+ cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n",
+ tf->trapno, cpu->id, tf->eip, rcr2());
panic("trap");
}
// In user space, assume process misbehaved.
- cprintf("pid %d %s: trap %d err %d on cpu %d eip %x -- kill proc\n",
- proc->pid, proc->name, tf->trapno, tf->err, cpu->id, tf->eip);
+ cprintf("pid %d %s: trap %d err %d on cpu %d eip 0x%x addr 0x%x--kill proc\n",
+ proc->pid, proc->name, tf->trapno, tf->err, cpu->id, tf->eip,
+ rcr2());
proc->killed = 1;
}