mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-31 14:38:21 +00:00
Initial commit
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
objects := $(patsubst %.c,%.o,$(wildcard *.c))
|
||||
subdirs :=
|
||||
OBJPATH=$(OBJDIR)/video
|
||||
export
|
||||
|
||||
all: $(subdirs) $(objects)
|
||||
for subdir in $(subdirs) ; do $(MAKE) -C $${subdir} ; done
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -o $@ $<
|
||||
mkdir -p $(OBJPATH)
|
||||
cp $@ $(OBJPATH)/$@
|
||||
@@ -0,0 +1,20 @@
|
||||
// console.c
|
||||
//
|
||||
// provides the kernel with an abstraction over other possible console drivers.
|
||||
// for example, console_putc is called by putchar() from stdio.h
|
||||
//
|
||||
|
||||
#include <kernel/console.h>
|
||||
#include <stddef.h>
|
||||
|
||||
static void(*writehook)(char*, size_t);
|
||||
|
||||
void console_setwritehook(void(*hook)(char*, size_t)){
|
||||
writehook = hook;
|
||||
}
|
||||
|
||||
void console_putc(char c){
|
||||
|
||||
writehook(&c, 1);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
// logging.c
|
||||
//
|
||||
// provides a few preformatted logging functions for the kernel
|
||||
//
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
// TODO
|
||||
//
|
||||
// allow it to be formated using a call for vprintf
|
||||
|
||||
void loginfo(char* str){
|
||||
printf("[\033[94mINFO\033[0m] %s", str);
|
||||
}
|
||||
|
||||
void logwarn(char* str){
|
||||
printf("[\033[93mWARN\033[0m] %s", str);
|
||||
}
|
||||
|
||||
void logerror(char* str){
|
||||
printf("[\033[91mERROR\033[0m] %s", str);
|
||||
}
|
||||
|
||||
void logfatal(char* str){
|
||||
printf("[\033[31mFATAL\033[0m] %s", str);
|
||||
}
|
||||
Reference in New Issue
Block a user