diff options
| author | Miquel Sabaté Solà <mikisabate@gmail.com> | 2024-11-22 16:43:36 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mikisabate@gmail.com> | 2024-11-22 16:43:36 +0100 |
| commit | 224ed7b13ceadd05d27e61d3a0fdd34beb0c7745 (patch) | |
| tree | 30048a428833610202f59df64b662b27a4e5483e | |
| parent | 36a3989842bf813bd807a0be6ba6f6ebee684872 (diff) | |
| download | fbos-224ed7b13ceadd05d27e61d3a0fdd34beb0c7745.tar.gz fbos-224ed7b13ceadd05d27e61d3a0fdd34beb0c7745.zip | |
Fix initrd parsing because of a path change
In commit 573a8c6b490a ("usr: Rename foo/bar to fizz/buzz") the path of
the user-space binaries have changed. The `initrd` parsing code makes
some decisions based on that naming, and so it needed to be updated as
well.
Fixes: 573a8c6b490a ("usr: Rename foo/bar to fizz/buzz")
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
| -rw-r--r-- | include/fbos/sched.h | 6 | ||||
| -rw-r--r-- | kernel/initrd.c | 14 | ||||
| -rw-r--r-- | kernel/main.c | 8 |
3 files changed, 14 insertions, 14 deletions
diff --git a/include/fbos/sched.h b/include/fbos/sched.h index ff56f32..6a59756 100644 --- a/include/fbos/sched.h +++ b/include/fbos/sched.h @@ -6,9 +6,9 @@ enum task_id { TASK_UNKNOWN = -1, TASK_INIT = 0, - TASK_FOO = 1, - TASK_BAR = 2, - TASK_FOOBAR = 3, + TASK_FIZZ = 1, + TASK_BUZZ = 2, + TASK_FIZZBUZZ = 3, }; struct task_struct { diff --git a/kernel/initrd.c b/kernel/initrd.c index 4706fe8..a5c8861 100644 --- a/kernel/initrd.c +++ b/kernel/initrd.c @@ -3,7 +3,7 @@ #include <fbos/printk.h> #include <fbos/string.h> -#define BUFFER_SIZE 16 +#define BUFFER_SIZE 32 #define CPIO_HEADER_FILESIZE 54 #define CPIO_HEADER_NAMESIZE 94 @@ -53,12 +53,12 @@ __kernel uint64_t strtoul16(const char *str, size_t count) __kernel int get_task_id_from_name(const char *const name) { - if (strcmp(name, "usr/bin/foo") == 0) { - return TASK_FOO; - } else if (strcmp(name, "usr/bin/bar") == 0) { - return TASK_BAR; - } else if (strcmp(name, "usr/bin/foobar") == 0) { - return TASK_FOOBAR; + if (strcmp(name, "usr/bin/fizz") == 0) { + return TASK_FIZZ; + } else if (strcmp(name, "usr/bin/buzz") == 0) { + return TASK_BUZZ; + } else if (strcmp(name, "usr/bin/fizzbuzz") == 0) { + return TASK_FIZZBUZZ; } return TASK_UNKNOWN; } diff --git a/kernel/main.c b/kernel/main.c index ec8fabd..968c9d5 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -7,10 +7,10 @@ unsigned long init_stack[4][THREAD_SIZE / sizeof(unsigned long)]; struct task_struct tasks[4] = { - [0] = { .stack = init_stack[0] }, - [1] = { .stack = init_stack[1] }, - [2] = { .stack = init_stack[2] }, - [3] = { .stack = init_stack[3] }, + [TASK_INIT] = { .stack = init_stack[0], .addr = nullptr, .entry_offset = 0, }, + [TASK_FIZZ] = { .stack = init_stack[1], .addr = nullptr, .entry_offset = 0, }, + [TASK_BUZZ] = { .stack = init_stack[2], .addr = nullptr, .entry_offset = 0, }, + [TASK_FIZZBUZZ] = { .stack = init_stack[3], .addr = nullptr, .entry_offset = 0, }, }; /* |
