Refine comments in console.c

This commit is contained in:
Pierre-Emmanuel Gob. 2026-09-19 23:22:57 +02:00 • committed by GitHub
parent d84131de74
commit c0473e2709
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,7 +17,7 @@
#define VGA_CRT_CURSOR_HIGH 0x0EU #define VGA_CRT_CURSOR_HIGH 0x0EU
#define VGA_CRT_CURSOR_LOW 0x0FU #define VGA_CRT_CURSOR_LOW 0x0FU
/* Cursor position. Lives in BSS. */ /* Cursor position, lives in BSS. */
static uint8_t cursor_row; static uint8_t cursor_row;
static uint8_t cursor_col; static uint8_t cursor_col;
@ -27,11 +27,9 @@ static uint8_t cursor_col;
static volatile uint16_t *const vga = (uint16_t *)VGA_ADDR; static volatile uint16_t *const vga = (uint16_t *)VGA_ADDR;
/* Sync the blinking hardware cursor to cursor_row/cursor_col. /* Sync the blinking hardware cursor to cursor_row/cursor_col.
* WHY it exists: writing VGA cells alone never moves the CRT cursor, so
* without this the hardware cursor stays where SeaBIOS left it (issue #3).
* Runs at Ring 0 (CPL 0): `out` traps with #GP(0) if CPL > IOPL, so this * Runs at Ring 0 (CPL 0): `out` traps with #GP(0) if CPL > IOPL, so this
* must never run in userspace. A wrong port value cannot fault (open bus * must never run in userspace. A wrong port value cannot fault,
* ignores it); it would only misplace the visible cursor. */ * it would only misplace the visible cursor. */
static void update_hw_cursor(void) static void update_hw_cursor(void)
{ {
uint16_t pos = (uint16_t)(cursor_row * VGA_WIDTH + cursor_col); uint16_t pos = (uint16_t)(cursor_row * VGA_WIDTH + cursor_col);