Structsยง
- Ansi
Styling ๐Writer - Boot
Prefix ๐Writer - Queued
Writer ๐ - 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_forceto 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.