13#include <kernel/version.h>
42 LOG_INFO(
"Booting %s-kernel %s (Built %s %s)\n", OS_NAME, OS_VERSION, __DATE__, __TIME__);
44 LOG_INFO(
"Booting %s-kernel DEBUG %s (Built %s %s)\n", OS_NAME, OS_VERSION, __DATE__, __TIME__);
46 LOG_INFO(
"Copyright (C) 2025 Kai Norberg. MIT Licensed. See /usr/license/LICENSE for details.\n");
105 for (
uint64_t i = 0; i < length; i++)
180 for (
uint64_t i = 0; i < length; i++)
220 for (
int i = 0; i < length; i++)
#define assert(expression)
void com_write(com_port_t port, uint8_t value)
void com_init(com_port_t port)
static cpu_t * cpu_get_unsafe(void)
Gets the current CPU structure without disabling interrupts.
boot_info_t * boot_info_get(void)
Gets the boot info structure.
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.
void log_init(void)
Initialize the logging system.
void log_print(log_level_t level, const char *format,...)
Print a formatted log message.
#define LOG_INFO(format,...)
#define LOG_MAX_BUFFER
Maximum buffer size for various logging buffers.
void log_screen_disable(void)
Disable logging to the screen.
void log_nprint(log_level_t level, const char *string, uint64_t length)
Print a unformatted log message.
void log_vprint(log_level_t level, const char *format, va_list args)
Print a formatted log message with a va_list.
void log_screen_enable()
Enable logging to the screen.
log_output_t
Logging output options.
clock_t clock_uptime(void)
Retrieve the time in nanoseconds since boot.
#define LOCK_CREATE()
Create a lock initializer.
#define LOCK_SCOPE(lock)
Acquires a lock for the reminder of the current scope.
static void lock_release(lock_t *lock)
Releases a lock.
static void lock_acquire(lock_t *lock)
Acquires a lock, blocking until it is available.
clock_t uptime(void)
System call for retreving the time since boot.
__UINT64_TYPE__ clock_t
A nanosecond time.
static void log_splash(void)
static log_level_t minLevel
static log_output_t outputs
static const char * levelNames[]
static bool isLastCharNewline
static char lineBuffer[LOG_MAX_BUFFER]
static void log_handle_char(log_level_t level, char chr)
static void log_print_header(log_level_t level)
static char workingBuffer[LOG_MAX_BUFFER]
static bool firstHeaderPrinted
static void log_write(const char *string, uint64_t length)
#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 snprintf(char *_RESTRICT s, size_t n, const char *_RESTRICT format,...)
A simple ticket lock implementation.