12#include <kernel/version.h>
41 LOG_INFO(
"Booting %s-kernel %s (Built %s %s)\n", OS_NAME, OS_VERSION, __DATE__, __TIME__);
43 LOG_INFO(
"Booting %s-kernel DEBUG %s (Built %s %s)\n", OS_NAME, OS_VERSION, __DATE__, __TIME__);
45 LOG_INFO(
"Copyright (C) 2025 Kai Norberg. MIT Licensed. See /usr/license/LICENSE for details.\n");
101 for (
uint64_t i = 0; i < length; i++)
195 for (
int i = 0; i < length; i++)
void com_write(com_port_t port, uint8_t value)
void com_init(com_port_t port)
static cpu_t * smp_self_unsafe(void)
Returns a pointer to the cpu_t structure of the current CPU.
void log_file_flush_to_screen(void)
Flush the content of the log file to the screen.
void log_file_write(const char *string, uint64_t length)
Write a string to the kernel log file.
void log_screen_write(const char *string, uint64_t length)
Write a string to the screen.
void log_screen_init(const boot_gop_t *bootGop)
Initialize the screen logging.
uint64_t log_vprint(log_level_t level, const char *prefix, const char *format, va_list args)
Print a formatted log message with a va_list.
#define LOG_INFO(format,...)
#define LOG_MAX_BUFFER
Maximum buffer size for a single log line.
void log_screen_disable(void)
Disable logging to the screen.
uint64_t log_print(log_level_t level, const char *prefix, const char *format,...)
Print a formatted log message.
void log_write(const char *string, uint64_t length)
Write directly to the log outputs without any formatting or headers.
void log_screen_enable()
Enable logging to the screen.
void log_init(const boot_gop_t *gop)
Initialize the logging system.
log_output_t
Logging output options.
#define LOCK_CREATE
Create a lock initializer. @macro LOCK_CREATE.
#define LOCK_SCOPE(lock)
Acquires a lock for the reminder of the current scope.
clock_t timer_uptime(void)
Time since boot.
#define EINVAL
Invalid argument.
#define errno
Error number variable.
clock_t uptime(void)
System call for retreving the time since boot.
#define NULL
Pointer error value.
#define ERR
Integer error value.
__UINT64_TYPE__ clock_t
A nanosecond time.
static void log_splash(void)
static log_level_t minLevel
static void log_print_header(log_level_t level, const char *prefix)
static log_output_t outputs
static const char * levelNames[]
static bool isLastCharNewline
static void log_handle_char(log_level_t level, const char *prefix, char chr)
static char lineBuffer[LOG_MAX_BUFFER]
static char workingBuffer[LOG_MAX_BUFFER]
static bool firstHeaderPrinted
#define va_start(ap, parmN)
__builtin_va_list va_list
_PUBLIC int vsnprintf(char *_RESTRICT s, size_t n, const char *_RESTRICT format, va_list arg)
_PUBLIC int sprintf(char *_RESTRICT s, const char *_RESTRICT format,...)
A simple ticket lock implementation.