summaryrefslogtreecommitdiff
path: root/console.c
diff options
context:
space:
mode:
authorFrans Kaashoek <[email protected]>2009-10-07 17:42:25 -0400
committerFrans Kaashoek <[email protected]>2009-10-07 17:42:25 -0400
commitaaf63e62d763216448854bc6f921943a5140462e (patch)
treeaba0d8124bd49710ba2e5c5904786e20e5def1db /console.c
parentab777a9ad0355e6df16ee53bad348d5fbb1f347f (diff)
parent2c536bff67ed209b1c5aa3d40e40731813bfcd9a (diff)
downloadxv6-labs-aaf63e62d763216448854bc6f921943a5140462e.tar.gz
xv6-labs-aaf63e62d763216448854bc6f921943a5140462e.tar.bz2
xv6-labs-aaf63e62d763216448854bc6f921943a5140462e.zip
Merge branch 'master' of git+ssh://amsterdam.csail.mit.edu/home/am0/6.828/xv6
Diffstat (limited to 'console.c')
-rw-r--r--console.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/console.c b/console.c
index 0613a47..16d0e7a 100644
--- a/console.c
+++ b/console.c
@@ -163,7 +163,12 @@ consputc(int c)
;
}
- uartputc(c);
+ if (c == BACKSPACE) {
+ uartputc('\b');
+ uartputc(' ');
+ uartputc('\b');
+ } else
+ uartputc(c);
cgaputc(c);
}
@@ -198,6 +203,7 @@ consoleintr(int (*getc)(void))
}
break;
case C('H'): // Backspace
+ case '\x7f':
if(input.e != input.w){
input.e--;
consputc(BACKSPACE);
@@ -205,6 +211,9 @@ consoleintr(int (*getc)(void))
break;
default:
if(c != 0 && input.e-input.r < INPUT_BUF){
+ // The serial port produces 0x13, not 0x10
+ if(c == '\r')
+ c = '\n';
input.buf[input.e++ % INPUT_BUF] = c;
consputc(c);
if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){