aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/x86_64/include/x86_64/debug/qemu_output.hpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/x86_64/include/x86_64/debug/qemu_output.hpp b/arch/x86_64/include/x86_64/debug/qemu_output.hpp
index 759a66b..6ff4da6 100644
--- a/arch/x86_64/include/x86_64/debug/qemu_output.hpp
+++ b/arch/x86_64/include/x86_64/debug/qemu_output.hpp
@@ -9,15 +9,30 @@
namespace teachos::debug::x86_64
{
+
+ //! A QEMU debug console output device.
+ //!
+ //! This device implements output to the port 0xE9 debug console present in QEMU in Bochs. It is designed to wrap a
+ //! different output device (e.g. a VGA text output device) and forwards the written data accordingly.
+ //!
+ //! @note Support for the device has to be enabled when the emulator is started. Since there is no reliable way to
+ //! detect the presence of the port, writes will still happen even if the device is not enabled in the emulator. It is
+ //! thus possible that the output is simply lost.
struct qemu_output : cio::output_device
{
+ //! The port to write to.
using dbg = io::x86_64::port<0xE9, char, io::x86_64::port_write>;
- qemu_output(output_device & lower);
+ //! Construct a new debug device wrapper for the given output device.
+ //!
+ //! @param lower The device to forward the output to.
+ explicit qemu_output(output_device & lower);
+ //! @copydoc cio::output_device
auto write(cio::output_stream stream, std::string_view text) -> void override;
private:
+ //! The device to forward the output to.
output_device & m_lower;
};