diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2023-10-11 20:16:55 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2023-10-11 20:16:55 +0200 |
| commit | 9e7fba5959bc91ad549809551c99756e34f245db (patch) | |
| tree | 5a2975362c719221c849f6fdf4b1ffa45af46c7e /source/arch/x86_64/src/video | |
| parent | 18863e0f3db23441c0213745ad6de3722fd4c845 (diff) | |
| download | teachos-9e7fba5959bc91ad549809551c99756e34f245db.tar.xz teachos-9e7fba5959bc91ad549809551c99756e34f245db.zip | |
x86_64: vga: implement basic cursor configuration
Diffstat (limited to 'source/arch/x86_64/src/video')
| -rw-r--r-- | source/arch/x86_64/src/video/vga/text.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/arch/x86_64/src/video/vga/text.cpp b/source/arch/x86_64/src/video/vga/text.cpp index ad9e46c..8259c5a 100644 --- a/source/arch/x86_64/src/video/vga/text.cpp +++ b/source/arch/x86_64/src/video/vga/text.cpp @@ -1,6 +1,7 @@ #include "arch/video/vga/text.hpp" #include "arch/boot/pointers.hpp" +#include "arch/video/vga/io.hpp" #include "memory/asm_pointer.hpp" #include <algorithm> @@ -30,9 +31,17 @@ namespace teachos::arch::video::vga::text std::ranges::fill_n(*text_buffer, 2000, std::pair{' ', attribute}); } + auto cursor(bool enabled) -> void + { + auto cursor_disable_byte = std::byte{!enabled} << 5; + + crtc::address_port::write(crtc::registers::cursor_start); + crtc::data_port::write(vga::crtc::data_port::read() | cursor_disable_byte); + } + auto write(std::string_view code_points, attribute attribute) -> void { std::ranges::for_each(code_points, [&](auto code_point) { write(code_point, attribute); }); } -} // namespace teachos::arch::video::vga::text
\ No newline at end of file +} // namespace teachos::arch::video::vga::text |
