diff options
Diffstat (limited to 'arch/x86_64/src/io.cpp')
| -rw-r--r-- | arch/x86_64/src/io.cpp | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/arch/x86_64/src/io.cpp b/arch/x86_64/src/io.cpp index 8e9e411..eab6473 100644 --- a/arch/x86_64/src/io.cpp +++ b/arch/x86_64/src/io.cpp @@ -1,28 +1,36 @@ -#include "kern/print.hpp" +#include "kapi/io.hpp" + #include "x86_64/vga/text.hpp" -namespace teachos::arch::io +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); + } - teachos::set_print_handler( - [](auto text) { return x86_64::vga::text::write(text, x86_64::vga::text::common_attributes::green_on_black); }); - teachos::set_println_handler([](auto text) { - x86_64::vga::text::write(text, x86_64::vga::text::common_attributes::green_on_black); - x86_64::vga::text::newline(); - }); - - teachos::set_print_error_handler( - [](auto text) { return x86_64::vga::text::write(text, x86_64::vga::text::common_attributes::red_on_black); }); - teachos::set_println_error_handler([](auto text) { - x86_64::vga::text::write(text, x86_64::vga::text::common_attributes::red_on_black); - x86_64::vga::text::newline(); - }); - - teachos::println("[x86-64] Basic VGA text output initialized."); + 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::arch::io +} // namespace teachos::io |
