Files
jsix/src/kernel/debugcon.h
Justin C. Miller f05a1d3310 [kernel] Revive the debugcon logger as a kernel thread
The debugcon logger is now separate from logger::output, and is instead
a kernel-internal thread that watches for logs and prints them to the
deubcon device.
2023-02-08 22:32:01 -08:00

31 lines
528 B
C++

#pragma once
/// \file debugcon.h
/// Kernel debugcon log output process
#include "scheduler.h"
namespace debugcon {
static constexpr bool enable =
#ifdef __jsix_config_debug
true;
#else
false;
#endif
static constexpr uint16_t port = 0x6600;
void logger_task();
inline void
init_logger()
{
if constexpr (enable) {
static constexpr uint8_t pri = scheduler::max_priority - 1;
scheduler &s = scheduler::get();
s.create_kernel_task(logger_task, pri, true);
}
}
} // namespace debugcon