diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-06 09:14:11 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-06 09:14:11 +0100 |
| commit | 5339d016c07bf717ee388f4feb73544087324af0 (patch) | |
| tree | 94be6f67ed626091f24aee24ec3b3be03d01e4e7 /KernelKit/DebugOutput.hpp | |
git: port from mercurial repo.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'KernelKit/DebugOutput.hpp')
| -rw-r--r-- | KernelKit/DebugOutput.hpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/KernelKit/DebugOutput.hpp b/KernelKit/DebugOutput.hpp new file mode 100644 index 00000000..9634c32b --- /dev/null +++ b/KernelKit/DebugOutput.hpp @@ -0,0 +1,40 @@ +/* + * ======================================================== + * + * hCore + * Copyright 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 IDevice<const char*> + { + public: + TerminalDevice(void (*print)(const char *), void (*get)(const char *)) : IDevice<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 |
