setos

拙OS
Log | Files | Refs | LICENSE

commit f6ba90b8f9f40402ddeb1e7a82ecec65b19ede5c
parent e5108957cd8ba470e98710225cbc9bf3203e5d08
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Tue,  2 Apr 2024 14:17:58 +0900

add control charactors

Diffstat:
Msys/src/kernel/console.c | 8++++++++
Msys/src/kernel/main.c | 4+---
2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/sys/src/kernel/console.c b/sys/src/kernel/console.c @@ -23,6 +23,14 @@ cons_putchar(Console *con, char c) } return; } + if (c == '\v') { + con->pos.y = (con->pos.y + 1) % con->h; // TODO scroll. + return; + } + if (c == '\r') { + con->pos.x = 0; + return; + } if (c < 0x20) { // other controll charactors. return; } diff --git a/sys/src/kernel/main.c b/sys/src/kernel/main.c @@ -12,8 +12,6 @@ kernel_main(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop) gop->Mode->Info->VerticalResolution, gop->Mode->Info->PixelsPerScanLine ); - cons_print(&console, "Hello, World!\nNew Line.\tTab\tTab\n"); - cons_print(&console, "1234567812345678123456781234567812345678123456781234567812345678\n"); - cons_print(&console, "1\t22\t333\t4444\t55555\t666666\t7777777\t88888888\t9"); + cons_print(&console, "Hello, World!\nNew Line.\tTab\tTab\rnEW\vVertical"); for(;;); } \ No newline at end of file