aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-01-15 15:46:54 +0100
committerFelix Morgner <felix.morgner@ost.ch>2026-01-15 15:46:54 +0100
commit1799e1ba1b825eda639141b0597a1783576b69da (patch)
treeb63fef64c38eea6667ceae97bce809a6639e2fcb /arch/x86_64/src
parent213274bdd6ea6267143594b71fbfd6a38eba350b (diff)
downloadteachos-1799e1ba1b825eda639141b0597a1783576b69da.tar.xz
teachos-1799e1ba1b825eda639141b0597a1783576b69da.zip
x86_64/debug: implement debug port detection
Diffstat (limited to 'arch/x86_64/src')
-rw-r--r--arch/x86_64/src/debug/qemu_output.cpp7
1 files changed, 4 insertions, 3 deletions
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 <algorithm>
#include <string_view>
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<port::value_type>);
}
-
m_lower.write(stream, text);
}