Browse Source

kernel: banner: Add option to clear screen on boot

On each reboot, this option causes the serial output to start top-left
on the users terminal, simplifying (human) parsing.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
pull/74273/head
Reto Schneider 1 year ago committed by Anas Nashif
parent
commit
1bf5af7e89
  1. 6
      kernel/Kconfig
  2. 9
      kernel/banner.c

6
kernel/Kconfig

@ -467,6 +467,12 @@ config BOOT_DELAY @@ -467,6 +467,12 @@ config BOOT_DELAY
achieved by waiting for DCD on the serial port--however, not
all serial ports have DCD.
config BOOT_CLEAR_SCREEN
bool "Clear screen"
help
Use this option to clear the screen before printing anything else.
Using a VT100 enabled terminal on the client side is required for this to work.
config THREAD_MONITOR
bool "Thread monitoring"
help

9
kernel/banner.c

@ -33,6 +33,15 @@ void boot_banner(void) @@ -33,6 +33,15 @@ void boot_banner(void)
k_busy_wait(CONFIG_BOOT_DELAY * USEC_PER_MSEC);
#endif /* defined(CONFIG_BOOT_DELAY) && (CONFIG_BOOT_DELAY > 0) */
#if defined(CONFIG_BOOT_CLEAR_SCREEN)
/* \x1b[ = escape sequence
* 3J = erase scrollback
* 2J = erase screen
* H = move cursor to top left
*/
printk("\x1b[3J\x1b[2J\x1b[H");
#endif /* CONFIG_BOOT_CLEAR_SCREEN */
#ifdef CONFIG_BOOT_BANNER
printk("*** " CONFIG_BOOT_BANNER_STRING " " BANNER_VERSION BANNER_POSTFIX " ***\n");
#endif /* CONFIG_BOOT_BANNER */

Loading…
Cancel
Save