summaryrefslogtreecommitdiff
path: root/i386/i386at/model_dep.c
diff options
context:
space:
mode:
Diffstat (limited to 'i386/i386at/model_dep.c')
-rw-r--r--i386/i386at/model_dep.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/i386/i386at/model_dep.c b/i386/i386at/model_dep.c
index 8975805..362ba7f 100644
--- a/i386/i386at/model_dep.c
+++ b/i386/i386at/model_dep.c
@@ -207,6 +207,11 @@ mem_size_init()
printf("AT386 boot: physical memory from 0x%x to 0x%x\n",
phys_first_addr, phys_last_addr);
+ /* Reserve 1/16 of the memory address space for virtual mappings.
+ * Yes, this loses memory. Blame i386. */
+ if (phys_last_addr > (VM_MAX_KERNEL_ADDRESS / 16) * 15)
+ phys_last_addr = (VM_MAX_KERNEL_ADDRESS / 16) * 15;
+
phys_first_addr = round_page(phys_first_addr);
phys_last_addr = trunc_page(phys_last_addr);
}