logger fixes

This commit is contained in:
2026-10-12 15:51:58 +02:00
parent eabce70866
commit 350e65837b
5 changed files with 69 additions and 25 deletions
+8 -5
View File
@@ -13,10 +13,17 @@ void console_write(const char* buf, size_t len) {
spin_unlock(&console_lock);
}
static void console_replay_write(void* ctx, const char* buf, size_t len) {
struct console* con = ctx;
con->write(con, buf, len);
}
bool console_register(struct console* con) {
if (!con->init(con))
return false;
con->write(con, "\ec", 2);
log_replay(console_replay_write, con);
spin_lock(&console_lock);
con->next = registered;
registered = con;
@@ -37,8 +44,4 @@ void console_unregister(struct console* con) {
spin_unlock(&console_lock);
}
[[__init]]
static void console_stage_init(struct boot_info*) {
kprintf("\ec");
}
INIT_TASK(console_stage, "core.console", console_stage_init);
INIT_TASK(console_stage, "core.console");