diff --git a/com1.out b/com1.out index a59a741..7d4bdc4 100644 Binary files a/com1.out and b/com1.out differ diff --git a/iso/boot/kernel.elf b/iso/boot/kernel.elf index 997ad61..dda24bd 100755 Binary files a/iso/boot/kernel.elf and b/iso/boot/kernel.elf differ diff --git a/kernel.elf b/kernel.elf index 997ad61..dda24bd 100755 Binary files a/kernel.elf and b/kernel.elf differ diff --git a/kmain.c b/kmain.c index 273b1d1..d5803bf 100644 --- a/kmain.c +++ b/kmain.c @@ -3,11 +3,12 @@ int kmain(int retvalue) { + init_serial(); + log("serial connection established", 3); + log("Kernel started", 2); + clear(); puts("hello\nbrave\nnew\nworld"); - init_serial(); - serial_puts("Hello, brave new world. This is a message to let you know that the kernel has started.\n"); - serial_puts("This is a second message.\n"); return retvalue; } diff --git a/os.iso b/os.iso index d99faa0..9e62f36 100644 Binary files a/os.iso and b/os.iso differ diff --git a/serial.c b/serial.c index 55ec436..6fe07db 100644 --- a/serial.c +++ b/serial.c @@ -42,3 +42,24 @@ void serial_puts(const char* str) write_serial(str[i]); } } + +void log(const char* str, const int errlevel) +{ + switch (errlevel) + { + case 0: + serial_puts("[ERROR] "); + break; + case 1: + serial_puts("[WARNING] "); + break; + case 2: + serial_puts("[INFO] "); + break; + case 3: + serial_puts("[DEBUG] "); + break; + } + serial_puts(str); + serial_puts("\n"); +} diff --git a/serial.h b/serial.h index 07f4791..447024f 100644 --- a/serial.h +++ b/serial.h @@ -7,5 +7,6 @@ int init_serial(); int is_transmit_empty(); void write_serial(const char a); void serial_puts(const char* str); +void log(const char* str, const int errlevel); #endif