Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Dec 1996 04:33:00 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        terry@lambert.org, tony@dell.com
Cc:        eivind@dimaga.com, hackers@FreeBSD.ORG
Subject:   Re: Boot loader hacks was: Re: MAXMEM
Message-ID:  <199612161733.EAA18177@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>>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...

>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.)

It can be of almost any size, but is currently limited to 7.5K (or
4.5K on 9-sector floppies :-).  BSD file systems have a reserved area
for boot blocks at the front of them.  Unfortunately, the size has been
hard-coded as 8K in the key utilities (disklabel, newfs and sysinstall)
for many years, so there is little space to spare for new boot blocks on
old disks.  The utilities also don't support putting the boot blocks on a
separate partition or keeping them outside of all partitions very well.
There is also a 7.5K limit because the boot blocks are too stupid to
load themselves if they cross a track boundary.

>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!

Don't forget to compile it with all the options :-).  I think it's
already over 7.5K if they are all enabled.

>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;

Because of the rule "never change a ``working'' system".  It's just as
well that it wasn't changed - memsize() doesn't clear the top 16 bits
properly, even for the base memory size.

Bruce



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