diff options
Diffstat (limited to 'arch/x86_64/src')
| -rw-r--r-- | arch/x86_64/src/kernel/main.cpp | 10 | ||||
| -rw-r--r-- | arch/x86_64/src/video/vga/text.cpp | 15 |
2 files changed, 13 insertions, 12 deletions
diff --git a/arch/x86_64/src/kernel/main.cpp b/arch/x86_64/src/kernel/main.cpp index 8ca577a..a5ffbb4 100644 --- a/arch/x86_64/src/kernel/main.cpp +++ b/arch/x86_64/src/kernel/main.cpp @@ -32,10 +32,12 @@ namespace teachos::arch::kernel uint32_t size = tag->size; uint32_t mem_lower = *(uint32_t *)(&size + 32); uint32_t mem_upper = *(uint32_t *)(&size + 64); - if (mem_lower > mem_upper) - { - } - text::write("BUFFER IS HERE", text::common_attributes::green_on_black); + + text::write_number(mem_lower, text::common_attributes::green_on_black); + text::write("Lower memory bound", text::common_attributes::green_on_black); + text::write_number(mem_lower, text::common_attributes::green_on_black); + text::write("Upper memory bound", text::common_attributes::green_on_black); + text::write_number(mem_upper, text::common_attributes::green_on_black); break; } } diff --git a/arch/x86_64/src/video/vga/text.cpp b/arch/x86_64/src/video/vga/text.cpp index f1e7412..bf60410 100644 --- a/arch/x86_64/src/video/vga/text.cpp +++ b/arch/x86_64/src/video/vga/text.cpp @@ -17,12 +17,6 @@ namespace teachos::arch::video::vga::text extern "C" std::pair<char, attribute> * vga_buffer_pointer; auto constinit text_buffer = teachos::memory::asm_pointer{vga_buffer_pointer}; - - auto write(char code_point, attribute attribute) -> void - { - auto & p = *text_buffer; - (*p++) = std::pair{code_point, attribute}; - }; } // namespace auto clear(attribute attribute) -> void @@ -39,9 +33,14 @@ namespace teachos::arch::video::vga::text crtc::data_port::write(vga::crtc::data_port::read() | cursor_disable_byte); } + auto write_char(char code_point, attribute attribute) -> void + { + auto & p = *text_buffer; + (*p++) = std::pair{code_point, attribute}; + }; + auto write(std::string_view code_points, attribute attribute) -> void { - std::ranges::for_each(code_points, [&](auto code_point) { write(code_point, attribute); }); + std::ranges::for_each(code_points, [&](auto code_point) { write_char(code_point, attribute); }); } - } // namespace teachos::arch::video::vga::text |
