aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2025-07-23 13:21:32 +0000
committerFelix Morgner <felix.morgner@ost.ch>2025-07-23 13:21:32 +0000
commite97e86d169849527190cef1913efdd247e6f68df (patch)
treec46f0fe0eeaf50354f7a1c65304faae0b670a1b5 /arch/x86_64/src
parent3a407e83b2dbd15936569ff90e4433078ea1cbaf (diff)
downloadteachos-e97e86d169849527190cef1913efdd247e6f68df.tar.xz
teachos-e97e86d169849527190cef1913efdd247e6f68df.zip
libs: move asm_ptr to kstd
Diffstat (limited to 'arch/x86_64/src')
-rw-r--r--arch/x86_64/src/vga/text.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/x86_64/src/vga/text.cpp b/arch/x86_64/src/vga/text.cpp
index 16abf08..dcfdb6b 100644
--- a/arch/x86_64/src/vga/text.cpp
+++ b/arch/x86_64/src/vga/text.cpp
@@ -1,15 +1,14 @@
#include "x86_64/vga/text.hpp"
-#include "arch/asm_pointer.hpp"
+#include "x86_64/boot/boot.hpp"
#include "x86_64/vga/io.hpp"
#include <algorithm>
+#include <bit>
#include <cstddef>
#include <string_view>
#include <utility>
-extern "C" teachos::arch::asm_pointer<std::pair<char, teachos::x86_64::vga::text::attribute>> vga_buffer_pointer;
-
namespace teachos::x86_64::vga::text
{
namespace
@@ -23,7 +22,7 @@ namespace teachos::x86_64::vga::text
auto clear(attribute attribute) -> void
{
buffer_offset = 0;
- std::ranges::fill_n(vga_buffer_pointer.get(), 2000, std::pair{' ', attribute});
+ std::ranges::fill_n(vga_buffer_pointer.get(), 2000, std::pair{' ', std::bit_cast<std::byte>(attribute)});
}
auto cursor(bool enabled) -> void
@@ -54,7 +53,7 @@ namespace teachos::x86_64::vga::text
auto write_char(char code_point, attribute attribute) -> void
{
- vga_buffer_pointer[buffer_offset++] = std::pair{code_point, attribute};
+ vga_buffer_pointer[buffer_offset++] = std::pair{code_point, std::bit_cast<std::byte>(attribute)};
};
auto write(std::string_view code_points, attribute attribute) -> void