From 5185fe98d404c6c15a52f513313042ced16c350a Mon Sep 17 00:00:00 2001 From: salmonik Date: Sun, 2 Aug 2026 01:59:45 +0200 Subject: v0.5.5: self-diagnosing boot — vt refuses 0x0 geometry, panic band shows last stage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The user's real-hardware boot showed 'PANIC: index out of bounds (len 0, index 0) at vt.rs:146' — the vt grid was created empty because the framebuffer geometry was 0x0 at vt::init (GOP missing or the active mode reporting zero resolution). The v0.5.4 blank screen was the same panic, previously invisible (no screen dump in the panic handler). - vt::init: rows/cols == 0 now halts with a visible white-on-red 'FATAL: no framebuffer geometry — GOP missing or active mode is 0x0' band instead of building an empty grid that panics at the first cell write. - boot_marker records the last boot stage; the panic band appends it as a 4th line so a crash shows exactly how far boot got. - The gop+vt marker now carries the measured geometry ('rsnix: gop 800x600 vt 100x37 ok') so a good boot is self-confirming on the screen. - All 5 test suites pass; build/clippy clean. --- rsnix/src/vt.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'rsnix/src/vt.rs') diff --git a/rsnix/src/vt.rs b/rsnix/src/vt.rs index 53821b7..4578f6c 100644 --- a/rsnix/src/vt.rs +++ b/rsnix/src/vt.rs @@ -96,6 +96,26 @@ static mut CUR: usize = 0; /// Allocate the cell grid. Call once after `gop::init()`. pub fn init() { let (cols, rows) = gop::dims(); + if rows == 0 || cols == 0 { + // No usable framebuffer geometry: GOP is missing entirely or the + // active mode reports 0x0. Without a display there is nothing + // the shell can do, so stop with a visible explanation instead + // of building an empty grid and panicking at the first cell + // write (a blank screen on real hardware, which has no serial + // console). + let lines = [ + "FATAL: no framebuffer geometry", + "GOP missing or active mode is 0x0", + "see the 'gop:' boot marker / serial log", + ]; + crate::gop::dump_lines(&lines); + crate::serial_println!("FATAL: no framebuffer geometry (GOP missing or 0x0 mode)"); + loop { + unsafe { + core::arch::asm!("cli; hlt"); + } + } + } unsafe { ROWS = rows; COLS = cols; -- cgit v1.2.3