Skip to main content

Module serial

Module serial 

Source

Structsยง

AnsiStylingWriter ๐Ÿ”’
BootPrefixWriter ๐Ÿ”’

Constantsยง

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

Staticsยง

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 ๐Ÿ”’

Functionsยง

enter_emergency_mode
Signal that the kernel has entered an emergency panic state.
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 Limine boot arguments.
set_boot_log_prefix_enabled
Enable or disable Linux-style boot timestamps at the beginning of each line.