diff options
author | Danny Holman <dholman@gymli.xyz> | 2021-01-25 22:42:32 -0600 |
---|---|---|
committer | Danny Holman <dholman@gymli.xyz> | 2021-01-25 22:42:32 -0600 |
commit | dce1e97e7503e90e1d2fcfc0ab11b8d2c7ad1dfb (patch) | |
tree | a81bd4ad5097d100b9baff819c0ca19cc5b40e0f /arch/i386 | |
parent | a4534660fecb1b571c24ad82e67bc6c2fb814cb9 (diff) |
i386: add support for newlines
Add support for the newline character in the TTY layer.
Signed-off-by: Danny Holman <dholman@gymli.xyz>
Diffstat (limited to 'arch/i386')
-rw-r--r-- | arch/i386/boot/tty.c | 7 |
1 files changed, 7 insertions, 0 deletions
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; |