reimplmenets the previous iteration with a brand new custom build system
This commit is contained in:
38
kernel/klog.c
Normal file
38
kernel/klog.c
Normal file
@ -0,0 +1,38 @@
|
||||
#include <stddef.h>
|
||||
|
||||
#include <kernel/_kernel.h>
|
||||
#include <kernel/serial.h>
|
||||
|
||||
enum log_mode {
|
||||
LOG_ERR,
|
||||
LOG_WARN,
|
||||
LOG_INFO,
|
||||
};
|
||||
|
||||
void klog(const char* buf, enum log_mode mode)
|
||||
{
|
||||
switch(mode) {
|
||||
case LOG_ERR:
|
||||
serial_writestring("ERROR: ");
|
||||
break;
|
||||
case LOG_WARN:
|
||||
serial_writestring("WARNING: ");
|
||||
break;
|
||||
case LOG_INFO:
|
||||
serial_writestring("INFO: ");
|
||||
break;
|
||||
}
|
||||
serial_writestring(buf);
|
||||
serial_writestring("\n");
|
||||
}
|
||||
|
||||
void kerror(const char* buf)
|
||||
{klog(buf, LOG_ERR);}
|
||||
|
||||
void kwarn(const char* buf)
|
||||
{klog(buf, LOG_WARN);}
|
||||
|
||||
void kinfo(const char* buf)
|
||||
{klog(buf, LOG_INFO);}
|
||||
|
||||
|
Reference in New Issue
Block a user