After commit
f57ca0bbc402 ("plat/kvm/x86: Make zero page inaccessible"),
early accesses to uninitialized VGA framebuffer would issue an unhandled
page fault and thus crashing the application. Solve this by
preinitializing the `terminal_buffer` variable.
Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #1136
#define TAB_ALIGNMENT 8
#define VGA_WIDTH 80
#define VGA_HEIGHT 25
+#define VGA_FB_BASE 0xb8000
static size_t terminal_row;
static size_t terminal_column;
static uint8_t terminal_color;
-static uint16_t *terminal_buffer;
+static uint16_t *const terminal_buffer = (uint16_t *)VGA_FB_BASE;
static uint16_t areg; /* VGA address register */
static uint16_t dreg; /* VGA data register */
outb(dreg, 0x0f);
local_irq_restore(irq_flags);
- terminal_buffer = (uint16_t *) 0xb8000;
clear_terminal();
}