maybe?
This commit is contained in:
parent
ac1eef983f
commit
f25003e0d6
@ -47,20 +47,14 @@ void user_input(char *input) {
|
|||||||
char base_str[16];
|
char base_str[16];
|
||||||
|
|
||||||
// Get input from your input source (you need to implement this)
|
// Get input from your input source (you need to implement this)
|
||||||
get_input(base_str);
|
strncpy(base_str, input + 3, sizeof(base_str) - 1); // Skip the command part
|
||||||
|
base_str[sizeof(base_str) - 1] = '\0'; // Null-terminate the base_str
|
||||||
|
|
||||||
// Check if the input matches the expected message
|
// Convert base_str to an integer (you need a suitable conversion function)
|
||||||
if (strcmp(base_str, "Enter base register value: ") == 0) {
|
|
||||||
// Input matches, proceed to read the value
|
|
||||||
get_input(base_str); // Assuming get_input reads the actual value
|
|
||||||
u32 base = digit_conver(base_str);
|
u32 base = digit_conver(base_str);
|
||||||
|
|
||||||
|
// Now you have the base register input, and you can use it as needed
|
||||||
umem_head = add_node(umem_head, base, 0x100, true, global_id++);
|
umem_head = add_node(umem_head, base, 0x100, true, global_id++);
|
||||||
} else {
|
|
||||||
// Input doesn't match the expected message
|
|
||||||
kprint("Invalid input format.\n");
|
|
||||||
// Handle the error or prompt the user again
|
|
||||||
}
|
|
||||||
} else if (strcmp(input, "LIST") == 0) {
|
} else if (strcmp(input, "LIST") == 0) {
|
||||||
kprint("***** FORWARD ****\n");
|
kprint("***** FORWARD ****\n");
|
||||||
print_list( umem_head, true);
|
print_list( umem_head, true);
|
||||||
|
Reference in New Issue
Block a user