From 50cbc7510250a64674d619d13f5912edf08b767d Mon Sep 17 00:00:00 2001 From: Robert Morris Date: Sat, 1 Jun 2019 05:33:38 -0400 Subject: first shell prints $ prompt, though no console input yet --- trap.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'trap.c') diff --git a/trap.c b/trap.c index 6d4854e..74f3456 100644 --- a/trap.c +++ b/trap.c @@ -9,7 +9,7 @@ struct spinlock tickslock; uint ticks; -extern char trampstart[], trampvec[]; +extern char trampout[], trampin[]; void kerneltrap(); @@ -53,6 +53,7 @@ usertrap(void) syscall(); } else { printf("usertrap(): unexpected scause 0x%x pid=%d\n", r_scause(), p->pid); + printf(" sepc=%p stval=%p\n", r_sepc(), r_stval()); panic("usertrap"); } @@ -71,7 +72,7 @@ usertrapret(void) // now from kerneltrap() to usertrap(). // send interrupts and exceptions to trampoline.S - w_stvec(TRAMPOLINE + (trampvec - trampstart)); + w_stvec(TRAMPOLINE + (trampin - trampout)); // set up values that trampoline.S will need when // the process next re-enters the kernel. @@ -108,5 +109,8 @@ kerneltrap() if((r_sstatus() & SSTATUS_SPP) == 0) panic("kerneltrap: not from supervisor mode"); + printf("scause 0x%x\n", r_scause()); + printf("sepc=%p stval=%p\n", r_sepc(), r_stval()); + panic("kerneltrap"); } -- cgit v1.2.3