kernel: various changes.

+ kernel: replace sk-hello test executable with a test initramfs
+ panic: start implementing a proper kernel panic screen
+ lib: added a new string.h library for string manipulation.
+ kernel: replace all the strlen implementations with the strlen() function
This commit is contained in:
RaphProductions 2025-05-11 23:54:14 +02:00
parent 7fb04f134b
commit a838d99a5a
19 changed files with 173 additions and 149 deletions

View file

@ -1,6 +1,7 @@
#include "sys/arch/x86_64/io.h"
#include "sys/gfx/flanterm/flanterm.h"
#include <lib/spinlock.h>
#include <lib/string.h>
#include <stdarg.h>
#include <sys/printf.h>
@ -14,12 +15,8 @@ void log(char *format, ...) {
// TODO: replace this call with a call to printf() when the RTC is
// implemented.
char *date = "1970-01-01 00:00:00 | ";
int i2 = 0;
for (i2; date[i2] != 0; i2++)
;
;
if (ft_ctx)
flanterm_write(ft_ctx, date, i2);
flanterm_write(ft_ctx, date, strlen(date));
char buf[2048];
va_list l;
@ -27,14 +24,10 @@ void log(char *format, ...) {
npf_vsnprintf(buf, 2048, format, l);
va_end(l);
int i = 0;
for (i; buf[i] != 0; i++)
;
;
if (ft_ctx)
flanterm_write(ft_ctx, buf, i);
flanterm_write(ft_ctx, buf, strlen(buf));
for (int i = 0;; i++) {
/*for (int i = 0;; i++) {
if (date[i] == '\0')
break;
@ -46,7 +39,7 @@ void log(char *format, ...) {
break;
outb(0xE9, buf[i]);
}
}*/
// spinlock_release(&log_lock);
}