15#include <kernel/version.h>
56 for (
size_t i = 0; i <
count; i++)
86 LOG_INFO(
"Booting %s-kernel %s (Built %s %s)\n", OS_NAME, OS_VERSION, __DATE__, __TIME__);
88 LOG_INFO(
"Booting %s-kernel DEBUG %s (Built %s %s)\n", OS_NAME, OS_VERSION, __DATE__, __TIME__);
90 LOG_INFO(
"Copyright (C) 2025 Kai Norberg. MIT Licensed.\n");
130 for (
uint64_t i = 0; i < length; i++)
136 for (
uint64_t i = 0; i < length; i++)
201 for (
uint64_t i = 0; i < length; i++)
236 for (
int i = 0; i < length; i++)
#define assert(expression)
EFI_PHYSICAL_ADDRESS buffer
static char format[MAX_NAME]
void com_write(com_port_t port, uint8_t value)
void com_init(com_port_t port)
#define SELF
Macro to access data in the current cpu.
dentry_t * devfs_file_new(dentry_t *parent, const char *name, const vnode_ops_t *vnodeOps, const file_ops_t *fileOps, void *data)
Create a new file inside a mounted devfs instance.
boot_info_t * boot_info_get(void)
Gets the boot info structure.
void screen_init(void)
Initialize and enable the screen logging.
void screen_write(const char *string, uint64_t length)
Write a string to the screen.
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_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_expose(void)
Expose kernel logs via the /dev/klog file.
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.
#define UNUSED(x)
Mark a variable as unused.
clock_t uptime(void)
System call for retreving the time since boot.
#define NULL
Pointer error value.
__UINT64_TYPE__ clock_t
A nanosecond time.
static void log_splash(void)
static size_t klog_write(file_t *file, const void *buffer, size_t count, size_t *offset)
static const char * levelNames[]
static size_t klog_read(file_t *file, void *buffer, size_t count, size_t *offset)
static bool isLastCharNewline
static file_ops_t klogOps
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)
static char klogBuffer[CONFIG_KLOG_SIZE]
#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,...)
Directory entry structure.
File operations structure.
size_t(* read)(file_t *file, void *buffer, size_t count, size_t *offset)
A simple ticket lock implementation.