Nucleus
Barry Interrupt handlers b33d632 (3 years, 3 months ago)
diff --git a/memory/frame.c b/memory/frame.c
index 35b2fed..40075b0 100644
--- a/memory/frame.c
+++ b/memory/frame.c
@@ -7,7 +7,8 @@
#include <stdint.h>
#include <stddef.h>
-#include "memory.h"
+#include <nucleus/memory.h>
+#include <nucleus/panic.h>
/* Types of an E820 Memory Map Entry */
enum E820Type {
@@ -56,6 +57,7 @@ init_frames(uint32_t size, void *addr)
* memory. This map must be read so the memory manager can avoid bad
* areas of memory and areas that are mapped to hardware, ACPI, etc.
*/
+
size_t i, j;
struct E820Entry *memMap = addr;
for (i = 0; i < size / sizeof(struct E820Entry); i++) {
@@ -64,7 +66,11 @@ init_frames(uint32_t size, void *addr)
|| memMap[i].type != E820_USABLE)
continue;
- for (j = 0; j < memMap[i].length; j += PAGE_SIZE)
+ for (j = 0; j < memMap[i].length; j += PAGE_SIZE) {
+ if ((memMap[i].base + j) >= 0x100000
+ && (memMap[i].base + j) < 0x180000)
+ continue;
free_frame(memMap[i].baseHigh + memMap[i].base + j);
+ }
}
}