From fd0782099cab0988311aa80d4a6b0871a6403084 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sat, 24 Jun 2017 19:14:36 +0200 Subject: fixed the console output to VGA text mode to also wipe the rest of a line on newline --- src/kernel/console.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/kernel/console.c') diff --git a/src/kernel/console.c b/src/kernel/console.c index 6113823..8caefc8 100644 --- a/src/kernel/console.c +++ b/src/kernel/console.c @@ -46,7 +46,13 @@ void console_put_string( console_t *console, const char *s ) void console_put_newline( console_t *console ) { if( console->vga_text != NULL ) { - vga_text_put_newline( console->vga_text ); + // wipe contents till the end of the line on the + // VGA text console, old data could still be there + // from the BIOS(es) + int x = vga_text_get_cursor_x( console->vga_text ); + for( int i = x; i < console->vga_text->res_x; i++ ) { + vga_text_put_char( console->vga_text, ' ' ); + } } if( console->serial != NULL ) { -- cgit v1.2.3-54-g00ecf