This commit is contained in:
Jonathan Turner 2023-11-29 07:49:11 -05:00
parent 9a2c2ed2c5
commit 74a8432efb

View File

@ -1,5 +1,3 @@
#include <stdio.h>
#include <stdlib.h>
#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);