Imaginarium

Log Ring

Imaginarium’s log ring is fully lock-free for enqueues, requires only a spin-trylock to flush writers, and is smp-safe for both reads and writes.

The log ring is implemented as a direct port of the implementation in Ultra to zig, which is in turn heavily based on the log ring used for kprint in the linux kernel.

Bootloader Logs

The Tabula Protocol provides a list of its log entries in reclaimable memory, generated in a much simpler manner due to the lack of multithreading in the loader. All entries from that list are copied into the Imaginarium log ring at kernel startup.

Outputs

Log Ring Outputs can be registered or unregistered (not yet implemented) at any time, and may supplant earlier outputs (i.e. a proper serial port replacing a hardcoded debug port output). A log ring output may be started at the beginning of all logs, the current sequence number of the log ring, or the beginning of kernel logs (after the copied Tabula logs).