From 2f58373a59815b46a19355f18227f2304bd651ef Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 20 Oct 2009 17:48:58 +0100 Subject: Better estimate avail_remaining * i386/i386at/model_dep.c (mem_size_init): Move avail_remaining computation to after all phys_last_addr corrections. --- i386/i386at/model_dep.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'i386/i386at') diff --git a/i386/i386at/model_dep.c b/i386/i386at/model_dep.c index b98a4d8..975f60a 100644 --- a/i386/i386at/model_dep.c +++ b/i386/i386at/model_dep.c @@ -225,10 +225,9 @@ mem_size_init(void) phys_last_kb = 0x400000 - 1; } + /* TODO: support mmap */ + phys_last_addr = phys_last_kb * 0x400; - avail_remaining - = phys_last_addr - (0x100000 - (boot_info.mem_lower * 0x400) - - 0x1000); printf("AT386 boot: physical memory from 0x%x to 0x%x\n", phys_first_addr, phys_last_addr); @@ -242,6 +241,10 @@ mem_size_init(void) phys_first_addr = round_page(phys_first_addr); phys_last_addr = trunc_page(phys_last_addr); + + avail_remaining + = phys_last_addr - (0x100000 - (boot_info.mem_lower * 0x400) + - 0x1000); } /* -- cgit v1.2.3