Subject: port-i386/14435: i386 machdep.c patch
To: None <firstname.lastname@example.org>
From: None <email@example.com>
Date: 11/02/2001 14:11:11
>Synopsis: assymetry between old and new bootcode in i386/machdep.c
>Arrival-Date: Fri Nov 02 05:17:00 PST 2001
>Originator: Feico Dillema
>Release: NetBSD 1.5Y
University of Tromsų
System: NetBSD drifter.dillema.net 1.5Y NetBSD 1.5Y (DRIFTER) #6: Thu Nov 1 17:29:22 CET 2001 firstname.lastname@example.org:/usr/cvs/netbsd-current/sys/arch/i386/compile/DRIFTER i386
i386/machdep.c has two different code paths for registring the physical memory
in a machine at boottime. The first use add_mem_cluster() and the second is the
`old style' code that is used when add_mem_cluster() fails for some reason or
when kernel options REALBASEMEM and REALEXTMEM are set.
While debugging my problem with booting a Compaq Proliant Server I stumbled
across some descrepancy between the two code paths. I believed fixing that
would solve my problem with the Compaq. It didn't, as I found out my problem
was caused by the bootloader I was using (Grub).
Even though it did not solve my problem, I still think my patch is relevant.
How relevant, is up to somebody who is more knowledgeable on these things
than me to decide.
NA. Only report a fix, not a problem it actually fixes...
Here's the patch against for sys/arch/i386/i386:
/* $NetBSD: machdep.c,v 1.457 2001/09/19 01:26:19 thorpej Exp $ */
--- machdep.c.orig Fri Nov 2 13:56:26 2001
+++ machdep.c Fri Nov 2 13:57:03 2001
@@ -2546,11 +2546,14 @@
mem_clusters.start = IOM_END;
mem_clusters.size = trunc_page(KBTOB(biosextmem));
+ if ((mem_clusters.start + mem_clusters.size) == 0x100000000ULL)
+ mem_clusters.size -= PAGE_SIZE;
physmem += atop(mem_clusters.size);
mem_cluster_cnt = 2;
- avail_end = IOM_END + trunc_page(KBTOB(biosextmem));
+ avail_end = mem_clusters.start + mem_clusters.size;