From 513077cfec0ea87303ba19502c368f5adcc8ed99 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 7 Feb 2025 09:25:08 +0100 Subject: ADD: VGA logging and tweaks. Signed-off-by: Amlal El Mahrouss --- dev/Kernel/HALKit/AMD64/HalDebugOutput.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'dev/Kernel/HALKit/AMD64/HalDebugOutput.cc') diff --git a/dev/Kernel/HALKit/AMD64/HalDebugOutput.cc b/dev/Kernel/HALKit/AMD64/HalDebugOutput.cc index 6a484723..539d8178 100644 --- a/dev/Kernel/HALKit/AMD64/HalDebugOutput.cc +++ b/dev/Kernel/HALKit/AMD64/HalDebugOutput.cc @@ -8,6 +8,8 @@ #include #include #include +#include +#include namespace Kernel { @@ -80,12 +82,30 @@ namespace Kernel index = 0; len = rt_string_len(bytes, 255); + static int x = kFontSizeX, y = kFontSizeY; + auto log_txt = RGB(0xff, 0xff, 0xff); + while (index < len) { if (bytes[index] == '\r') HAL::rt_out8(Detail::kPort, '\r'); HAL::rt_out8(Detail::kPort, bytes[index] == '\r' ? '\n' : bytes[index]); + + char tmp_str[2]; + tmp_str[0] = bytes[index]; + tmp_str[1] = 0; + + fb_render_string(tmp_str, y, x, log_txt); + + if (bytes[index] == '\r') + { + y += kFontSizeY; + x = kFontSizeX; + } + + x += kFontSizeX; + ++index; } -- cgit v1.2.3