diff options
author | Chandramouli Narayanan <chandramouli.narayanan@intel.com> | 2012-03-16 18:53:51 +0000 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2012-03-28 14:38:42 +0100 |
commit | 937f816addb214ca4c8c1ce977e0357eafa8c617 (patch) | |
tree | 97fb65a94e1c4fd31932e5c15ac59dd8085e4adc | |
parent | b7a50a91d69861ad8df30179aeb7f0ca1ec92052 (diff) | |
download | syslinux-937f816addb214ca4c8c1ce977e0357eafa8c617.tar.gz syslinux-937f816addb214ca4c8c1ce977e0357eafa8c617.tar.xz syslinux-937f816addb214ca4c8c1ce977e0357eafa8c617.zip |
ansi: Improve EFI console support
This commit fixes a number of bugs when displaying text on the console
under EFI, such as not clearing the screen when we've reached the last
row, and writing one character on each line.
Signed-off-by: Chandramouli Narayanan <chandramouli.narayanan@intel.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
-rw-r--r-- | com32/lib/sys/ansi.c | 8 | ||||
-rw-r--r-- | com32/lib/sys/ansicon_write.c | 6 | ||||
-rw-r--r-- | efi/main.c | 5 |
3 files changed, 17 insertions, 2 deletions
diff --git a/com32/lib/sys/ansi.c b/com32/lib/sys/ansi.c index f73c03e2..db47ea46 100644 --- a/com32/lib/sys/ansi.c +++ b/com32/lib/sys/ansi.c @@ -438,6 +438,14 @@ void __ansi_putchar(const struct term_info *ti, uint8_t ch) op->scroll_up(st); } + /* + * Testing on EFI shows that from (rows-1)th line newline does not + * advance anymore. All further output is always on the same + * (rows-1)th line. Resetting the row to 0 does work. + */ + if (xy.y == rows-1) + xy.y = 0; + /* Update cursor position */ op->set_cursor(xy.x, xy.y, st->cursor); st->xy = xy; diff --git a/com32/lib/sys/ansicon_write.c b/com32/lib/sys/ansicon_write.c index 73580156..a963923d 100644 --- a/com32/lib/sys/ansicon_write.c +++ b/com32/lib/sys/ansicon_write.c @@ -273,7 +273,11 @@ static void ansicon_scroll_up(const struct term_state *st) { uint8_t rows, cols, attribute; - cols = ti.cols = 1; + /* + * Earlier code set ti.cols to 1 causing console output one char + * per line. + */ + cols = 1; rows = ti.rows - 1; attribute = ansicon_attribute(st); @@ -110,7 +110,10 @@ static UINTN cursor_x, cursor_y; static void efi_erase(const struct term_state *st, int x0, int y0, int x1, int y1) { + SIMPLE_TEXT_OUTPUT_INTERFACE *out = ST->ConOut; cursor_x = cursor_y = 0; + /* Really clear the screen */ + uefi_call_wrapper(out->ClearScreen, 1, out); } static void efi_write_char(uint8_t ch, uint8_t attribute) @@ -146,7 +149,7 @@ static void efi_scroll_up(uint8_t cols, uint8_t rows, uint8_t attribute) } -static void efi_get_mode(int *rows, int *cols) +static void efi_get_mode(int *cols, int *rows) { SIMPLE_TEXT_OUTPUT_INTERFACE *out = ST->ConOut; UINTN c, r; |