Expand description
Panic-safe framebuffer drawing.
Provides a set of globals and direct-draw functions that allow the panic
handler to render a visual panic screen even when VGA_WRITER is locked
by the faulting context. The framebuffer parameters are snapshotted once
during vga::init() via init_panic_fb_globals() and are read-only
afterwards, making them safe to access from the panic path without any
locking.
Constantsยง
- PANIC_
SCREEN_ ๐MAX_ LINES - Maximum number of lines for the panic screen.
Staticsยง
- PANIC_
FB_ ๐ADDR - Raw framebuffer virtual address (HHDM-mapped), 0 if framebuffer is not available.
- PANIC_
FB_ ๐FORMAT - Packed pixel-format info: (bpp << 32) | (red_shift << 24) | (green_shift << 16) | (blue_shift << 8) | format_flags
- PANIC_
FB_ ๐HEIGHT - Framebuffer height in pixels.
- PANIC_
FB_ ๐PITCH - Framebuffer pitch in bytes.
- PANIC_
FB_ ๐WIDTH - Framebuffer width in pixels.
- PANIC_
FONT_ ๐8X16 - Minimal 8ร16 bitmap font for panic-screen rendering (ASCII 0x20โ0x7E). Each glyph is 16 bytes (one byte per row, MSB = leftmost pixel). Derived from the standard VGA 8ร16 ROM font.
Functionsยง
- init_
panic_ fb_ globals - Initialise the panic-screen framebuffer globals. Must be called once from vga::init() after configure() succeeds.
- panic_
draw_ ๐char - Draw a single character at (x, y) using the panic font.
fgandbgare packed pixel-colour values for the current pixel format. - panic_
draw_ direct - Draw the full panic screen directly to the framebuffer (no locking).
- panic_
draw_ ๐str - Draw a NUL-terminated ASCII string at (x, y) using the panic framebuffer. Returns the X position after the last character.
- panic_
font_ ๐8x16 - panic_
pack_ ๐rgb - Pack RGB into a u32 using the pixel-format globals.