maybe?
This commit is contained in:
parent
9a2c2ed2c5
commit
74a8432efb
@ -1,5 +1,3 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include "kernel.h"
|
#include "kernel.h"
|
||||||
|
|
||||||
// This only runs once and from there on forth only interrupts will cause something to happen
|
// 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++);
|
// umem_head = add_node( umem_head, 0x10000, 0x100, true, global_id++);
|
||||||
// }
|
// }
|
||||||
} else if (strncmp(input, "ADD", 3) == 0) {
|
} else if (strncmp(input, "ADD", 3) == 0) {
|
||||||
// Extract size and offset from the input
|
// Parse the base register value from the user input
|
||||||
char size_str[10];
|
char base_str[16];
|
||||||
char offset_str[10];
|
kprint("Enter base register value: ");
|
||||||
sscanf(input, "ADD %s %s", size_str, offset_str);
|
kread(base_str);
|
||||||
|
u32 base = atoi(base_str);
|
||||||
|
|
||||||
// Convert size and offset to integers
|
umem_head = add_node(umem_head, base, 0x100, true, global_id++);
|
||||||
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++);
|
|
||||||
} 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