Re: memory detection and bios

Dan Merillat (Dan@merillat.org)
Sat, 26 Oct 1996 02:28:13 -0400 (EDT)


On Tue, 22 Oct 1996, Jon Tombs wrote:

> Date: Tue, 22 Oct 1996 19:04:42 +0100 (MET)
> From: Jon Tombs <jon@gte.esi.us.es>
> To: rdm@tad.micro.umn.edu
> Cc: linux-kernel@vger.rutgers.edu
> Subject: Re: memory detection and bios
>
> rdm@tad.micro.umn.edu said:
> >
> > bios can only report 64Meg. Is there a reason the kernel can't do
> > a search for the memory boundary if 64Meg is available? [e.g. check
> > at 128M, 256M, ... then binary search for boundary when get a miss --
> > maybe do something quick and simple to check for a proper boundary like
> > check the location immediately past the last known good location.]
> >
> > If this causes problems on some machines it could be made a config option.
> >
> > For people whose bioses report the wrong value, this could be made
> > "always on" instead of "only if 64M reported".
>
> What if you have a memory mapped device or frame buffer at 128MB. Memory probes
> can be quite dangerous with some hardware (the probe tells your
> memory mapped scsi controler to format the drive..)
>
> Just add mem=XXXM to the kernel boot options (e.g. append option in
> lilo.conf) and all will be well.

Um, no. The same could be said for NE2000 network cards, yet a lot of people
spent a lot of time arranging the probe order so that NE2k cards would be
discovered properly and not take out the ISA bus.

There is a bios extension that says how much memory you really have (no 64meg
limit) The arguments against it are all based on the fact that it is an
extension... My take is:

mem64=plainbios();
memext=extendedbios();
mem=mem64;
if ( memext > 64m ) {
if (( mem64 = ( memext % 64m )) or ( mem64 = 64m ) ) {
/* Now we believe the extended bios enough to check for
ourselves
*/
if probememory(memext - 1) {
mem=memext;
}
}
}

That takes out the arguments against bad bios results...
I don't think the standard bios call returns random results (if it does,
you need a new motherboard) so it either reports only 64meg, or realmem mod
64. The test I outlined takes care of anything wierd... and you can allways
resort to mem=whatever on the lilo boot prompt.

But I havn't heard any REALLY convincing arguments on why you "must" specify
the amount of memory you have. Everything else in linux is based on the
premise "specify if autodetect fails". Of all my wierd hardware, the only
thing in my lilo append line is "mem=96m"

This also means I have to go through an incredible hassle to boot off of
diskette... instead of just copying the kernel to the disk, I have to create
an entire lilo boot floppy for it... faugh.

Besides, BIOS memory check just checks to see if memory is there... by
writing to it. So unless your BIOS formats your scsi disk every time you
boot, I don't see the problem.

Anyway, if not the above, how about something I can use rdev on?
rdev -m /dev/fd0 96m?

--Dan