Index: share/mk/src.opts.mk =================================================================== --- share/mk/src.opts.mk +++ share/mk/src.opts.mk @@ -202,6 +202,7 @@ __DEFAULT_NO_OPTIONS = \ BEARSSL \ BHYVE_SNAPSHOT \ + BOOT0_RESET_TERM \ CLANG_EXTRAS \ CLANG_FORMAT \ DTRACE_TESTS \ Index: stand/i386/boot0/Makefile =================================================================== --- stand/i386/boot0/Makefile +++ stand/i386/boot0/Makefile @@ -14,6 +14,7 @@ # -DCHECK_DRIVE enable checking drive number # -DONLY_F_KEYS accept only Fx keys in console # -DTEST print drive number on entry +# -DRESET_TERM send terminal reset command before first output # OPTS ?= -DVOLUME_SERIAL -DPXE CFLAGS += ${OPTS} Index: stand/i386/boot0/boot0.S =================================================================== --- stand/i386/boot0/boot0.S +++ stand/i386/boot0/boot0.S @@ -216,6 +216,14 @@ callw bioscom #endif +#if defined(SIO) && defined(RESET_TERM) + /* + * ANSI / VT100 command to reset all terminal attributes + */ + movw $resetterm,%si # Reset + callw putstr # terminal +#endif + /* * If the 'setdrv' flag is set in the boot sector, use the drive * number from the boot sector at 'setdrv_num'. @@ -584,6 +592,14 @@ popw %si # Restore retw # To caller +#if defined(SIO) && defined(RESET_TERM) + /* + * Reset terminal ANSI/VT100 sequence + */ +resetterm: + .byte 0x1b; .byte 'c'|0x80 +#endif + /* * Various menu strings. 'item' goes after 'prompt' to save space. * Also use shorter versions to make room for the PXE/INT18 code. Index: stand/i386/boot0sio/Makefile =================================================================== --- stand/i386/boot0sio/Makefile +++ stand/i386/boot0sio/Makefile @@ -2,7 +2,13 @@ .PATH: ${.CURDIR}/../boot0 +.include + PROGNAME= boot0sio CFLAGS+= -DSIO +.if ${MK_BOOT0_RESET_TERM} != "no" +OPTS ?= -DRESET_TERM -DSAVE_MEMORY -DPXE +.endif + .include "${.CURDIR}/../boot0/Makefile" Index: tools/build/options/WITH_BOOT0_RESET_TERM =================================================================== --- /dev/null +++ tools/build/options/WITH_BOOT0_RESET_TERM @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to build boot0sio to send default VT-100 reset command c before first +output. +This option is not compatible with PXE and VOLUME_SERIAL options, due to space +constraints.