summaryrefslogtreecommitdiff
path: root/console.c
diff options
context:
space:
mode:
authorrsc <rsc>2006-09-07 15:45:38 +0000
committerrsc <rsc>2006-09-07 15:45:38 +0000
commitab17e3198be3ae4bf50bf02241c5c1abb3128915 (patch)
tree6603025b78e908076ab4fc89a5e4167bcf8f94f2 /console.c
parent1542186378ba1c53744d19b3f2c8382976bd5d21 (diff)
downloadxv6-labs-ab17e3198be3ae4bf50bf02241c5c1abb3128915.tar.gz
xv6-labs-ab17e3198be3ae4bf50bf02241c5c1abb3128915.tar.bz2
xv6-labs-ab17e3198be3ae4bf50bf02241c5c1abb3128915.zip
debugging prints
Diffstat (limited to 'console.c')
-rw-r--r--console.c36
1 files changed, 23 insertions, 13 deletions
diff --git a/console.c b/console.c
index 218a627..52ccc10 100644
--- a/console.c
+++ b/console.c
@@ -356,19 +356,29 @@ kbd_intr()
c += 'a' - 'A';
}
- // Ignore unknown keystrokes.
- if(c == 0x0) {
- release(&kbd_lock);
- return;
- }
-
- if(((kbd_w + 1) % KBD_BUF) != kbd_r){
- kbd_buf[kbd_w++] = c;
- if(kbd_w >= KBD_BUF)
- kbd_w = 0;
- wakeup(&kbd_r);
- } else {
- cprintf("kbd overflow\n");
+ switch(c){
+ case 0:
+ // Ignore unknown keystrokes.
+ break;
+
+ case C('T'):
+ cprintf("#"); // Let user know we're still alive.
+ break;
+
+ case C('P'):
+ procdump();
+ break;
+
+ default:
+ if(((kbd_w + 1) % KBD_BUF) != kbd_r){
+ kbd_buf[kbd_w++] = c;
+ if(kbd_w >= KBD_BUF)
+ kbd_w = 0;
+ wakeup(&kbd_r);
+ } else {
+ cprintf("kbd overflow\n");
+ }
+ break;
}
release(&kbd_lock);