From feeadfd1fa22fb4a7a1aeea7de7c50e0ff7452ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Kala=C5=A1=20=28Floxen=29?= Date: Mon, 13 Jul 2026 21:56:37 +0200 Subject: [PATCH] =?UTF-8?q?P=C5=99id=C3=A1n=20modul=20bootlog=20pro=20stav?= =?UTF-8?q?ov=C3=A9=20v=C3=BDpisy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/bootlog.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 kernel/bootlog.c diff --git a/kernel/bootlog.c b/kernel/bootlog.c new file mode 100644 index 0000000..acabe84 --- /dev/null +++ b/kernel/bootlog.c @@ -0,0 +1,35 @@ +/* + * AsterOS Kernel + * Autor: Pavel Kalas + * Rok: 2026 + * + */ + +/* + * Tento modul sjednocuje stavove vypisy jadra ve formatu [ STAV ] zprava. + * Poskytuje jednoduche helpery pro bezne uspesne a chybove hlaseni, + * aby byly boot/setup logy konzistentni na jednom miste. + */ + +#include "bootlog.h" + +#include "display.h" +#include "printk.h" + +void bootlog_state(const char *state, unsigned char state_color, const char *msg) { + display_set_color(0x0F, 0x00); + aster_print("[ "); + display_set_color(state_color, 0x00); + aster_print(state ? state : "NEZNAMY"); + display_set_color(0x0F, 0x00); + aster_print(" ] "); + printk("%s\n", msg ? msg : ""); +} + +void bootlog_ok(const char *msg) { + bootlog_state("HOTOVO", 0x0A, msg); +} + +void bootlog_error(const char *msg) { + bootlog_state("CHYBA", 0x0C, msg); +} \ No newline at end of file