Skip to content

Commit

Permalink
Don't repeat the task name when printing the model
Browse files Browse the repository at this point in the history
When printing the initial model message on DEBUG it repeated the "init"
message twice. Avoid that by directly using 'write' on some of the
calls.

Fixes: 32e8801 ("Prepend the name of the task on debug")

Signed-off-by: Miquel Sabaté Solà <[email protected]>
  • Loading branch information
mssola committed Dec 2, 2024
1 parent 6132623 commit 7b1b8eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/fbos/printk.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#ifdef __KERNEL__
extern void die(const char *const message);
extern void printk(const char *const message);
extern void write(const char *const message, size_t n);
extern void sys_write(const char *const message, size_t n);
#else
#include <stdio.h>
Expand Down
5 changes: 3 additions & 2 deletions kernel/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <fbos/printk.h>
#include <fbos/mm.h>
#include <fbos/sched.h>
#include <fbos/string.h>
#include <fbos/dt.h>

// Stack to be used by our processes. "Blasphemy!" I hear you say. "How dare you
Expand Down Expand Up @@ -46,8 +47,8 @@ __noreturn __kernel void start_kernel(void *dtb)
// If we were able to fetch the model, print it now.
if (info.model[0] != '\0') {
printk("Running on: ");
printk(info.model);
printk("\n");
write(info.model, strlen(info.model));
write("\n", 1);
}

// At this point everything has already been handled: setup the interrupt
Expand Down

0 comments on commit 7b1b8eb

Please sign in to comment.