Kernel: Fix text mode cursor

Apparently text mode renders cursor in the *foreground* color. My
current clear function used the same color for foreground and background
making the cursor effectively invisible.

Also cursor hiding is now done by moving the cursor off bounds (0, height)
some website I read said this to be valid even on VGA compatible cards
without disable bit.

http://www.osdever.net/FreeVGA/vga/textcur.htm
This commit is contained in:
2025-04-25 02:31:33 +03:00
parent 9f3f8f950a
commit 9ff9d679e9
2 changed files with 35 additions and 23 deletions

View File

@@ -30,6 +30,7 @@ namespace Kernel
{}
BAN::ErrorOr<void> initialize();
void move_cursor_impl(uint32_t x, uint32_t y);
private:
const paddr_t m_paddr;
@@ -37,6 +38,10 @@ namespace Kernel
const uint32_t m_height;
const uint32_t m_pitch;
vaddr_t m_vaddr { 0 };
uint32_t m_cursor_x { 0 };
uint32_t m_cursor_y { 0 };
bool m_cursor_shown { true };
static constexpr Color s_cursor_color = TerminalColor::WHITE;
};