blob: 11e3b1a3b49598dd8f44b84001352973be3e6c13 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#include "arch/video/vga/text.hpp"
#include "arch/boot/pointers.hpp"
#include "memory/asm_pointer.hpp"
#include <algorithm>
#include <string_view>
namespace teachos::arch::video::vga::text
{
namespace
{
auto constinit text_buffer = teachos::boot::asm_pointer{boot::vga_buffer_pointer};
auto write(char character, std::byte color) -> void
{
auto & p = *text_buffer;
(*p++) = static_cast<std::byte>(character);
(*p++) = color;
};
} // namespace
auto write(std::string_view text, std::byte color) -> void
{
std::ranges::for_each(text, [&](auto character) { write(character, color); });
}
} // namespace teachos::arch::video::vga::text
|