From dce1e97e7503e90e1d2fcfc0ab11b8d2c7ad1dfb Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Mon, 25 Jan 2021 22:42:32 -0600 Subject: i386: add support for newlines Add support for the newline character in the TTY layer. Signed-off-by: Danny Holman --- arch/i386/boot/tty.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'arch') diff --git a/arch/i386/boot/tty.c b/arch/i386/boot/tty.c index 9c3985b..ed0aaf4 100644 --- a/arch/i386/boot/tty.c +++ b/arch/i386/boot/tty.c @@ -37,6 +37,13 @@ void tty_putentryat(unsigned char c, uint8_t color, size_t x, size_t y) { void tty_putchar(char c) { unsigned char uc = c; + switch (uc) { + case '\n': + terminal_column = 0; + terminal_row++; + return; + } + tty_putentryat(uc, terminal_color, terminal_column, terminal_row); if (++terminal_column == VGA_WIDTH) { terminal_column = 0; -- cgit v1.2.3