Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Oct 1998 16:58:19 -0400 (EDT)
From:      Brian Feldman <green@zone.syracuse.net>
To:        "Eric J. Chet" <ejc@bazzle.com>
Cc:        current@FreeBSD.ORG
Subject:   Re: Problem with 3-stage bootloader 
Message-ID:  <Pine.BSF.4.04.9810041643200.2627-100000@zone.syracuse.net>
In-Reply-To: <Pine.BSF.3.96.981004142446.4992A-100000@gargoyle.bazzle.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Okay, I figured this out myself. You are incorrect, it does NOT work, in
one very important case: with DDB. No, sorry, DDB is _not_ ELF-ready yet.
For one, in an ELF kernel db_aout.c is still used when db_elf.c needs to
be used, but more importantly, db_elf.c is broken. I fixed it up enough to
get it to work and compile, but I was getting ksym_start and ksym_end from
bootinfo, which doesn't seem to be right, as ELF DDB does not like
bi_symtab and bi_esymtab. Or, maybe, the boot-loader isn't setting the
bootinfo correctly (does the boot-loader do that? it sure seems so, seeing
as /boot/loader breaks DDB on an a.out kernel.) So basically, I think the
bootloader has problems that need to be fixed for both a.out and ELF
before it should be used. Next order of business: after booting my working
ELF kernel with the _CORRECT_ db_(format).c (unlike what happens by
default now), modules are entirely non-working. Modload doesn't work, as
it won't recognize the kernel. My ELF-hacked modload has a chance of
working, but I stopped after converting the arguments to ld from the
pre-binutils-2.x to the current format, so it would actually run, and
generate /tmp/mod_whatever.out, seeing as I did not want to muck around in
all that a.out code, and since kldload(2) should deprecate modload.
However, after generating kldloadable modules (first ELF, then a.out) I
learned
	a. kldload doesn't recognize ELF .ko's
	b. kldload faults on an a.out .ko
So whoever does the kld stuff (Polstra?) should take a look at kldload(),
and maybe I shall rewrite modload(8) for ELF before 3.0-RELEASE, if
modload will have to be used :( And Mike Smith, you do the new 3-stage
loader, right? Well you should look  at the struct bootinfo code, I
suppose. And whoever works on DDB, needs to comb through db_elf.c, I
didn't find it too hard to fix it to boot, and it shouldn't be hard to get
ksym_start and ksym_end (or whatever they are on non-NetBSD, bootinfo
right?) </rant> Sorry, I've taken up too much space already. I'm willing
to work on things, such as kldload, but it's nice that right now I have a
working, booting a.out kernel, so I'm not about to kluge around in other
people's code (that they know better than I do) just for a fully ELF
system. Oh, last problem, if modload _will_ be used in the ELF world with
an ELF kernel: symorder is a.out, perhaps a bit of sh/nm/ld replacement
action is in order (which I could do, if symorder really is that
important). Hope this helps =)

Cheers,
Brian Feldman

 On Sun, 4 Oct 1998, Eric J. Chet wrote:

> 
> On Sun, 4 Oct 1998, Brian Feldman wrote:
> 
> > I too cannot boot an ELF kernel yet, as I get a page fault as well :( more
> > info when I get some. Oh, yes, this is with the very latest kernel and
> > loader (with the esym = ssym = 0 fixes).
> > 
> 
> Hello
> 
> 	It might help somebody so, this is the procedure I used to
> upgrade to an elf kernel.  I just installed an elf kernel and booted
> without any problems.  I'm -current as of Oct 4 12:44pm EDT.
> 
> cd /sys/boot
> make depend && make && make install
> 
> echo "/boot/loader" >/boot.conf
> 
> cd /sys/i386/conf
> export KERNFORMAT=elf  #you can put "KERNFORMAT=elf" in your /etc/make.conf
> config -r configfile
> 
> cd ../../compile/configfile
> make depend && make && make install
> 
> reboot
> 
> Regards,
> 
> Eric Chet -> ejc@bazzle.com || ejc@FreeBSD.ORG || ejchet@lucent.com
> Systems Analysts - Specializing in OOA, OOD, C++, Java and CORBA 
> Kenpo Jiu-Jitsu the Ultimate in Self Defense, Tai Chi for Life
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-current" in the body of the message
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.04.9810041643200.2627-100000>