Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Oct 2006 15:18:19 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        Ruslan Ermilov <ru@freebsd.org>
Cc:        freebsd-stable@freebsd.org, Stefan Bethke <stb@lassitu.de>, Bruce Evans <bde@zeta.org.au>, Bruce Evans <bde@freebsd.org>
Subject:   Re: Still possible to directly boot without loader?
Message-ID:  <200610301518.20175.jhb@freebsd.org>
In-Reply-To: <20061026195419.GA2972@rambler-co.ru>
References:  <3A8131D4-881E-4873-A682-543A1A88C063@lassitu.de> <200610261542.35322.jhb@freebsd.org> <20061026195419.GA2972@rambler-co.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 26 October 2006 15:54, Ruslan Ermilov wrote:
> On Thu, Oct 26, 2006 at 03:42:34PM -0400, John Baldwin wrote:
> > On Thursday 26 October 2006 15:18, Ruslan Ermilov wrote:
> > > On Thu, Oct 26, 2006 at 11:38:24AM -0400, John Baldwin wrote:
> > > > On Thursday 26 October 2006 10:42, Ruslan Ermilov wrote:
> > > > > On Thu, Oct 26, 2006 at 10:28:09AM -0400, John Baldwin wrote:
> > > > > > boot2 should do whatever loader does.
> > > > > > 
> > > > > But this would be a regression, since loader(8) does the following,
> > > > > in the ELF32 case:
> > > > > 
> > > > > : 0 edoofus:ttyp2:/sys/boot/i386/libi386 >grep -w entry 
elf32_freebsd.c
> > > > > :     vm_offset_t                 entry, bootinfop, modulep, 
kernend;
> > > > > :     entry = ehdr->e_entry & 0xffffff;
> > > > > :     printf("Start @ 0x%lx ...\n", entry);
> > > > > :     __exec((void *)entry, boothowto, bootdev, 0, 0, 0, bootinfop, 
modulep, kernend);
> > > > 
> > > > Ah, ok.  Make them both just mask the top 8 bits then. :)
> > > > 
> > > OK, I backed out your change to boot2.c.
> > 
> > Sorry, I meant that both boot2 and loader should follow your proposal of 
masking 28 bits.
> > Just masking the top 4 bits is probably sufficient.
> > 
> :-)
> 
> OK, I'll craft a patch tomorrow.  This will also require patching at least
> sys/boot/common/load_elf.c:__elfN(loadimage), maybe something else.
> I think we could actually mask 30 bits; that would allow to load 1G kernels,
> provided that sufficient memory exists.

Actually, please mask 4 bits.  Not all kernels run at 0xc0000000.  You can 
adjust that address via 'options KVA_PAGES'.  I know of folks who run kernels 
at 0xa0000000 for example because they need more KVA.  This is part of why I 
really don't like the masking part, though I'm not sure there's a way to 
figure out KERNBASE well enough to do the more correct 'pa = addr - KERNBASE' 
rather than 'pa = addr & 0x0fffffff'.

-- 
John Baldwin



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