Subject: Re: 200206130000 pre-1.6 snapshot: sysinst troubles on >= 2GB machines
To: None <jtc@acorntoolworks.com>
From: Perry E. Metzger <perry@wasabisystems.com>
List: tech-kern
Date: 06/15/2002 01:16:35
jtc@acorntoolworks.com (J.T. Conklin) writes:
> It appears that get_ramsize() botches the calculation of amount of
> memory free, which causes no end of trouble when the value is used 
> to derrive other values (like partition table defaults).
> 
> Because ramsize is a long, the expression that computes rammb over-
> flows on my 2GB machine.  ramsize itself starts out overflowed on >
> 2GB machines.

Hmm. For what it is worth, I'm not clear on whether the HW_PHYSMEM
sysctl does the right thing in the first place. sysctl doesn't seem to
have much of a concept of types other than some vague "integer".

Furthermore, physmem itself, in systm.h, is defined as an int, not as
an unsigned value (or better yet, some better type still, as even on
an i386 technically more than 4G of RAM are possible).

It appears, by the way, that systm.h should be looked through -- there
are a number of values in there that are potentially badly typed in
modern situations.

--
Perry E. Metzger		perry@wasabisystems.com
--
NetBSD: The right OS for your embedded design. http://www.wasabisystems.com/