From 4f064b30cdcddf4bcb8b445721ca16eef61d87ef Mon Sep 17 00:00:00 2001 From: mintsuki Date: Mon, 11 Oct 2021 21:08:32 +0200 Subject: [PATCH] term: Check if any terminal is actually initialised in reset_term() --- stage23/entry.s3.c | 2 +- stage23/lib/term.h | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/stage23/entry.s3.c b/stage23/entry.s3.c index 9b720e72..9de0a3df 100644 --- a/stage23/entry.s3.c +++ b/stage23/entry.s3.c @@ -153,7 +153,7 @@ void stage3_common(void) { init_io_apics(); if (verbose) { - print("Boot drive: %x\n", boot_volume->index); + print("Boot drive: %d\n", boot_volume->index); print("Boot partition: %d\n", boot_volume->partition); } diff --git a/stage23/lib/term.h b/stage23/lib/term.h index 0338e1d3..0734cc35 100644 --- a/stage23/lib/term.h +++ b/stage23/lib/term.h @@ -95,10 +95,12 @@ extern void (*term_callback)(uint64_t, uint64_t, uint64_t, uint64_t); extern bool term_autoflush; inline void reset_term(void) { - term_autoflush = true; - enable_cursor(); - clear(true); - term_double_buffer_flush(); + if (term_backend != NOT_READY) { + term_autoflush = true; + enable_cursor(); + clear(true); + term_double_buffer_flush(); + } } #endif