From 32e880127366fabc3e8b4fecb642f1cc06b8fd71 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Mon, 2 Dec 2024 20:47:19 +0100 Subject: Prepend the name of the task on debug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 'printk' and 'sys_write' calls, prepend the name of the task that is being executed for each message. This is an easy way to show off that we are doing the right thing with the 'tp' register, even if we don't do much with it. Signed-off-by: Miquel Sabaté Solà --- kernel/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'kernel/main.c') diff --git a/kernel/main.c b/kernel/main.c index ecb93da..9c524c4 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -10,10 +10,10 @@ unsigned long stack[4][THREAD_SIZE / sizeof(unsigned long)]; // Initialize the list of structs by providing a fixed stack address and empty // values everywhere else. struct task_struct tasks[4] = { - [TASK_INIT] = { .stack = stack[0], .entry_addr = nullptr, }, - [TASK_FIZZ] = { .stack = stack[1], .entry_addr = nullptr, }, - [TASK_BUZZ] = { .stack = stack[2], .entry_addr = nullptr, }, - [TASK_FIZZBUZZ] = { .stack = stack[3], .entry_addr = nullptr, }, + [TASK_INIT] = { .stack = stack[0], .name = "init", .entry_addr = nullptr, }, + [TASK_FIZZ] = { .stack = stack[1], .name = "fizz", .entry_addr = nullptr, }, + [TASK_BUZZ] = { .stack = stack[2], .name = "buzz", .entry_addr = nullptr, }, + [TASK_FIZZBUZZ] = { .stack = stack[3], .name = "fizzbuzz", .entry_addr = nullptr, }, }; // Defined in fbos/init.h. -- cgit v1.2.3