Skip to main content

Module kprint

Module kprint 

Source
Expand description

Kernel print macro ([kprint!]) and the logging state behind it.

Authors: MarioS271

Structsยง

KernelPrintState ๐Ÿ”’
All mutable state for the kprint subsystem, protected by an IrqMutex.
KernelWriter
RAII handle that holds the KPRINT_STATE lock for one kprint! call, preventing interleaved output.

Enumsยง

LogLevelColor

Constantsยง

LOG_BUFFER_SIZE ๐Ÿ”’
Capacity of the in-memory log ring buffer in bytes.

Staticsยง

KPRINT_STATE ๐Ÿ”’
Global logging state. Wrapped in IrqMutex so interrupt handlers can log safely.

Functionsยง

force_unlock_kprint_stateโš 
Release KPRINT_STATEโ€™s lock without restoring the interrupt flag, for panic paths.
kprint ๐Ÿ”’
Write string to the ring buffer, serial port, and framebuffer (if each is initialized).
write_log_buf ๐Ÿ”’
Append s to the ring buffer, advancing the tail when the head laps it.