Browse Source

kernel: preallocate tables for high memory

K. Lange 2 years ago
parent
commit
9b912bbfd7
1 changed files with 4 additions and 1 deletions
  1. 4 1
      kernel/mem/mem.c

+ 4 - 1
kernel/mem/mem.c

@@ -79,7 +79,7 @@ kmalloc_real(
 		return (uintptr_t)address;
 	}
 
-	if (align && (placement_pointer & 0xFFFFF000)) {
+	if (align && (placement_pointer & 0x00000FFF)) {
 		placement_pointer &= 0xFFFFF000;
 		placement_pointer += 0x1000;
 	}
@@ -347,6 +347,9 @@ void paging_finalize(void) {
 	for (uintptr_t i = tmp_heap_start; i < KERNEL_HEAP_END; i += 0x1000) {
 		get_page(i, 1, kernel_directory);
 	}
+	for (unsigned int i = 0xE000; i <= 0xFFF0; i += 0x40) {
+		get_page(i << 16UL, 1, kernel_directory);
+	}
 
 	debug_print(NOTICE, "Setting directory.");
 	current_directory = clone_directory(kernel_directory);