mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/9] lib: term: fix fbconsole cursor desynchronization
@ 2026-05-01  6:53 Ahmad Fatoum
  2026-05-01  6:53 ` [PATCH 1/9] lib: term: avoid printing NUL with new new console_puts API Ahmad Fatoum
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Ahmad Fatoum @ 2026-05-01  6:53 UTC (permalink / raw)
  To: barebox

term_getsize() was added as a common helper to compute the minimum
terminal size across all enabled stdout consoles.

Since then, the EFI loader support added the same functionality again in
open-coded form.

Both suffer from the same underlying issue: They emit some control
characters on all enabled stdout consoles without the regard for the
individual size and capabilities of the terminals they are connected to.

This can lead to the cursor to end up at odd places on some consoles,
but not others as can be seen here on this video of the barebox
framebuffer console on a device without a terminal connected to the
serial port:

https://fosstodon.org/@otte_homan@theblower.au/116229733790452489

The <blue>OTICE</blue> is due to the framebuffer console cursor being
placed at the very end of the previous line. Then N is printed and
the rest at the line after it.

This series fixes term_getsize() to correctly account for differences
between the framebuffer and "regular" consoles and then switches off the
UEFI loader console support to make use of it.

This fixes the display of the OpenBSD bootloader when run under QEMU.

There's still some more improvements to be made to the GOP support, but
they do not preclude actual use: To have the OpenBSD installer
automatically use the console, simple-framebuffer ought to be used
instead of the GOP anyway.

Ahmad Fatoum (9):
  lib: term: avoid printing NUL with new new console_puts API
  lib: term: return error code from term_getsize()
  lib: term: add per-console terminal response parser
  lib: term: factor out single cdev handling from term_getsize
  lib: term: fix term_getsize cursor restore
  console: add get_size callback for direct size reporting
  video: fbconsole: implement get_size
  console: add per-console terminal.size parameter
  efi: reimplement query_console_serial using term_getsize

 common/console.c               |  18 ++++
 drivers/video/fbconsole.c      |  10 +++
 efi/loader/protocols/console.c | 119 +------------------------
 include/console.h              |   3 +
 include/term.h                 |   7 +-
 lib/term.c                     | 158 +++++++++++++++++++++++----------
 6 files changed, 148 insertions(+), 167 deletions(-)

-- 
2.47.3




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-05-07 10:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-01  6:53 [PATCH 0/9] lib: term: fix fbconsole cursor desynchronization Ahmad Fatoum
2026-05-01  6:53 ` [PATCH 1/9] lib: term: avoid printing NUL with new new console_puts API Ahmad Fatoum
2026-05-01  6:53 ` [PATCH 2/9] lib: term: return error code from term_getsize() Ahmad Fatoum
2026-05-01  6:53 ` [PATCH 3/9] lib: term: add per-console terminal response parser Ahmad Fatoum
2026-05-01  6:53 ` [PATCH 4/9] lib: term: factor out single cdev handling from term_getsize Ahmad Fatoum
2026-05-01  6:53 ` [PATCH 5/9] lib: term: fix term_getsize cursor restore Ahmad Fatoum
2026-05-01  6:54 ` [PATCH 6/9] console: add get_size callback for direct size reporting Ahmad Fatoum
2026-05-01  6:54 ` [PATCH 7/9] video: fbconsole: implement get_size Ahmad Fatoum
2026-05-01  6:54 ` [PATCH 8/9] console: add per-console terminal.size parameter Ahmad Fatoum
2026-05-01  7:19 ` [PATCH 9/9] efi: reimplement query_console_serial using term_getsize Ahmad Fatoum
2026-05-07 10:38 ` [PATCH 0/9] lib: term: fix fbconsole cursor desynchronization Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox