diff --git a/ioapic.c b/ioapic.c
index 5120b23a3835026e3fcd68efb0433fdf668d82bd..c96c4f78ab7d1d85ef103cc06b7e3f568d968f0b 100644
--- a/ioapic.c
+++ b/ioapic.c
@@ -46,7 +46,7 @@ ioapic_init(void)
   for (i = 0; i < nintr; i++) {
     // active-hi and edge-triggered for ISA interrupts
     // Assume that pin 0 on the first I/O APIC is an ExtINT pin.
-    // Assume that pins 1-15 are ISA interrupts and that all
+    // Assume that pins 1-15 are ISA interrupts
     l = ioapic_read(io, IOAPIC_REDTBL_LO(i));
     l = l & ~IOART_INTMASK;  // allow INTs
     l |= IOART_INTMSET;
@@ -59,7 +59,6 @@ ioapic_init(void)
     h = ioapic_read(io, IOAPIC_REDTBL_HI(i));
     h &= ~IOART_DEST;
     ioapic_write(io, IOAPIC_REDTBL_HI(i), h);
-    //    cprintf("intr %d: lo 0x%x hi 0x%x\n", i, l, h);
   }
 }
 
diff --git a/trap.c b/trap.c
index ef40f7e49525dc29cf2aa0c7fb0f23c9b63140ef..bbb2500334cb8df9d1d37953ace5b4c7d49d101e 100644
--- a/trap.c
+++ b/trap.c
@@ -79,12 +79,16 @@ trap(struct trapframe *tf)
     return;
   }
 
-  cprintf("trap %d from cpu %d eip %x\n", v, cpu(), tf->eip);
+  if(v == (IRQ_OFFSET + IRQ_SPURIOUS)){
+    cprintf("spurious interrupt from cpu %d eip %x\n", cpu(), tf->eip);
+    return;  // no eoi for this one.
+  }
+
   if(curproc[cpu()]) {
-    cprintf("pid %d\n", curproc[cpu()]->pid);
+    cprintf("pid %d: unhandled trap %d on cpu %d eip %x---terminate process\n", 
+	    curproc[cpu()]->pid, v, cpu(), tf->eip);
     proc_exit();
   }
-  //  panic("trap");
-
-  return;
+  cprintf("unexpected trap %d from cpu %d eip %x\n", v, cpu(), tf->eip);
+  panic("trap");
 }
diff --git a/userfs.c b/userfs.c
index 47add52082847560ca738d540034eb90e8690adb..6fe62d663f5ab8117cf7feab989554ad8688b277 100644
--- a/userfs.c
+++ b/userfs.c
@@ -200,7 +200,6 @@ int
 main(void)
 {
   printf(stdout, "userfs is running\n");
-
   opentest();
   writetest();
   writetest1();