starkernel: item 4.4c/4.4d -- wire console_fb_init into boot, route emit_prefix to framebuffer

console_fb_init() (which calls vt100_init()) was never called anywhere in the
boot sequence -- only raw fb_init() ran, so vt100_putc() no-op'd on every
call and no console output (REPL, POST, boot logs) ever reached the
framebuffer, only the corner orientation-test blocks. Replace the raw
fb_init() call in kernel_main_deep() with console_fb_init() so the
framebuffer console actually comes up (4.4c).

emit_prefix() also wrote the "[VMName] " bracket text via raw_putc() only
(serial), never vt100_putc(), so the bracketed VM name never reached the
screen even once the framebuffer console was live. Mirror console_putc()'s
existing serial/framebuffer split there too (4.4d).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Robert Allan James
2026-08-11 08:13:10 -04:00
co-authored by Claude Sonnet 5
parent bf89b8239f
commit becaea7def
2 changed files with 22 additions and 8 deletions
+12 -2
View File
@@ -192,13 +192,23 @@ static void raw_putc(char c) {
#endif
}
/* Emit "[VMName] " directly via raw_putc — no recursion into console_putc */
/* Emit "[VMName] " to both serial (raw_putc) and, when available, the
* framebuffer (vt100_putc) -- mirrors console_putc()'s own serial/framebuffer
* split so the prefix reaches both outputs, not serial only. No recursion
* into console_putc itself (would re-trigger the line-start prefix check). */
static void emit_prefix(void) {
const char *p;
int fb = fb_is_available();
raw_putc('[');
for (p = g_active_vm_name; *p; p++) raw_putc(*p);
if (fb) vt100_putc('[');
for (p = g_active_vm_name; *p; p++) {
raw_putc(*p);
if (fb) vt100_putc(*p);
}
raw_putc(']');
if (fb) vt100_putc(']');
raw_putc(' ');
if (fb) vt100_putc(' ');
}
/**
+10 -6
View File
@@ -827,11 +827,15 @@ static void kernel_main_deep(BootInfo *boot_info) {
#endif
/*
* FABRIC.md item 4.3.1 -- raw framebuffer boot diagnostic.
* console.c / vt100.c are superseded by the Console drawing-fabric
* redesign (FABRIC.md §27) and are deliberately not invoked here.
* fb_init() wires the raw GOP framebuffer directly; the orientation
* test pattern is drawn on a blank framebuffer, nothing else touches it.
* FABRIC.md item 4.3.1 -- raw framebuffer boot diagnostic, plus 4.4c
* (2026-08-11): console_fb_init() wires the framebuffer AND turns on
* vt100_init(), so serial and framebuffer consoles carry identical
* output from here on -- Captain Bob's stated end goal. Previously only
* raw fb_init() ran and console.c/vt100.c's framebuffer path was
* deliberately skipped ("superseded by the Console drawing-fabric
* redesign"); that left vt100_putc() permanently uninitialized and no
* console output ever reached the screen. console_fb_init() calls
* fb_init() internally, so this replaces the old call, not adds to it.
*/
if (boot_info->framebuffer.base != NULL && boot_info->framebuffer.size > 0) {
FbPixelFormat fb_fmt;
@@ -840,7 +844,7 @@ static void kernel_main_deep(BootInfo *boot_info) {
case (UINT32)PixelBlueGreenRedReserved8BitPerColor: fb_fmt = FB_PIXEL_BGRX32; break;
default: fb_fmt = FB_PIXEL_BGRX32; break;
}
fb_init(&boot_info->framebuffer, fb_fmt);
console_fb_init(&boot_info->framebuffer, fb_fmt);
fb_draw_orientation_test();
}