Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Dec 1996 08:50:04 -0500
From:      Tony Overfield <tony@dell.com>
To:        Terry Lambert <terry@lambert.org>
Cc:        eivind@dimaga.com, hackers@freebsd.org
Subject:   Boot loader hacks was: Re: MAXMEM
Message-ID:  <3.0.1.32.19961216085001.0067ee14@bugs.us.dell.com>

next in thread | raw e-mail | index | archive | help
At 01:41 PM 12/15/96 -0700, Terry Lambert wrote:
>> There are standardized BIOS calls to obtain the correct amount of 
>> memory, even when it exceeds 65 MB.  I think the boot loader should 
>> make these BIOS calls and pass the correct information to the kernel.
>
>Go ahead and add it.  Make sure the boot code doesn't grow over
>the 8k limit imposed on it by the fact that there isn't any more
>space between the start of the BSD area on the disk and the disklabel
>on everyone's hardrives for several years now...
>
>					Regards,
>					Terry Lambert
>					terry@lambert.org
>---
>Any opinions in this posting are my own and not those of my present
>or previous employers.

I think that boot2 can only be 7 KB.  Even so, there seems to be plenty 
of space to do this.  So I started hacking on FreeBSD.  (There should 
be a mailing list for this kind of thing.)

My first quick attempt, which still needs improvement, though it works 
fine on my 96 MB system :-), adds about 160 bytes of bloat to boot2 to 
bring it from 6576 to 6736 bytes.  I only coded in the E820h function, 
and not the E801h function, since E820h is the harder one.  There's 
still over 400 bytes left for more stuff!

My code doesn't fully comprehend the E820h call, it just looks for any 
valid system memory descriptor that starts at 1 MB and it takes that 
one.  Extra code to merge in overlaps and adjacencies would consume 
several more bytes  :-(.  Ironically, it looks like fully generalizing 
the function to pass the entire table of information to the kernel for 
processing would probably be smaller.

Unfortunately, 

          if (bootinfo.bi_extmem != biosextmem)
                 printf("BIOS extmem (%ldK) != RTC extmem (%dK)\n",
                         bootinfo.bi_extmem, biosextmem);

this code in machdep.c complains about my boot loader patches but 
doesn't choose the bigger value.  Does anyone know why the comment, 
"Prefer the RTC value for extended memory."  appears near this code?

Well I didn't, so I added these lines right afterwards:

          if (bootinfo.bi_extmem > biosextmem)
                 biosextmem = bootinfo.bi_extmem;

I can send diffs if anybody wants them.  I'm not very proud of how 
I drew the line between the .c and the .S code, so I didn't put them 
up here in front of everybody.

-
Tony





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3.0.1.32.19961216085001.0067ee14>