summaryrefslogtreecommitdiffhomepage
path: root/Private/KernelKit/DebugOutput.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'Private/KernelKit/DebugOutput.hpp')
-rw-r--r--Private/KernelKit/DebugOutput.hpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/Private/KernelKit/DebugOutput.hpp b/Private/KernelKit/DebugOutput.hpp
new file mode 100644
index 00000000..1e30e6a4
--- /dev/null
+++ b/Private/KernelKit/DebugOutput.hpp
@@ -0,0 +1,40 @@
+/*
+ * ========================================================
+ *
+ * hCore
+ * Copyright 2024 Mahrouss Logic, all rights reserved.
+ *
+ * ========================================================
+ */
+
+#pragma once
+
+#include <KernelKit/Device.hpp>
+#include <NewKit/OwnPtr.hpp>
+#include <NewKit/Stream.hpp>
+
+namespace hCore
+{
+ // @brief Emulates a VT100 terminal.
+ class TerminalDevice final : public DeviceInterface<const char*>
+ {
+ public:
+ TerminalDevice(void (*print)(const char *), void (*get)(const char *)) : DeviceInterface<const char*>(print, get) {}
+ virtual ~TerminalDevice() {}
+
+ /// @brief returns device name (terminal name)
+ /// @return string type (const char*)
+ virtual const char* Name() const override { return ("TerminalDevice"); }
+
+ TerminalDevice &operator=(const TerminalDevice &) = default;
+ TerminalDevice(const TerminalDevice &) = default;
+
+ };
+
+ namespace Detail
+ {
+ bool serial_init();
+ }
+
+ extern TerminalDevice kcout;
+} // namespace hCore