diff --git a/Part3/09_memory/kernel/kernel.c b/Part3/09_memory/kernel/kernel.c index 209de19..2350625 100644 --- a/Part3/09_memory/kernel/kernel.c +++ b/Part3/09_memory/kernel/kernel.c @@ -1,5 +1,3 @@ -#include -#include #include "kernel.h" // This only runs once and from there on forth only interrupts will cause something to happen @@ -41,17 +39,13 @@ void user_input(char *input) { // umem_head = add_node( umem_head, 0x10000, 0x100, true, global_id++); // } } else if (strncmp(input, "ADD", 3) == 0) { - // Extract size and offset from the input - char size_str[10]; - char offset_str[10]; - sscanf(input, "ADD %s %s", size_str, offset_str); + // Parse the base register value from the user input + char base_str[16]; + kprint("Enter base register value: "); + kread(base_str); + u32 base = atoi(base_str); - // Convert size and offset to integers - u32 size = atoi(size_str); - u32 offset = atoi(offset_str); - - // Add the node with the specified base register - umem_head = add_node(umem_head, offset, size, true, global_id++); + umem_head = add_node(umem_head, base, 0x100, true, global_id++); } else if (strcmp(input, "LIST") == 0) { kprint("***** FORWARD ****\n"); print_list( umem_head, true);