feat: separate VGA

This commit is contained in:
2026-10-03 06:57:51 +02:00
parent 4d804fc7b7
commit 58afc2fc61
3 changed files with 37 additions and 18 deletions
+17
View File
@@ -0,0 +1,17 @@
#include "vga.hpp"
static volatile u16* const s_vga = reinterpret_cast<volatile u16*>(0xB8000);
void vga::clear(void) {
for (u32 i = 0; i < ROWS * COLS; ++i)
s_vga[i] = 0;
}
void vga::putc(char ch, u8 col, u8 row) {
s_vga[col + (COLS * row)] = 0x0700 | ch;
}
void vga::puts(const char* str, u8 col, u8 row) {
for (u32 off = 0; str[off] != '\0'; ++off)
putc(str[off], col + off, row);
}