From 891f1010bbdc1351bda8d2a6139094a14bdfd5e1 Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Sat, 24 Feb 2024 14:47:25 -0600 Subject: kernel: string: add a strcpy function Add an implmentation of strcpy. This function is used in several places in the kernel to copy strings between memory addresses. Signed-off-by: Danny Holman --- kernel/init.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'kernel/init.c') diff --git a/kernel/init.c b/kernel/init.c index 195ce92..86567a4 100644 --- a/kernel/init.c +++ b/kernel/init.c @@ -1,8 +1,25 @@ -#include #include +#include +#include #include -void kernel_main(void) { - tty_init(); - kprintf("Hello world\n"); +void jump_userspace(void); + +char rootfs[1024]; + +int start_init(int argc, char* argv[]) { + return 0; +} + +void process_cmd(char *cmdline) { + char *token = strtok(cmdline, " "); + while (token != NULL) { + if (strncmp(token, "root=", 5) == 0) + strcpy(rootfs, &token[6]); + } +} + +void kernel_main(char *cmdline) { + kprintf("Box Kernel version %s\n", VERSION); + serial_init(); } -- cgit v1.2.3