From owner-freebsd-hackers Mon Dec 16 06:53:05 1996 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id GAA10176 for hackers-outgoing; Mon, 16 Dec 1996 06:53:05 -0800 (PST) Received: from bugs.us.dell.com (bugs.us.dell.com [143.166.169.147]) by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id GAA10161 for ; Mon, 16 Dec 1996 06:53:00 -0800 (PST) Received: from ant.us.dell.com (ant.us.dell.com [198.64.66.34]) by bugs.us.dell.com (8.6.12/8.6.12) with SMTP id IAA16298; Mon, 16 Dec 1996 08:50:03 -0600 Message-Id: <3.0.1.32.19961216085001.0067ee14@bugs.us.dell.com> X-Sender: tony@bugs.us.dell.com X-Mailer: Windows Eudora Light Version 3.0.1 beta 4 (32) Date: Mon, 16 Dec 1996 08:50:04 -0500 To: Terry Lambert From: Tony Overfield Subject: Boot loader hacks was: Re: MAXMEM Cc: eivind@dimaga.com, hackers@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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