Skip to main content

Module vga

Module vga 

Source
Expand description

Framebuffer text console (UEFI bootloader framebuffer + PSF font). https://en.wikipedia.org/wiki/PC_Screen_Font

Keeps the existing vga_print! / vga_println! API but renders text into the graphical framebuffer when available. Falls back to serial otherwise.

ยงModule structure

  • types : Color, RgbColor, UiTheme, layout types, terminal widget
  • font : PSF font parsing (PSF1/PSF2 + unicode map)
  • writer : VgaWriter struct: glyph rendering, scrollback, cursors, double-buffering, dirty-rect tracking, present
  • canvas : Canvas convenience drawing API
  • api : Public free functions, VGA_WRITER static, init()
  • panic_screen : Lock-free panic framebuffer drawing
  • debug_overlay : Live debug overlay (bypasses VGA_WRITER)
  • status_line : Status bar kthread and rendering

Re-exportsยง

pub use canvas::Canvas;
pub use console_mode::current as console_mode;
pub use console_mode::is_lite;
pub use console_mode::is_serial;
pub use console_mode::present_min_ticks;
pub use console_mode::select as select_console_mode;
pub use console_mode::ConsoleMode;
pub use writer::VgaWriter;
pub use status_line::draw_system_status_line;
pub use status_line::maybe_refresh_system_status_line;
pub use status_line::set_status_hostname;
pub use status_line::set_status_ip;
pub use status_line::status_line_task_main;
pub use status_line::ui_draw_status_bar;
pub use debug_overlay::vga_debug_init;
pub use debug_overlay::vga_debug_write;
pub use debug_overlay::vga_debug_writeln;
pub use panic_screen::init_panic_fb_globals;
pub use panic_screen::panic_draw_direct;
pub use crate::framebuffer::RgbColor;

Modulesยง

api ๐Ÿ”’
Public VGA API surface : free functions, the global VGA_WRITER, and the vga_print! / vga_println! macros that the rest of the kernel uses to talk to the framebuffer console.
boot_progress
Pastel boot-progress bar drawn along the bottom of the framebuffer.
canvas ๐Ÿ”’
Canvas convenience drawing API : a thin wrapper around VgaWriter for drawing primitives.
console_mode ๐Ÿ”’
Console rendering mode selection.
cursor ๐Ÿ”’
Cursor manager for the framebuffer terminal.
debug_overlay ๐Ÿ”’
fastfb ๐Ÿ”’
Wide-store helpers for the linear framebuffer.
font ๐Ÿ”’
PSF (PC Screen Font) font parsing.
panic_screen ๐Ÿ”’
Panic-safe framebuffer drawing.
scrollback ๐Ÿ”’
Scrollback buffer for the framebuffer terminal.
status_line ๐Ÿ”’
types ๐Ÿ”’
VGA color types, UI theme/layout types, and terminal widget types.
writer ๐Ÿ”’

Structsยง

FramebufferInfo
PixelFormat
RenderStats
SpriteRgba
TerminalLine
TerminalWidget
TextMetrics
TextOptions
UefiFbGeometry
Geometry of the framebuffer handed over by the UEFI bootloader.
UiDockLayout
UiLabel
UiPanel
UiProgressBar
UiRect
UiTable
UiTheme

Enumsยง

Color
VGA colors mapped to RGB for text rendering.
DockEdge
TextAlign
UiScale

Constantsยง

CLIPBOARD_CAP
FPS_REFRESH_PERIOD_TICKS

Staticsยง

CLIPBOARD
FPS_ESTIMATE
FPS_LAST_FRAME_COUNT
FPS_LAST_TICK
UEFI_FB
UI_SCALE
VGA_AVAILABLE
VGA_WRITER

Functionsยง

begin_frame
Performs the begin frame operation.
blit_rgb
Performs the blit rgb operation.
blit_rgb24
Performs the blit rgb24 operation.
blit_rgba
Performs the blit rgba operation.
blit_sprite_rgba
Performs the blit sprite rgba operation.
clear_selection
Performs the clear selection operation.
color_to_rgb
Performs the color to rgb operation.
current_fps
Performs the current fps operation.
current_ui_scale
Performs the current ui scale operation.
double_buffer_mode
Performs the double buffer mode operation.
draw_line
Performs the draw line operation.
draw_pixel
Performs the draw pixel operation.
draw_pixel_alpha
Performs the draw pixel alpha operation.
draw_rect
Performs the draw rect operation.
draw_strata_stack
Performs the draw strata stack operation.
draw_text
Performs the draw text operation.
draw_text_at
Performs the draw text at operation.
draw_text_cursor
Performs the draw text cursor operation.
end_frame
Performs the end frame operation.
end_selection
Performs the end selection operation.
fill_rect
Performs the fill rect operation.
fill_rect_alpha
Performs the fill rect alpha operation.
flush_display
Request console rasterization and presentation at the next eligible tick. The console-render task also services the final fragment when output stops.
framebuffer_info
Performs the framebuffer info operation.
get_clipboard_text
Returns clipboard text.
get_text_cursor
Returns text cursor.
glyph_size
Performs the glyph size operation.
height
Performs the height operation.
hide_mouse_cursor
Performs the hide mouse cursor operation.
hide_text_cursor
Performs the hide text cursor operation.
init
Performs the init operation.
is_available
Returns whether available.
measure_text
Performs the measure text operation.
parse_ansi_color_prefix
Parses ansi color prefix.
present
Performs the present operation.
publish_uefi_fb_geometry
render_stats
Returns lightweight render metrics for profiling.
reset_clip_rect
Performs the reset clip rect operation.
screen_size
Performs the screen size operation.
scroll_to_live
Return immediately to the live (bottom) view.
scroll_view_down
Scroll the console view down (forward, toward live output) by lines lines.
scroll_view_up
Scroll the console view up (backward in history) by lines lines.
scrollbar_click
Handle a click at framebuffer pixel (px_x, px_y). If the click lands on the scrollbar, jump the view accordingly.
scrollbar_drag_to
Drag the scrollbar to a given Y pixel coordinate.
scrollbar_hit_test
Returns true if (px_x, px_y) falls within the scrollbar strip.
set_clip_rect
Sets clip rect.
set_console_defer_present
Set or clear the console-defer-present flag. When true, write_bytes() skips present : only marks dirty. Call flush_display() to trigger the actual present.
set_double_buffer_mode
Sets double buffer mode.
set_text_color
Sets text color.
set_text_cursor
Sets text cursor.
set_ui_scale
Sets ui scale.
start_selection
Starts selection.
supports_char
Whether the loaded PSF font can actually render ch.
text_cols
Performs the text cols operation.
text_rows
Performs the text rows operation.
try_with_writer
Performs the try with writer operation.
uefi_framebuffer
Framebuffer geometry published by the bootloader, if any.
ui_clear
Performs the ui clear operation.
ui_draw_label
Performs the ui draw label operation.
ui_draw_panel
Performs the ui draw panel operation.
ui_draw_panel_widget
Performs the ui draw panel widget operation.
ui_draw_progress_bar
Performs the ui draw progress bar operation.
ui_draw_table
Performs the ui draw table operation.
ui_layout_screen
Performs the ui layout screen operation.
ui_scale
Performs the ui scale operation.
ui_scale_px
Performs the ui scale px operation.
update_mouse_cursor
Updates mouse cursor.
update_selection
Updates selection.
width
Performs the width operation.
with_writer
Performs the with writer operation.
write_char
Writes one console character to the framebuffer console.
write_text
Writes raw console text to the framebuffer console in a single writer batch.