From 421fe33dc0fe647d9ac4b13464fd2d1da0b97399 Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Sat, 15 Jan 2022 09:08:46 -0800 Subject: [PATCH] [boot] Scroll serial output before exit_boot_services The last line of the boot output was always getting cut off by anything else getting printed to the serial port. Adding two newlines to clear the cursor of the previous output. --- src/boot/main.cpp | 2 ++ src/boot/status.cpp | 10 ++++++++++ src/boot/status.h | 1 + 3 files changed, 13 insertions(+) diff --git a/src/boot/main.cpp b/src/boot/main.cpp index 75bc84b..a31d5aa 100644 --- a/src/boot/main.cpp +++ b/src/boot/main.cpp @@ -133,6 +133,8 @@ uefi_exit(bootproto::args *args, uefi::handle image, uefi::boot_services *bs) args->frame_blocks = memory::build_frame_blocks(args->mem_map); map.update(*bs); + status.do_blank(); + try_or_raise( bs->exit_boot_services(image, map.key), L"Failed to exit boot services"); diff --git a/src/boot/status.cpp b/src/boot/status.cpp index 7c84bb4..4968fd7 100644 --- a/src/boot/status.cpp +++ b/src/boot/status.cpp @@ -147,6 +147,16 @@ status_line::do_fail(const wchar_t *message, uefi::status status) out->output_string(L"\r\n"); } +void +status_line::do_blank() +{ + auto out = console::get().m_out; + int row = out->mode->cursor_row; + + out->set_cursor_position(0, row); + out->output_string(L"\r\n\r\n"); +} + status_bar::status_bar(video::screen *screen) : diff --git a/src/boot/status.h b/src/boot/status.h index 1d5e890..eacb4b8 100644 --- a/src/boot/status.h +++ b/src/boot/status.h @@ -75,6 +75,7 @@ public: virtual void do_warn(const wchar_t *message, uefi::status status) override; virtual void do_fail(const wchar_t *message, uefi::status status) override; + void do_blank(); private: void print_status_tag();