summaryrefslogtreecommitdiff
path: root/i386/i386at
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2009-10-14 00:09:05 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2009-10-14 00:09:05 +0200
commit909c941dc0a2f55828855ee58f9022ffdbbd0b79 (patch)
treebb5039127cecd976ecc5a0df1800ca028c76e16e /i386/i386at
parent43ef1428d191e6872ed6f66c976329d5d00741fc (diff)
Advertise memory size truncations
i386/i386at/model_dep.c (mem_size_init): Advertise memory size truncations.
Diffstat (limited to 'i386/i386at')
-rw-r--r--i386/i386at/model_dep.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/i386/i386at/model_dep.c b/i386/i386at/model_dep.c
index 2426cde..741726d 100644
--- a/i386/i386at/model_dep.c
+++ b/i386/i386at/model_dep.c
@@ -220,8 +220,10 @@ mem_size_init(void)
phys_last_kb = 0x400 + boot_info.mem_upper;
/* Avoid 4GiB overflow. */
- if (phys_last_kb < 0x400 || phys_last_kb >= 0x400000)
+ if (phys_last_kb < 0x400 || phys_last_kb >= 0x400000) {
+ printf("Truncating memory size to 4GiB\n");
phys_last_kb = 0x400000 - 1;
+ }
phys_last_addr = phys_last_kb * 0x400;
avail_remaining
@@ -233,8 +235,10 @@ mem_size_init(void)
/* 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;
+ if (phys_last_addr > (VM_MAX_KERNEL_ADDRESS / 8) * 7) {
+ phys_last_addr = (VM_MAX_KERNEL_ADDRESS / 8) * 7;
+ printf("Truncating memory size to %dMiB\n", (phys_last_addr - phys_first_addr) / (1024 * 1024));
+ }
phys_first_addr = round_page(phys_first_addr);
phys_last_addr = trunc_page(phys_last_addr);