feat: separate VGA
This commit is contained in:
+4
-18
@@ -1,29 +1,15 @@
|
||||
#include "arch/arch.hpp"
|
||||
#include "types.hpp"
|
||||
|
||||
static volatile u16* const s_vga = reinterpret_cast<volatile u16*>(0xB8000);
|
||||
|
||||
static constexpr u8 VGA_ROWS = 25;
|
||||
static constexpr u8 VGA_COLS = 80;
|
||||
|
||||
static inline void clrsc(void) {
|
||||
for (u32 i = 0; i < VGA_ROWS * VGA_COLS; ++i)
|
||||
s_vga[i] = 0;
|
||||
}
|
||||
|
||||
static inline void puts(const char* str, u8 row, u8 col) {
|
||||
for (u32 off = 0; str[off] != '\0'; ++off)
|
||||
s_vga[col + off + (VGA_COLS * row)] = 0x0700 | str[off];
|
||||
}
|
||||
#include "vga.hpp"
|
||||
|
||||
extern "C" void kmain(void) {
|
||||
clrsc();
|
||||
vga::clear();
|
||||
|
||||
arch* arch = arch::get();
|
||||
arch->init();
|
||||
|
||||
puts("TowOS initialized!", 0, 0);
|
||||
puts("Zdravstvuyte, tovarisch!", 1, 0);
|
||||
vga::puts("TowOS initialized!", 0, 0);
|
||||
vga::puts("Zdravstvuyte, tovarisch!", 0, 1);
|
||||
|
||||
for (;;)
|
||||
__asm__ volatile("hlt");
|
||||
|
||||
Reference in New Issue
Block a user