From 1799e1ba1b825eda639141b0597a1783576b69da Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 15 Jan 2026 15:46:54 +0100 Subject: x86_64/debug: implement debug port detection --- arch/x86_64/src/debug/qemu_output.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'arch/x86_64/src/debug') diff --git a/arch/x86_64/src/debug/qemu_output.cpp b/arch/x86_64/src/debug/qemu_output.cpp index 773306f..0af5bdc 100644 --- a/arch/x86_64/src/debug/qemu_output.cpp +++ b/arch/x86_64/src/debug/qemu_output.cpp @@ -2,6 +2,7 @@ #include "kapi/cio.hpp" +#include #include namespace teachos::debug::x86_64 @@ -9,15 +10,15 @@ namespace teachos::debug::x86_64 qemu_output::qemu_output(output_device & lower) : m_lower{lower} + , m_present{port::read() == port::address} {} auto qemu_output::write(cio::output_stream stream, std::string_view text) -> void { - for (auto c : text) + if (m_present) { - dbg::write(c); + std::ranges::for_each(text, port::write); } - m_lower.write(stream, text); } -- cgit v1.2.3