Skip to main content

Module panic_screen

Module panic_screen 

Source
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. fg and bg are 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.