Support config driven debugging of each irq handler.

This allows one to easily enable verbose output from handlers.
diff --git a/src/boot.c b/src/boot.c
index 336d869..09d28e8 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -200,7 +200,7 @@
 void VISIBLE16
 handle_18()
 {
-    debug_enter(NULL);
+    debug_enter(NULL, DEBUG_HDL_18);
     u16 seq = GET_EBDA(ipl.sequence) + 1;
     do_boot(seq);
 }
@@ -209,6 +209,6 @@
 void VISIBLE16
 handle_19()
 {
-    debug_enter(NULL);
+    debug_enter(NULL, DEBUG_HDL_19);
     do_boot(0);
 }
diff --git a/src/clock.c b/src/clock.c
index aef1be8..5bf4642 100644
--- a/src/clock.c
+++ b/src/clock.c
@@ -276,7 +276,7 @@
 void VISIBLE16
 handle_1a(struct bregs *regs)
 {
-    //debug_enter(regs);
+    debug_enter(regs, DEBUG_HDL_1a);
     switch (regs->ah) {
     case 0x00: handle_1a00(regs); break;
     case 0x01: handle_1a01(regs); break;
@@ -295,14 +295,14 @@
 void VISIBLE16
 handle_1c()
 {
-    //debug_enter(regs);
+    debug_isr(DEBUG_ISR_1c);
 }
 
 // INT 08h System Timer ISR Entry Point
 void VISIBLE16
 handle_08()
 {
-    //debug_isr();
+    debug_isr(DEBUG_ISR_08);
     irq_enable();
 
     floppy_tick();
@@ -448,7 +448,7 @@
 void VISIBLE16
 handle_70()
 {
-    //debug_isr();
+    debug_isr(DEBUG_ISR_70);
 
     // Check which modes are enabled and have occurred.
     u8 registerB = inb_cmos(CMOS_STATUS_B);
diff --git a/src/config.h b/src/config.h
index 1f2a6b5..3f5782f 100644
--- a/src/config.h
+++ b/src/config.h
@@ -69,4 +69,30 @@
 // Start of fixed addresses in 0xf0000 segment.
 #define BUILD_START_FIXED       0xe050
 
+// Debugging levels.  If non-zero and CONFIG_DEBUG_LEVEL is greater
+// than the specified value, then the corresponding irq handler will
+// report every enter event.
+#define DEBUG_HDL_05 1
+#define DEBUG_HDL_10 1
+#define DEBUG_HDL_11 1
+#define DEBUG_HDL_12 1
+#define DEBUG_HDL_15 9
+#define DEBUG_ISR_nmi 1
+#define DEBUG_ISR_75 1
+#define DEBUG_HDL_16 9
+#define DEBUG_ISR_09 9
+#define DEBUG_HDL_18 1
+#define DEBUG_HDL_19 1
+#define DEBUG_HDL_1a 9
+#define DEBUG_ISR_1c 9
+#define DEBUG_ISR_08 9
+#define DEBUG_ISR_70 9
+#define DEBUG_HDL_40 1
+#define DEBUG_HDL_13 9
+#define DEBUG_ISR_76 9
+#define DEBUG_HDL_14 1
+#define DEBUG_HDL_17 1
+#define DEBUG_ISR_74 9
+#define DEBUG_ISR_0e 9
+
 #endif // config.h
diff --git a/src/disk.c b/src/disk.c
index f96342d..c45d6ad 100644
--- a/src/disk.c
+++ b/src/disk.c
@@ -644,7 +644,7 @@
 void VISIBLE16
 handle_40(struct bregs *regs)
 {
-    debug_enter(regs);
+    debug_enter(regs, DEBUG_HDL_40);
     handle_legacy_disk(regs, regs->dl);
 }
 
@@ -652,7 +652,7 @@
 void VISIBLE16
 handle_13(struct bregs *regs)
 {
-    //debug_enter(regs);
+    debug_enter(regs, DEBUG_HDL_13);
     u8 drive = regs->dl;
 
     if (CONFIG_CDROM_EMU) {
@@ -676,7 +676,7 @@
 void VISIBLE16
 handle_76()
 {
-    //debug_isr();
+    debug_isr(DEBUG_ISR_76);
     SET_BDA(disk_interrupt_flag, 0xff);
     eoi_both_pics();
 }
diff --git a/src/floppy.c b/src/floppy.c
index 1f1c2c5..e0b46c2 100644
--- a/src/floppy.c
+++ b/src/floppy.c
@@ -744,7 +744,7 @@
 void VISIBLE16
 handle_0e()
 {
-    //debug_isr();
+    debug_isr(DEBUG_ISR_0e);
     if ((inb(PORT_FD_STATUS) & 0xc0) != 0xc0) {
         outb(0x08, PORT_FD_DATA); // sense interrupt status
         while ((inb(PORT_FD_STATUS) & 0xc0) != 0xc0)
diff --git a/src/kbd.c b/src/kbd.c
index fda5847..fe2a77d 100644
--- a/src/kbd.c
+++ b/src/kbd.c
@@ -390,7 +390,7 @@
 void VISIBLE16
 handle_16(struct bregs *regs)
 {
-    //debug_enter(regs);
+    debug_enter(regs, DEBUG_HDL_16);
 
     set_leds();
 
@@ -700,7 +700,7 @@
 void VISIBLE16
 handle_09()
 {
-    //debug_isr();
+    debug_isr(DEBUG_ISR_09);
 
     // disable keyboard
     outb(0xad, PORT_PS2_STATUS);
diff --git a/src/mouse.c b/src/mouse.c
index 6c21499..23e17de 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -6,7 +6,7 @@
 // This file may be distributed under the terms of the GNU GPLv3 license.
 
 #include "biosvar.h" // struct bregs
-#include "util.h" // debug_enter
+#include "util.h" // debug_isr
 
 #define DEBUGF1(fmt, args...) bprintf(0, fmt , ##args)
 #define DEBUGF(fmt, args...)
@@ -415,7 +415,7 @@
 void VISIBLE16
 handle_74()
 {
-    //debug_isr();
+    debug_isr(DEBUG_ISR_74);
 
     irq_enable();
     int74_function();
diff --git a/src/serial.c b/src/serial.c
index 5f5afce..6c38086 100644
--- a/src/serial.c
+++ b/src/serial.c
@@ -149,7 +149,7 @@
 void VISIBLE16
 handle_14(struct bregs *regs)
 {
-    debug_enter(regs);
+    debug_enter(regs, DEBUG_HDL_14);
 
     irq_enable();
 
@@ -278,7 +278,7 @@
 void VISIBLE16
 handle_17(struct bregs *regs)
 {
-    debug_enter(regs);
+    debug_enter(regs, DEBUG_HDL_17);
 
     irq_enable();
 
diff --git a/src/system.c b/src/system.c
index f3909c1..0941565 100644
--- a/src/system.c
+++ b/src/system.c
@@ -310,7 +310,7 @@
 void VISIBLE16
 handle_15(struct bregs *regs)
 {
-    //debug_enter(regs);
+    debug_enter(regs, DEBUG_HDL_15);
     switch (regs->ah) {
     case 0x24: handle_1524(regs); break;
     case 0x4f: handle_154f(regs); break;
@@ -334,7 +334,7 @@
 void VISIBLE16
 handle_12(struct bregs *regs)
 {
-    debug_enter(regs);
+    debug_enter(regs, DEBUG_HDL_12);
     regs->ax = GET_BDA(mem_size_kb);
 }
 
@@ -342,7 +342,7 @@
 void VISIBLE16
 handle_11(struct bregs *regs)
 {
-    debug_enter(regs);
+    debug_enter(regs, DEBUG_HDL_11);
     regs->ax = GET_BDA(equipment_list_flags);
 }
 
@@ -350,21 +350,21 @@
 void VISIBLE16
 handle_05(struct bregs *regs)
 {
-    debug_enter(regs);
+    debug_enter(regs, DEBUG_HDL_05);
 }
 
 // INT 10h Video Support Service Entry Point
 void VISIBLE16
 handle_10(struct bregs *regs)
 {
-    debug_enter(regs);
+    debug_enter(regs, DEBUG_HDL_10);
     // dont do anything, since the VGA BIOS handles int10h requests
 }
 
 void VISIBLE16
 handle_nmi()
 {
-    debug_isr();
+    debug_isr(DEBUG_ISR_nmi);
     BX_PANIC("NMI Handler called\n");
 }
 
@@ -372,7 +372,7 @@
 void VISIBLE16
 handle_75()
 {
-    debug_isr();
+    debug_isr(DEBUG_ISR_75);
 
     // clear irq13
     outb(0, PORT_MATH_CLEAR);
diff --git a/src/util.h b/src/util.h
index fa30e08..8a71569 100644
--- a/src/util.h
+++ b/src/util.h
@@ -120,12 +120,16 @@
 void __debug_fail(const char *fname, struct bregs *regs);
 void __debug_stub(const char *fname, struct bregs *regs);
 void __debug_isr(const char *fname);
-#define debug_enter(regs) \
-    __debug_enter(__func__, regs)
+#define debug_enter(regs, lvl) do {                     \
+        if ((lvl) && (lvl) <= CONFIG_DEBUG_LEVEL)       \
+            __debug_enter(__func__, regs);              \
+    } while (0)
+#define debug_isr(lvl) do {                             \
+        if ((lvl) && (lvl) <= CONFIG_DEBUG_LEVEL)       \
+            __debug_isr(__func__);                      \
+    } while (0)
 #define debug_stub(regs) \
     __debug_stub(__func__, regs)
-#define debug_isr(regs) \
-    __debug_isr(__func__)
 
 // Frequently used return codes
 #define RET_EUNSUPPORTED 0x86