From 16ceb1a15713160b974687a3d61e0b5ffeb8ea60 Mon Sep 17 00:00:00 2001 From: Eggert Jung Date: Fri, 18 Apr 2025 21:37:16 +0200 Subject: [PATCH] cga mostly done --- arch/cga.cc | 5 +---- arch/cga.h | 2 +- main.cc | 8 +++++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/arch/cga.cc b/arch/cga.cc index 355ab90..6fcda12 100644 --- a/arch/cga.cc +++ b/arch/cga.cc @@ -32,9 +32,6 @@ void getCursor(unsigned& abs_x, unsigned& abs_y) { } void show(unsigned abs_x, unsigned abs_y, char character, Attribute attrib) { - (void)abs_x; - (void)abs_y; - (void)character; - (void)attrib; + TEXT_BUFFER_BASE[abs_x + (COLUMNS * abs_y)] = Cell(character, attrib); } }; // namespace CGA diff --git a/arch/cga.h b/arch/cga.h index f9c9556..bbf3f59 100644 --- a/arch/cga.h +++ b/arch/cga.h @@ -136,5 +136,5 @@ struct Cell { /*! \brief Base address for linear text buffer in video memory */ -Cell* const TEXT_BUFFER_BASE = nullptr; +Cell* const TEXT_BUFFER_BASE = reinterpret_cast(0xb8000); }; // namespace CGA diff --git a/main.cc b/main.cc index d800c67..8d79fe3 100644 --- a/main.cc +++ b/main.cc @@ -10,13 +10,15 @@ extern "C" int main() { unsigned int numCPUs = Core::count(); DBG_VERBOSE << "Number of CPUs: " << numCPUs << endl; - CGA::setCursor(0, 0); - + //test cga implemantation + CGA::setCursor(1, 2); unsigned x,y; CGA::getCursor(x, y); - CGA::setCursor(x+1, y+1); + for(uint8_t i = 0; i < 10; i++) + CGA::show(i, i, i+0x30, CGA::Attribute()); + /* Start application processors * To avoid unexpected behaviour, make sure that interrupts are not * enabled before the APs are booted. Otherwise it might interfere with the