aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/io.cpp
blob: 5fb1c85f87251f574501eaffb1e9384111a79ed1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "kern/print.hpp"
#include "x86_64/vga/text.hpp"

namespace teachos::arch::io
{

  auto init() -> void
  {
    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) { return x86_64::vga::text::write(text, x86_64::vga::text::common_attributes::green_on_black); });

    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) { return x86_64::vga::text::write(text, x86_64::vga::text::common_attributes::red_on_black); });

    teachos::println("[x86-64] Basic VGA text output initialized.");
  }

}  // namespace teachos::arch::io