From 8f6865d1f1b945aae1a7989798571de5382cf930 Mon Sep 17 00:00:00 2001 From: Robert Morris Date: Wed, 24 Jul 2019 10:15:45 -0400 Subject: [PATCH] display assembly instructions, to help with first.tex exercise --- .gdbinit.tmpl-riscv | 1 + kernel/trampoline.S | 1 + kernel/trap.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gdbinit.tmpl-riscv b/.gdbinit.tmpl-riscv index 8d461a1..452f04e 100644 --- a/.gdbinit.tmpl-riscv +++ b/.gdbinit.tmpl-riscv @@ -2,3 +2,4 @@ set confirm off set architecture riscv target remote 127.0.0.1:1234 symbol-file kernel/kernel +set disassemble-next-line auto diff --git a/kernel/trampoline.S b/kernel/trampoline.S index 1924de2..f067627 100644 --- a/kernel/trampoline.S +++ b/kernel/trampoline.S @@ -12,6 +12,7 @@ .section trampoline .globl trampout trampout: + # trampout(trapframe, pagetable) # switch from kernel to user. # usertrapret() calls here. # a0: p->tf in user page table diff --git a/kernel/trap.c b/kernel/trap.c index a41301a..ef2b618 100644 --- a/kernel/trap.c +++ b/kernel/trap.c @@ -117,7 +117,7 @@ usertrapret(void) // set S Exception Program Counter to the saved user pc. w_sepc(p->tf->epc); - // tell trampline.S the user page table to switch to. + // tell trampoline.S the user page table to switch to. uint64 satp = MAKE_SATP(p->pagetable); // jump to trampoline.S at the top of memory, which