diff --git a/kernel/Kconfig b/kernel/Kconfig index 31658b90f3b..57c8b299759 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -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 diff --git a/kernel/banner.c b/kernel/banner.c index 1d95f2b1835..5cadda0a5e9 100644 --- a/kernel/banner.c +++ b/kernel/banner.c @@ -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 */