aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/kapi
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/kapi')
-rw-r--r--arch/x86_64/kapi/cio.cpp16
-rw-r--r--arch/x86_64/kapi/io.cpp36
2 files changed, 16 insertions, 36 deletions
diff --git a/arch/x86_64/kapi/cio.cpp b/arch/x86_64/kapi/cio.cpp
new file mode 100644
index 0000000..ac3ae39
--- /dev/null
+++ b/arch/x86_64/kapi/cio.cpp
@@ -0,0 +1,16 @@
+#include "kapi/cio.hpp"
+
+#include "x86_64/vga/text.hpp"
+
+namespace teachos::cio
+{
+
+ auto static constinit vga_device = std::optional<x86_64::vga::text::device>{};
+
+ auto init() -> void
+ {
+ vga_device.emplace();
+ set_output_device(*vga_device);
+ }
+
+} // namespace teachos::cio
diff --git a/arch/x86_64/kapi/io.cpp b/arch/x86_64/kapi/io.cpp
deleted file mode 100644
index eab6473..0000000
--- a/arch/x86_64/kapi/io.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-#include "kapi/io.hpp"
-
-#include "x86_64/vga/text.hpp"
-
-namespace teachos::io
-{
-
- auto init() -> void
- {
- x86_64::vga::text::clear();
- x86_64::vga::text::cursor(false);
- }
-
- auto print(std::string_view text) -> void
- {
- x86_64::vga::text::write(text, x86_64::vga::text::common_attributes::green_on_black);
- }
-
- auto println(std::string_view text) -> void
- {
- x86_64::vga::text::write(text, x86_64::vga::text::common_attributes::green_on_black);
- x86_64::vga::text::newline();
- }
-
- auto print_error(std::string_view text) -> void
- {
- x86_64::vga::text::write(text, x86_64::vga::text::common_attributes::red_on_black);
- }
-
- auto println_error(std::string_view text) -> void
- {
- x86_64::vga::text::write(text, x86_64::vga::text::common_attributes::red_on_black);
- x86_64::vga::text::newline();
- }
-
-} // namespace teachos::io