]> Devi Nivas Git - cs3210-lab0.git/commitdiff
Get cgaputc and consputc back on the same page
authorAustin Clements <amdragon@mit.edu>
Thu, 2 Sep 2010 22:50:49 +0000 (18:50 -0400)
committerAustin Clements <amdragon@mit.edu>
Thu, 2 Sep 2010 22:50:49 +0000 (18:50 -0400)
console.c

index a3cdf96a99527db595679e6f9ac6b8975165123e..e7ed248501d6764941d6c16359dff82cadd46b40 100644 (file)
--- a/console.c
+++ b/console.c
@@ -136,8 +136,7 @@ cgaputc(int c)
   if(c == '\n')
     pos += 80 - pos%80;
   else if(c == BACKSPACE){
-    if(pos > 0)
-      crt[--pos] = ' ' | 0x0700;
+    if(pos > 0) --pos;
   } else
     crt[pos++] = (c&0xff) | 0x0700;  // black on white
   
@@ -164,15 +163,12 @@ consputc(int c)
   }
 
   if(c == BACKSPACE){
-    uartputc('\b');
-    uartputc(' ');
-    uartputc('\b');
+    uartputc('\b'); uartputc(' '); uartputc('\b');
   } else
     uartputc(c);
   cgaputc(c);
 }
 
-//PAGEBREAK: 50
 #define INPUT_BUF 128
 struct {
   struct spinlock lock;