potentially catch errors of adding addresses in kernel space.

This commit is contained in:
Jonathan Turner 2023-11-29 09:02:44 -05:00
parent b602894b81
commit 4ca6c64fdc

View File

@ -40,7 +40,11 @@
char *number = input + 4; char *number = input + 4;
kprint(number); kprint(number);
u32 result = digit_conver(number); u32 result = digit_conver(number);
if (result < 10000) {
kprint("That memory address is reserved by the Kernel, addresses must be 10000+");
} else {
umem_head = add_node( umem_head, result, 0x100, true, global_id++); umem_head = add_node( umem_head, result, 0x100, true, global_id++);
}
} else { } else {
umem_head = add_node( umem_head, 0x10000, 0x100, true, global_id++); umem_head = add_node( umem_head, 0x10000, 0x100, true, global_id++);
} }