aboutsummaryrefslogtreecommitdiff
path: root/drivers/tty.c
diff options
context:
space:
mode:
authorFranklin Wei <frankhwei536@gmail.com>2015-03-01 13:05:04 -0500
committerFranklin Wei <frankhwei536@gmail.com>2015-03-01 13:05:04 -0500
commit6e86a3abee2d9b2c03452cd62997c2152a3332aa (patch)
treeef868a5a58b59fb0fbc215a4dd4367d5fcb4125e /drivers/tty.c
parentd532ad93a42ea95460765d4527b3fb1e4544c154 (diff)
downloadkappa-6e86a3abee2d9b2c03452cd62997c2152a3332aa.zip
kappa-6e86a3abee2d9b2c03452cd62997c2152a3332aa.tar.gz
kappa-6e86a3abee2d9b2c03452cd62997c2152a3332aa.tar.bz2
kappa-6e86a3abee2d9b2c03452cd62997c2152a3332aa.tar.xz
lots of stuff
Diffstat (limited to 'drivers/tty.c')
-rw-r--r--drivers/tty.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/tty.c b/drivers/tty.c
index e39722b..a77071b 100644
--- a/drivers/tty.c
+++ b/drivers/tty.c
@@ -82,7 +82,7 @@ void tty_putchar_at(int ch, uint8_t col, int x, int y)
void tty_putchar(int ch)
{
- if(ch != '\n')
+ if(ch != '\n' && ch != '\b')
{
tty_putchar_at(ch, term_col, term_x, term_y);
if(++term_x == VGA_WIDTH)
@@ -95,7 +95,7 @@ void tty_putchar(int ch)
}
}
}
- else
+ else if(ch == '\n')
{
term_x = 0;
if(++term_y == VGA_HEIGHT)
@@ -104,6 +104,14 @@ void tty_putchar(int ch)
term_y = 0;
}
}
+ else if(ch == '\b')
+ {
+ int temp_x = term_x - 1;
+ if(temp_x >= 0)
+ term_x = temp_x;
+ tty_putchar_at(' ', term_col, term_x, term_y);
+ }
+
update_cursor();
}