Skip to main content

Module console_mode

Module console_mode 

Source
Expand description

Console rendering mode selection.

The framebuffer console has two very different cost profiles:

  • Full : the complete graphical console: decorative boot art, status bar, scrollback scrollbar, mouse/text cursors, dirty-rect double buffering. This is what interactive use (top, panels, TUI) expects.
  • Lite : a deliberately boring, DOS-like text console: no decoration, no status bar, no cursor sprites, no scrollbar, no graphical UI. Every line of text still reaches the screen, but the only pixels written are glyph cells, and scrolling is a single bulk row move.
  • Serial : no framebuffer touches at all: /dev/vasistas stays absent and everything is logged to COM1. On a laptop this makes boot as fast as the hardware allows, and debugging happens over a USB-serial adapter (or QEMU -serial file:).

Selection is a boot parameter so a machine can be switched without recompiling: console.mode=lite (see /boot/strat9.cfg on the ESP). Without an explicit value we pick Lite on bare metal and Full under a hypervisor, where the graphical console is known to be cheap and is also what the test suite screenshots.

Re-exportsยง

use core::sync::atomic::AtomicU32; ๐Ÿ”’
use core::sync::atomic::AtomicU8; ๐Ÿ”’
use core::sync::atomic::Ordering; ๐Ÿ”’
use strat9_abi::boot::KernelArgs; ๐Ÿ”’

Enumsยง

ConsoleMode
Framebuffer console rendering mode.

Constantsยง

DEFAULT_FPS ๐Ÿ”’
Default console refresh rate.
TIMER_HZ ๐Ÿ”’
Timer tick rate, matching PRESENT_MIN_TICKS in the framebuffer layer.

Staticsยง

CONSOLE_MODE ๐Ÿ”’
0 means โ€œnot selected yetโ€.
PRESENT_INTERVAL_TICKS ๐Ÿ”’
Frame budget in scheduler ticks (0 = not configured).

Functionsยง

current
Currently selected console mode.
decode ๐Ÿ”’
hypervisor_present ๐Ÿ”’
CPUID.01H:ECX[31] : a hypervisor is present.
is_lite
True when the lightweight text console is active.
is_serial
True when the framebuffer must not be touched at all.
present_min_ticks
Minimum number of scheduler ticks between two console presents.
select
Pick and publish the console mode from the boot environment.