Skip to main content

Module serial

Module serial 

Source

Structsยง

AnsiStylingWriter ๐Ÿ”’
BootPrefixWriter ๐Ÿ”’
QueuedWriter ๐Ÿ”’
TxChunk ๐Ÿ”’

Constantsยง

ANSI_GREEN ๐Ÿ”’
ANSI_RED ๐Ÿ”’
ANSI_RESET ๐Ÿ”’
ANSI_VIOLET ๐Ÿ”’
TOKEN_BUF_CAP ๐Ÿ”’
TX_CHUNK_LEN ๐Ÿ”’
TX_QUEUE_LEN ๐Ÿ”’

Staticsยง

ASYNC_OUTPUT ๐Ÿ”’
BOOT_LOG_PREFIX_ENABLED ๐Ÿ”’
CMDLINE_BUF ๐Ÿ”’
Fixed-size buffer for kernel cmdline (up to 2KB). SAFETY: Written once during early boot (single-threaded, IRQs disabled), then read-only. Safe for concurrent reads after initialization.
CMDLINE_LEN ๐Ÿ”’
CMDLINE_READY ๐Ÿ”’
FORCE_LOCK ๐Ÿ”’
Raw spinlock for _print_force to prevent multi-core character interleaving. Uses a ticket-style test-and-set: 0 = free, 1 = locked.
PANIC_IN_PROGRESS ๐Ÿ”’
Flag indicating if the kernel is in a panic state. When true, serial output bypasses all locks to ensure messages are displayed.
SERIAL1 ๐Ÿ”’
Global serial port instance
SERIAL_AT_LINE_START ๐Ÿ”’
TX_DROPPED ๐Ÿ”’
TX_FORMAT ๐Ÿ”’
TX_QUEUE ๐Ÿ”’

Functionsยง

dropped_output
Number of runtime output chunks/format attempts dropped under saturation.
enter_emergency_mode
force_lock_acquire ๐Ÿ”’
force_lock_release ๐Ÿ”’
get_cmdline
Returns the stored kernel cmdline for /proc/cmdline.
init
Initialize the serial port
is_hex_word ๐Ÿ”’
Returns whether hex word.
is_token_char ๐Ÿ”’
Returns whether token char.
parse_cmdlineโš 
Parse kernel cmdline from UEFI bootloader boot arguments.
putc
Signal that the kernel has entered an emergency panic state. Write one raw byte to COM1 (used by debug breadcrumbs).
serial_task_main
Drain bounded bursts without waiting for the UART or yielding under its lock.
set_boot_log_prefix_enabled
Enable or disable Linux-style boot timestamps at the beginning of each line.