Skip to main content

Module vga

Module vga 

Source
Expand description

Framebuffer text console (Limine 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 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.
canvas πŸ”’
Canvas convenience drawing API : a thin wrapper around VgaWriter for drawing primitives.
cursor πŸ”’
Cursor manager for the framebuffer terminal.
debug_overlay πŸ”’
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Β§

Canvas
FramebufferInfo
RenderStats
SpriteRgba
TerminalWidget
TextMetrics
TextOptions
UiDockLayout
UiLabel
UiPanel
UiProgressBar
UiRect
UiTable
UiTheme
VgaWriter

EnumsΒ§

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

StaticsΒ§

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.
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_system_status_line
Performs the draw system status line 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.
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.
init_panic_fb_globals
Initialise the panic-screen framebuffer globals. Must be called once from vga::init() after configure() succeeds.
is_available
Returns whether available.
maybe_refresh_system_status_line
Performs the maybe refresh system status line operation.
measure_text
Performs the measure text operation.
panic_draw_direct
Draw the full panic screen directly to the framebuffer (no locking).
present
Performs the present operation.
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_double_buffer_mode
Sets double buffer mode.
set_status_hostname
Sets status hostname.
set_status_ip
Sets status ip.
set_text_color
Sets text color.
set_text_cursor
Sets text cursor.
set_ui_scale
Sets ui scale.
start_selection
Starts selection.
status_line_task_main
Performs the status line task main operation.
text_cols
Performs the text cols operation.
text_rows
Performs the text rows operation.
try_with_writer
Performs the try with writer operation.
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_status_bar
Performs the ui draw status 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.
vga_debug_init
Initialise or re-initialise the live debug writer’s geometry. Called automatically from vga::init().
vga_debug_write
Write a string directly to the VGA framebuffer in real time.
vga_debug_writeln
Write a newline-terminated line to the live VGA debug output.
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.